/* =============================================
   LOGISTIS PORTAL - Main Stylesheet
   Ίδιο look & feel με OPEX
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15px;
    background: #f5f5f5;
    color: #333;
}

a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAVBAR ── */
.navbar {
    background: #1a73e8;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 52px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.navbar-admin { background: #1557b0; }
.navbar-brand a {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
}
.admin-badge {
    background: #ff4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}
.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2px;
    flex: 1;
    margin-left: 20px;
}
.navbar-menu li a {
    color: rgba(255,255,255,0.88);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    display: block;
    transition: background 0.15s;
}
.navbar-menu li a:hover,
.navbar-menu li.active a {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    margin-left: auto;
}

/* Active client bar */
.active-client-bar {
    background: #e8f0fe;
    border-bottom: 1px solid #c5d5f8;
    padding: 6px 20px;
    font-size: 13px;
    color: #333;
}
.active-client-bar a {
    margin-left: 10px;
    font-size: 12px;
    color: #1a73e8;
}

/* ── CONTAINER ── */
.container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ── TITLES ── */
.page-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #222;
}
.page-subtitle {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* ── ALERTS ── */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success  { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning  { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.alert-info     { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert-secondary{ background: #e9ecef; color: #383d41; border: 1px solid #d6d8db; }

/* ── BUTTONS ── */
.btn {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1.4;
}
.btn:hover { opacity: 0.88; text-decoration: none; }
.btn-primary   { background: #1a73e8; color: #fff; }
.btn-success   { background: #28a745; color: #fff; }
.btn-warning   { background: #e0a800; color: #fff; }
.btn-danger    { background: #dc3545; color: #fff; }
.btn-secondary { background: #6c757d; color: #fff; }
.btn-info      { background: #17a2b8; color: #fff; }
.btn-outline   { background: transparent; color: #1a73e8; border: 1px solid #1a73e8; }
.btn-outline-light { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.6); }
.btn-outline-success { background: transparent; color: #28a745; border: 1px solid #28a745; }
.btn-sm  { padding: 4px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── BADGES ── */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success   { background: #28a745; color: #fff; }
.badge-warning   { background: #ffc107; color: #333; }
.badge-danger    { background: #dc3545; color: #fff; }
.badge-info      { background: #17a2b8; color: #fff; }
.badge-secondary { background: #6c757d; color: #fff; }
.badge-teal      { background: #20c997; color: #fff; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; flex: 1; min-width: 200px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}
.form-control {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.15s;
}
.form-control:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26,115,232,0.15);
}
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.form-card {
    background: #fff;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.form-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}
.form-control-sm { padding: 4px 8px; font-size: 13px; }
.text-muted { color: #888; font-size: 13px; }

/* ── TABLES ── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    font-size: 14px;
}
.data-table thead tr { background: #1a73e8; color: #fff; }
.data-table th { padding: 12px 14px; text-align: left; font-weight: 600; font-size: 13px; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; }
.data-table tbody tr:hover { background: #f8f9ff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.text-right { text-align: right; }
.text-center { text-align: center; }

/* ── CLIENT CARDS (home.php) ── */
.client-card {
    background: #fff;
    border: 1px solid #dde3f0;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.client-info { font-size: 15px; }
.client-actions { display: flex; gap: 8px; }

/* ── SECTION BOX ── */
.section-box {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.section-box h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
}
.section-box h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ── SEARCH BOX ── */
.search-box {
    background: #fff;
    border-radius: 8px;
    margin-top: 24px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.search-box-title {
    background: #1a73e8;
    color: #fff;
    padding: 12px 20px;
    font-weight: 600;
    font-size: 14px;
}
.search-form { padding: 16px 20px; }
.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.search-row label {
    width: 160px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
    background: #f0f0f0;
    padding: 7px 12px;
    border-radius: 4px;
}
.search-row input,
.search-row select { flex: 1; }
.search-date { display: flex; align-items: center; gap: 8px; flex: 1; }
.search-date span { font-size: 13px; color: #666; }
.search-date input { flex: 1; }

/* ── BILLING ── */
.billing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.billing-client-info {
    background: #fff;
    border: 1px solid #dde3f0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}
.billing-table tfoot tr {
    background: #f0f4ff;
    font-weight: 600;
}
.billing-totals td { padding: 12px 14px; }
.billing-status-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    align-items: center;
}

/* ── YEAR/MONTH FORM ── */
.year-month-form {
    display: flex;
    gap: 8px;
    align-items: center;
}
.year-month-form select {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
}

/* ── TAX DOCS GRID ── */
.docs-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.doc-card {
    background: #fff;
    border: 1px solid #dde3f0;
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.doc-icon  { font-size: 28px; }
.doc-info  { flex: 1; }
.doc-title { font-weight: 600; font-size: 15px; margin-bottom: 3px; }
.doc-type  { font-size: 12px; color: #1a73e8; font-weight: 600; }
.doc-date  { font-size: 12px; color: #888; margin-top: 2px; }

/* ── SUPPORT / CHAT ── */
.ticket-header {
    background: #fff;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.ticket-header h2 {
    font-size: 20px;
    margin: 10px 0 6px;
}
.ticket-meta {
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}
.chat-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}
.chat-message { display: flex; }
.chat-staff   { justify-content: flex-end; }
.chat-client  { justify-content: flex-start; }
.chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.chat-staff  .chat-bubble {
    background: #e8f0fe;
    border-bottom-right-radius: 2px;
}
.chat-client .chat-bubble {
    background: #fff;
    border-bottom-left-radius: 2px;
    border: 1px solid #eee;
}
.chat-sender {
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 5px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 6px;
}
.chat-text { line-height: 1.6; color: #333; }
.chat-time { font-size: 11px; color: #999; margin-top: 6px; text-align: right; }

/* ── DETAIL TABLE ── */
.detail-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-top: 16px;
}
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th {
    width: 200px;
    text-align: left;
    padding: 10px 16px;
    background: #f5f5f5;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #eee;
}
.detail-table td {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

/* ── ADMIN STATS GRID ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-top: 4px solid #1a73e8;
}
.stat-card-warning { border-top-color: #ffc107; }
.stat-card-danger  { border-top-color: #dc3545; }
.stat-number {
    font-size: 42px;
    font-weight: 700;
    color: #1a73e8;
    line-height: 1;
    margin-bottom: 8px;
}
.stat-card-warning .stat-number { color: #e0a800; }
.stat-card-danger  .stat-number { color: #dc3545; }
.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* ── FILTER TABS ── */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── LOGIN PAGE ── */
.login-body {
    background: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-box {
    background: #fff;
    border-radius: 10px;
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.login-logo {
    font-size: 26px;
    font-weight: 700;
    color: #1a73e8;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: 1px;
}

/* ── FOOTER ── */
.footer {
    margin-top: 60px;
    padding: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #888;
    flex-wrap: wrap;
    gap: 10px;
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: #888; }
.footer-links a:hover { color: #1a73e8; }

/* ── UTILITIES ── */
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.hr    { border: none; border-top: 1px solid #eee; margin: 20px 0; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .navbar-menu {
        display: none;
    }
    .navbar-menu.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 52px; left: 0; right: 0;
        background: #1a73e8;
        padding: 10px;
        z-index: 99;
    }
    .container        { padding: 0 12px; }
    .form-row         { flex-direction: column; }
    .client-card      { flex-direction: column; align-items: flex-start; gap: 10px; }
    .stats-grid       { grid-template-columns: repeat(2, 1fr); }
    .chat-bubble      { max-width: 90%; }
    .billing-header   { flex-direction: column; }
    .detail-table th  { width: 130px; }
    .page-header-row  { flex-direction: column; align-items: flex-start; gap: 10px; }
    .search-row       { flex-direction: column; align-items: flex-start; }
    .search-row label { width: 100%; }
}
