/* =====================================================================
   Ιατρικός Σύλλογος Αγρινίου — Design tokens
   Παλέτα: βαθύ "Αιγαίο" teal + ορειχάλκινο (brass) χρυσό για επίσημες
   στιγμές (σφραγίδες/πιστοποιητικά), σε φόντο χαρτιού. Στόχος: ήρεμη,
   θεσμική, αξιόπιστη αίσθηση — όχι γενόσημο SaaS dashboard.
   ===================================================================== */

:root {
    --color-bg: #F3F6FA;
    --color-surface: #FFFFFF;
    --color-border: #DCE6F0;
    --color-ink: #14233B;
    --color-ink-muted: #5E7290;
    --color-primary: #1D4E89;
    --color-primary-dark: #123255;
    --color-primary-tint: #E7EFF8;
    --color-accent: #2E7BC7;
    --color-accent-tint: #E3F0FC;
    --color-success: #2F7A5C;
    --color-success-tint: #E7F2ED;
    --color-danger: #B23A48;
    --color-danger-tint: #FBEAEC;

    --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', 'Segoe UI', Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(20, 42, 48, 0.06);
    --shadow-md: 0 4px 16px rgba(20, 42, 48, 0.08);
    --sidebar-width: 250px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--color-primary-dark);
    font-weight: 600;
    margin: 0 0 0.5em;
}

a { color: var(--color-primary); }
a:hover { color: var(--color-primary-dark); }

:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* --- Εφαρμογή layout ------------------------------------------------ */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--color-primary-dark);
    color: #DCE8F5;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar__brand {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    margin-bottom: 1rem;
}

.sidebar__brand-name {
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.3;
    color: #fff;
    font-weight: 600;
}

.sidebar__brand-sub {
    font-size: 0.75rem;
    color: #7FA8D6;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sidebar__nav { list-style: none; margin: 0; padding: 0; flex: 1; }

.sidebar__sms-credits {
    padding: 0.6rem 1.5rem;
    font-size: 0.75rem;
    color: #A9BCD0;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.sidebar__sms-credits strong {
    color: #E4ECF5;
}

.sidebar__version {
    padding: 0.85rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.12);
}

.sidebar__version a {
    color: #6E8CB0;
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.sidebar__version a:hover,
.sidebar__version a.is-active {
    color: #C3D7EC;
}

.sidebar__credit {
    margin-top: 0.35rem;
}

.sidebar__credit a {
    color: #5C7A99;
    text-decoration: none;
    font-size: 0.68rem;
    letter-spacing: 0.01em;
}

.sidebar__credit a:hover {
    color: #A9BCD0;
    text-decoration: underline;
}

.sidebar__nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1.5rem;
    color: #C3D7EC;
    text-decoration: none;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
}

.sidebar__nav a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar__nav a.is-active {
    background: rgba(255,255,255,0.09);
    border-left-color: var(--color-accent);
    color: #fff;
    font-weight: 600;
}

.sidebar__section-label {
    padding: 1rem 1.5rem 0.35rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6E8CB0;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar__title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--color-primary-dark);
}

.topbar__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    color: var(--color-ink-muted);
}

.topbar__user strong { color: var(--color-ink); }

.content {
    padding: 2rem;
    flex: 1;
}

/* --- Στοιχεία (cards, πίνακες, κουμπιά, φόρμες) --------------------- */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.3rem;
}

.stat-card__value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    color: var(--color-primary-dark);
    font-weight: 600;
}

.stat-card__label {
    font-size: 0.82rem;
    color: var(--color-ink-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: var(--font-body);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

.btn-secondary { background: var(--color-surface); color: var(--color-ink); border-color: var(--color-border); }
.btn-secondary:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #8f2e39; color: #fff; }

.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-ink-muted);
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--color-border);
}

.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--color-primary-tint); }

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: var(--color-success-tint); color: var(--color-success); }
.badge-danger { background: var(--color-danger-tint); color: var(--color-danger); }
.badge-muted { background: var(--color-primary-tint); color: var(--color-primary-dark); }

.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--color-ink);
}

.form-hint {
    font-size: 0.78rem;
    color: var(--color-ink-muted);
    margin-top: 0.3rem;
}

input[type=text], input[type=email], input[type=password], input[type=search],
input[type=tel], input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.92rem;
    background: var(--color-surface);
    color: var(--color-ink);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-tint);
}

.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-row input { width: auto; }

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
}

.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-success { background: var(--color-success-tint); color: var(--color-success); border-color: #bfe1d2; }
.alert-error { background: var(--color-danger-tint); color: var(--color-danger); border-color: #edc3c9; }

.settings-group { margin-bottom: 2rem; }
.settings-group h3 {
    font-size: 1rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1.1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-ink-muted);
}

/* --- Γρήγορη πλοήγηση φόρμας ιατρού (μετακινεί σε ενότητα, δεν κρύβει
   ποτέ περιεχόμενο - όλες οι ενότητες είναι πάντα ορατές) ------------- */

.doctor-jumpnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 5;
}

