/* =============================================================================
   THISEAS - main stylesheet
   Mobile-first, responsive. Sidebar σε desktop, bottom nav σε mobile.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   1. RESET / BASE
   ----------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    /* Σε στενές οθόνες αν κάτι ξεφύγει, ΜΗΝ επιτρέψεις horizontal scroll
     * ολόκληρης της σελίδας (έχουμε ad-hoc tables σε .table-wrap που
     * scroll-άρουν εσωτερικά τους). */
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans",
                 sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 15px;
    line-height: 1.45;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

/* -----------------------------------------------------------------------------
   2. THEME VARIABLES — THISEAS Technical Services
   ----------------------------------------------------------------------------- */
:root {
    /* Brand: raspberry/cerise από το logo (#D91A5D) */
    --primary:        #d91a5d;
    --primary-dark:   #a3134a;   /* hover/active, gradient stop */
    --primary-light:  #ec4f86;
    --accent:         #d91a5d;

    /* Sidebar dark: charcoal (ταιριάζει με το μαύρο "THISEAS" του logo) */
    --sidebar-bg:        #1f2937;
    --sidebar-bg-hover:  #2d3748;

    --success:        #16a34a;
    --success-bg:     #dcfce7;
    --warning:        #f59e0b;
    --warning-bg:     #fef3c7;
    --danger:         #dc2626;     /* scarlet, διακρίνεται από το raspberry primary */
    --danger-bg:      #fee2e2;
    --info:           #0ea5e9;
    --info-bg:        #e0f2fe;

    --text:           #0f172a;
    --text-muted:     #64748b;
    --text-soft:      #475569;

    --bg:             #ffffff;
    --bg-soft:        #f4f4f5;
    --bg-section:     #fafafa;
    --border:         #e5e7eb;
    --border-strong:  #d1d5db;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
    --shadow:    0 4px 12px rgba(15,23,42,.08);
    --shadow-lg: 0 12px 24px rgba(15,23,42,.12);

    --transition: 150ms ease;
}

/* -----------------------------------------------------------------------------
   3. LAYOUT — TOPBAR / SIDEBAR / BOTTOMNAV
   ----------------------------------------------------------------------------- */
.app {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}
.layout { min-width: 0; }
.content { min-width: 0; }

.topbar {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: var(--shadow-sm);
}
/* Burger button (mobile only) */
.topbar .burger {
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.12);
    border: 0;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-right: 4px;
}
.topbar .burger:hover { background: rgba(255,255,255,.2); }
.topbar .burger:active { transform: scale(.95); }

@media (max-width: 991px) {
    .topbar .burger { display: inline-flex; }
}

.topbar .brand-mini {
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar .brand-mini a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
}
.topbar .brand-mini img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 3px;
    flex-shrink: 0;
}
.topbar .topbar-spacer { flex: 1; }
.topbar .topbar-user {
    font-size: 13px;
    opacity: .95;
    display: flex;
    align-items: center;
    gap: 10px;
}
.topbar .topbar-user-link {
    display: block;
    text-align: right;
    line-height: 1.15;
    color: #fff;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.topbar .topbar-user-link:hover {
    background: rgba(255,255,255,.12);
    text-decoration: none;
}
.topbar .topbar-user-name { font-weight: 600; }
.topbar .topbar-user-role { font-size: 11px; opacity: .85; }
.topbar .btn-logout {
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 0;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.topbar .btn-logout:hover { background: rgba(255,255,255,.2); }

/* Σε στενές οθόνες (<640px), κρύψε όνομα/ρόλο για να χωρέσει το logout. */
@media (max-width: 639px) {
    .topbar .topbar-user-link { display: none; }
    .topbar .btn-logout { padding: 6px 10px; font-size: 12px; }
    .topbar .brand-mini span { font-size: 15px; }
}
/* Σε πολύ στενές (<400px) ακόμα πιο compact */
@media (max-width: 399px) {
    .topbar { padding: 10px 12px; gap: 8px; }
    .topbar .brand-mini img { width: 24px; height: 24px; }
    .topbar .brand-mini span { display: none; }   /* μόνο το H icon */
}

.layout {
    display: grid;
    grid-template-columns: 1fr;
}

/* Sidebar / Drawer
 *  - Desktop (≥992px): static αριστερά (κανονικό sidebar)
 *  - Mobile (<992px): slide-in drawer που ανοίγει από το burger
 */
.sidebar {
    background: var(--sidebar-bg);
    color: #fff;
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85%;
    z-index: 40;
    padding: 16px 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 220ms ease-out;
    box-shadow: var(--shadow-lg);
}
.sidebar.is-open { transform: translateX(0); }

/* Drawer overlay (μόνο όταν drawer ανοιχτό σε mobile) */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(15, 23, 42, .45);
    z-index: 35;
    opacity: 0;
    transition: opacity 200ms ease;
}
.drawer-overlay.is-open {
    display: block;
    opacity: 1;
}