.doctor-jumpnav a {
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    background: var(--color-primary-tint);
    color: var(--color-primary-dark);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.doctor-jumpnav a:hover {
    background: var(--color-primary);
    color: #fff;
}

/* --- Σελίδα σύνδεσης -------------------------------------------------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #1D4E89 0%, #123255 100%);
    padding: 1.5rem;
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
    padding: 2.5rem 2.25rem 2rem;
    text-align: center;
}

.auth-seal { margin: 0 auto 1rem; width: 64px; height: 64px; }

.auth-card h1 {
    font-size: 1.25rem;
    margin-bottom: 0.15rem;
}

.auth-card .auth-subtitle {
    color: var(--color-ink-muted);
    font-size: 0.85rem;
    margin-bottom: 1.75rem;
}

.auth-card form { text-align: left; }

.auth-footnote {
    margin-top: 1.5rem;
    font-size: 0.78rem;
    color: #7FA8D6;
}

/* --- Responsive -------------------------------------------------------- */

.mobile-menu-toggle {
    display: none;
}

@media (max-width: 860px) {
    .app-shell { flex-direction: column; }

    .sidebar {
        display: none;
    }
    .sidebar.is-open {
        display: flex;
        width: 100%;
        height: auto;
        max-height: 70vh;
        position: relative;
        top: auto;
        overflow-y: auto;
        padding: 1rem 0;
    }

    .mobile-menu-toggle {
        display: inline-block;
        flex-shrink: 0;
        background: var(--color-primary-dark);
        color: #fff;
        border: none;
        border-radius: var(--radius-sm);
        padding: 0.5rem 0.9rem;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
    }

    .content { padding: 1.25rem; }
    .topbar { padding: 0.75rem 1.25rem; gap: 0.75rem; flex-wrap: wrap; }
    .topbar__title { order: 3; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* --- Οδηγός εγγραφής ιατρού - progress bar ------------------------------ */

.wizard-progress {
    position: relative;
    padding: 1.75rem 2rem 1.25rem;
}

.wizard-progress__track,
.wizard-progress__fill {
    position: absolute;
    top: 33px;
    left: 2rem;
    right: 2rem;
    height: 3px;
    border-radius: 2px;
}

.wizard-progress__track {
    background: var(--color-border);
    z-index: 0;
}

.wizard-progress__fill {
    background: var(--color-primary);
    right: auto;
    z-index: 1;
    transition: width 0.25s ease;
}

.wizard-progress__steps {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
}

.wizard-progress__step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    flex: 1;
}

.wizard-progress__circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-ink-muted);
}

.wizard-progress__label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-ink-muted);
    text-align: center;
    max-width: 90px;
}

.wizard-progress__step.is-done .wizard-progress__circle {
    background: var(--color-success);
    border-color: var(--color-success);
    color: #fff;
}

.wizard-progress__step.is-done .wizard-progress__label {
    color: var(--color-ink);
}

.wizard-progress__step.is-current .wizard-progress__circle {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--color-primary-tint);
}

.wizard-progress__step.is-current .wizard-progress__label {
    color: var(--color-primary-dark);
}

a.wizard-progress__step:hover .wizard-progress__label {
    color: var(--color-primary);
}

/* --- Απλά CSS bar charts για τις Αναφορές ------------------------------- */

.report-bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.report-bar-label {
    flex: 0 0 180px;
    font-size: 0.82rem;
    color: var(--color-ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-bar-track {
    flex: 1;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    height: 18px;
    overflow: hidden;
}

.report-bar-fill {
    background: var(--color-primary);
    height: 100%;
    border-radius: var(--radius-sm);
}

.report-bar-value {
    flex: 0 0 40px;
    text-align: right;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-ink);
}

/* --- Καρτέλες διαχείρισης ιατρού (view/edit ενοποιημένα) ---------------- */

.tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.75rem;
}

.tabs-nav button {
    appearance: none;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.6rem 1rem;
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--color-ink-muted);
    cursor: pointer;
}

.tabs-nav button:hover {
    background: var(--color-primary-tint);
    color: var(--color-primary-dark);
}

.tabs-nav button.is-active {
    background: var(--color-primary);
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.is-active {
    display: block;
}

/* Sticky γραμμή αποθήκευσης - πάντα ορατή, ανεξάρτητα από την ενεργή καρτέλα */
.sticky-save-bar {
    position: sticky;
    bottom: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(20,42,48,0.06);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    z-index: 10;
}

.badge-warning { background: #FFF4E5; color: #8A5A00; }

/* --- Αναδυόμενο παράθυρο (modal) για λεπτομέρειες, π.χ. σταλμένα μηνύματα -- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 42, 48, 0.55);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-box {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    max-width: 560px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(20, 42, 48, 0.25);
}

/* --- Χρωματισμός υπολοίπου SMS ανάλογα με το ποσό --------------------- */

.sms-credits-high { color: var(--color-success) !important; }
.sms-credits-medium { color: #8A5A00 !important; }
.sms-credits-low { color: var(--color-danger) !important; }

/* --- Χρωματισμός dropdown κατάστασης μέλους ιατρού --------------------- */

.status-select {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.6rem 0.75rem;
}

.status-select--success { background: var(--color-success-tint); color: var(--color-success); border-color: var(--color-success); }
.status-select--warning { background: #FFF4E5; color: #8A5A00; border-color: #8A5A00; }
.status-select--danger { background: var(--color-danger-tint); color: var(--color-danger); border-color: var(--color-danger); }
.status-select--muted { background: var(--color-bg); color: var(--color-ink-muted); }