@media (min-width: 992px) {
    /* Σε desktop: sidebar = static, drawer overlay κρυμμένο */
    .sidebar {
        position: static;
        top: auto;
        left: auto;
        bottom: auto;
        width: auto;
        max-width: none;
        z-index: auto;
        transform: none;
        transition: none;
        box-shadow: none;
    }
    .drawer-overlay { display: none !important; }
}

.content {
    padding: 16px;
    padding-bottom: 90px;      /* χώρος για bottom nav σε mobile */
    max-width: 100%;
}

/* Bottom nav (mobile) ------------------------------------- */
.bottomnav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    z-index: 25;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottomnav a {
    color: var(--text-muted);
    padding: 10px 6px;
    text-align: center;
    font-size: 12px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.bottomnav a.is-active { color: var(--primary); font-weight: 600; }
.bottomnav .ic { font-size: 20px; line-height: 1; }

@media (min-width: 992px) {
    .layout {
        grid-template-columns: 240px 1fr;
    }
    .sidebar { min-height: calc(100vh - 56px); }
    .bottomnav { display: none; }
    .content { padding: 24px 28px; padding-bottom: 32px; }
}

/* Sidebar contents — ΠΑΝΤΑ (και σε desktop static + σε mobile drawer) */
.sidebar h3 {
    color: rgba(255,255,255,.5);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 16px 16px 8px;
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.85);
    padding: 11px 16px;
    font-size: 14px;
    border-left: 3px solid transparent;
    text-decoration: none;
}
.sidebar a:hover { background: var(--sidebar-bg-hover); text-decoration: none; }
.sidebar a.is-active {
    background: rgba(217, 26, 93, .18);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 600;
}
.sidebar .ic { font-size: 16px; width: 22px; text-align: center; }

/* -----------------------------------------------------------------------------
   4. PAGE HEADERS
   ----------------------------------------------------------------------------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 18px;
}
.page-header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
@media (max-width: 479px) {
    .page-header h1 { font-size: 18px; }
}
.page-header .subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 2px;
}

/* -----------------------------------------------------------------------------
   5. FORMS
   ----------------------------------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
@media (min-width: 768px) {
    .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
    .form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}

.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.full { grid-column: 1 / -1; }

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
}
.form-label .required { color: var(--danger); margin-left: 2px; }

.form-control,
select.form-control,
textarea.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 16px;     /* μεγάλο για mobile, αποτρέπει zoom */
    background: #fff;
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
}
.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, .15);
}
.form-control:disabled,
.form-control[readonly] {
    background: var(--bg-soft);
    color: var(--text-muted);
}
textarea.form-control { min-height: 110px; resize: vertical; }

.form-help { font-size: 12px; color: var(--text-muted); }
.form-error { font-size: 12px; color: var(--danger); }

.form-control.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px var(--danger-bg);
}

.password-field { position: relative; }
.btn-toggle-password {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    padding: 6px 10px;
    font-size: 16px;
    color: var(--text-muted);
}

/* -----------------------------------------------------------------------------
   6. BUTTONS
   ----------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    background: var(--bg-soft);
    color: var(--text);
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-block { width: 100%; display: flex; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; text-decoration: none; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; text-decoration: none; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d97706; text-decoration: none; }

.btn-outline {
    background: #fff;
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; text-decoration: none; }

.btn-ghost {
    background: transparent;
    color: var(--text-soft);
    border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-soft); }

.btn-lg  { padding: 14px 22px; font-size: 17px; }
.btn-sm  { padding: 7px 12px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-xs  { padding: 4px 8px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-row {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 10px;
}

/* -----------------------------------------------------------------------------
   7. CARDS
   ----------------------------------------------------------------------------- */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    margin-bottom: 14px;
}
.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px;
}
.card-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.card-title-row .card-title { margin-bottom: 0; }
.card-title-row .card-meta {
    color: var(--text-muted);
    font-size: 13px;
}
.card-section { margin-top: 18px; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (min-width: 600px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1280px){ .stat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    min-width: 0;        /* επιτρέπει σε grid items να συρρικνωθούν */
    overflow: hidden;
}
.stat-card .stat-label {
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    line-height: 1.25;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    /* Min height ώστε όταν κάποια labels κάνουν wrap σε 2 γραμμές, οι
     * αριθμοί όλων των cards να ευθυγραμμίζονται οπτικά. */
    min-height: 28px;
}
.stat-card .stat-value {
    margin-top: 6px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}
/* Σε στενές οθόνες (<400px) μικρύνουμε λίγο για να χωράνε καλύτερα. */
@media (max-width: 399px) {
    .stat-card             { padding: 11px 12px; }
    .stat-card .stat-value { font-size: 18px; }
    .stat-card .stat-label { font-size: 11px; }
}
@media (min-width: 768px) {
    .stat-card .stat-value { font-size: 24px; }
}
.stat-card.success { border-left-color: var(--success); }
.stat-card.danger  { border-left-color: var(--danger); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.info    { border-left-color: var(--info); }

/* -----------------------------------------------------------------------------
   8. TABLES (desktop) + CARD-LIST (mobile)
   ----------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 14px;
}
.table thead th {
    background: var(--bg-section);
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}
.table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:hover { background: var(--bg-section); }

/* Tabular numerics: σταθερό πλάτος ψηφίων ώστε στήλες με αριθμούς να ευθυγραμμίζονται */
.table td.text-right,
.table th.text-right,
.table tfoot td {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* Footer row με σύνολα — διακριτό background + top border */
.table tfoot td {
    padding: 12px;
    background: var(--bg-section);
    border-top: 2px solid var(--border-strong);
    font-weight: 700;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Mobile card list */
.card-list { display: grid; gap: 10px; }
.list-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
}
.list-card .list-card-title {
    font-weight: 700;
    color: var(--text);
    font-size: 15px;
    margin-bottom: 4px;
    display: flex; justify-content: space-between; gap: 6px;
}
.list-card .list-card-meta {
    color: var(--text-muted);
    font-size: 12px;
    display: flex; flex-wrap: wrap; gap: 8px;
}
.list-card .list-card-body {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-soft);
}
.list-card .list-card-actions {
    margin-top: 10px;
    display: flex; gap: 8px; flex-wrap: wrap;
}

@media (min-width: 768px) { .table-only-desktop { display: table; } .card-list-only-mobile { display: none; } }
@media (max-width: 767px) { .table-only-desktop { display: none; } .card-list-only-mobile { display: grid; } }

/* Generic responsive show/hide utility */
@media (min-width: 768px) {
    [data-only="desktop"] { display: block; }
    [data-only="mobile"]  { display: none !important; }
}
@media (max-width: 767px) {
    [data-only="desktop"] { display: none !important; }
    [data-only="mobile"]  { display: grid; }
}

/* Form sections (groups of fields with subtitle) */
.form-section {
    border: 1px solid var(--border);
    background: var(--bg-section);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-top: 14px;
}
.form-section h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: .5px;
}
.form-section .form-section-help {
    font-size: 12px;
    color: var(--text-muted);
    margin: -6px 0 10px;
}

/* Inline currency suffix */
.input-currency {
    position: relative;
}
.input-currency .form-control { padding-right: 32px; }
.input-currency::after {
    content: "€";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-weight: 600;
    pointer-events: none;
}

/* Switch / inline checkbox */
.form-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}
.form-check input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }

/* Settings tabs (admin/settings.php) */
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 16px;
    background: var(--bg-section);
    padding: 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-soft);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
}
.settings-tab:hover {
    background: #fff;
    border-color: var(--border);
    text-decoration: none;
}
.settings-tab.is-active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}
.color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--border-strong);
    vertical-align: middle;
    margin-right: 6px;
}

/* Period chips (statistics page) */
.period-chips {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--bg-section);
    padding: 4px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.period-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
}
.period-chip:hover { background: #fff; }
.period-chip input[type=radio] {
    appearance: none;
    -webkit-appearance: none;
    margin: 0; padding: 0; width: 0; height: 0;
    position: absolute;
    opacity: 0;
}
.period-chip.is-active,
.period-chip:has(input[type=radio]:checked) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    margin: 16px 0;
    justify-content: center;
}
.pagination .btn { padding: 6px 10px; }
.pagination .page-gap {
    color: var(--text-muted);
    padding: 0 6px;
    user-select: none;
}

/* Rate change modal (admin/user-form.php) */
.rate-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.rate-modal[hidden] { display: none; }
.rate-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .55);
}
.rate-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    max-width: 540px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}
.rate-modal-dialog h3 { margin: 0 0 12px; font-size: 18px; }
.rate-modal-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; }
.rate-modal-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}
.rate-modal-label { color: var(--text-soft); font-weight: 600; }
.rate-modal-old   { color: var(--text-muted); text-decoration: line-through; }
.rate-modal-arrow { color: var(--text-muted); }
.rate-modal-new   { color: var(--success); font-weight: 700; }
@media (max-width: 479px) {
    .rate-modal-row { grid-template-columns: 1fr 1fr; }
    .rate-modal-row .rate-modal-arrow { display: none; }
    .rate-modal-row .rate-modal-label { grid-column: 1 / -1; }
}

/* Audit log diff details */
.audit-details {
    padding: 12px 4px 4px;
}
.audit-details-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-soft);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.audit-diff {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.audit-diff th {
    background: var(--bg-soft);
    color: var(--text-soft);
    text-align: left;
    padding: 6px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-weight: 700;
}
.audit-diff td {
    padding: 6px 10px;
    border-top: 1px solid var(--border);
    vertical-align: top;
    word-break: break-word;
}
.audit-diff tr.is-changed td .audit-old {
    background: var(--danger-bg);
    color: #7f1d1d;
    padding: 1px 6px;
    border-radius: 4px;
    text-decoration: line-through;
    text-decoration-color: rgba(127,29,29,.4);
}
.audit-diff tr.is-changed td .audit-new {
    background: var(--success-bg);
    color: #14532d;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.audit-diff tr:not(.is-changed) td .audit-old,
.audit-diff tr:not(.is-changed) td .audit-new {
    color: var(--text-muted);
}

.audit-details-mobile {
    margin-top: 10px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.audit-details-mobile summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary);
    font-size: 13px;
    user-select: none;
}
.audit-details-mobile[open] summary { margin-bottom: 6px; }
.audit-details-mobile .audit-diff { font-size: 12px; }

/* Horizontal bar list (stats breakdowns) */
.bar-list {
    display: grid;
    gap: 8px;
}
.bar-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(80px, 2fr) auto;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.bar-label {
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bar-track {
    background: var(--bg-soft);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    height: 100%;
    transition: width 220ms ease;
}
.bar-count {
    font-weight: 700;
    color: var(--text);
    text-align: right;
    min-width: 36px;
}

/* -----------------------------------------------------------------------------
   9. ALERTS / BADGES
   ----------------------------------------------------------------------------- */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert-success { background: var(--success-bg); color: #14532d; border-color: #bbf7d0; }
.alert-danger  { background: var(--danger-bg);  color: #7f1d1d; border-color: #fecaca; }
.alert-warning { background: var(--warning-bg); color: #78350f; border-color: #fde68a; }
.alert-info    { background: var(--info-bg);    color: #075985; border-color: #bae6fd; }

.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--text-muted);
    letter-spacing: .3px;
    line-height: 1.4;
    white-space: nowrap;
}
.badge-success { background: var(--success); }
.badge-danger  { background: var(--danger); }
.badge-warning { background: var(--warning); color: #1f2937; }
.badge-info    { background: var(--info); }
.badge-primary { background: var(--primary); }
.badge-muted   { background: var(--text-muted); }
.badge-soft    { background: var(--bg-soft); color: var(--text-soft); }

/* -----------------------------------------------------------------------------
   10. FILTERS BAR
   ----------------------------------------------------------------------------- */
.filters {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 14px;
}
.filters-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (min-width: 768px) {
    .filters-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
    .filters-grid { grid-template-columns: repeat(6, 1fr); }
}
.filters-actions {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-top: 10px;
}

/* -----------------------------------------------------------------------------
   11. LOGIN PAGE
   ----------------------------------------------------------------------------- */
body.page-simple {
    background: linear-gradient(135deg, #1f2937 0%, #d91a5d 100%);
    min-height: 100vh;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    box-shadow: var(--shadow-lg);
}
.login-card .brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 22px;
}
.login-card .brand-logo {
    display: block;
    width: auto;
    max-width: 180px;
    height: auto;
    margin-bottom: 8px;
}
.login-card h1 {
    margin: 4px 0 0;
    font-size: 22px;
    color: var(--text);
    letter-spacing: 1.5px;
}
.login-card .brand-text p { margin: 2px 0 0; color: var(--text-muted); font-size: 12px; letter-spacing: .5px; }

.login-card .form-control { margin-bottom: 14px; }
.login-card .form-label { margin-top: 6px; }

.login-footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin: 18px 0 0;
}

/* -----------------------------------------------------------------------------
   12. UTILITIES
   ----------------------------------------------------------------------------- */
.text-muted   { color: var(--text-muted); }
.text-soft    { color: var(--text-soft); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-bold    { font-weight: 700; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mt-4 { margin-top: 22px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.mb-4 { margin-bottom: 22px; }

.flex      { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2     { gap: 8px; }
.gap-3     { gap: 14px; }

.hidden    { display: none !important; }

/* Key/value grid (account, profile, technician summary) */
.kv-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 0;
}
.kv-grid.cols-2 { grid-template-columns: 1fr 1fr; }
@media (min-width: 600px) {
    .kv-grid:not(.cols-2) { grid-template-columns: 1fr 1fr; }
}
.kv-grid > div {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    background: var(--bg-section);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.kv-grid dt {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 600;
    margin: 0;
}
.kv-grid dd {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text);
}

/* Screen reader only — accessible heading που δεν εμφανίζεται οπτικά */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print-friendly export μερικά basic */
@media print {
    .topbar, .sidebar, .bottomnav, .filters, .btn-row, .table-actions { display: none !important; }
    body { background: #fff; }
    .card, .table { box-shadow: none; border-color: #999; }
}
