/* ========================================
   MODERN PROFESSIONAL HOSTING MANAGEMENT CSS
   ======================================== */

/* CSS Custom Properties (Variables) */
:root {
    /* ────────────────────────────────────────────────────────────────────
       Παλέτα — ψυχρά ουδέτερα με κυανό/πετρόλ τόνο.
       Τα ουδέτερα γέρνουν ελαφρά προς το μπλε ώστε να δένουν με το accent
       αντί να μοιάζουν με σκέτο γκρι. Ένα θέμα, φωτεινό: το σκούρο θα ήθελε
       και τα ~800 σκληρά χρώματα των templates, αλλιώς σπάει κατά τόπους.
       ──────────────────────────────────────────────────────────────────── */

    /* Κύριο χρώμα */
    --primary-color: #0e7490;
    --primary-hover: #0c5f77;
    --primary-dark: #0a4f63;
    --primary-light: #0ea5e9;
    --secondary-color: #5f7285;
    --accent-color: #0ea5e9;
    --accent-hover: #0284c7;
    --teal: #0e7490;
    --on-primary: #ffffff;
    /* Χρώμα κειμένου πάνω σε γεμάτο σημασιολογικό φόντο. Στο φωτεινό θέμα
       τα χρώματα είναι βαθιά και το λευκό διαβάζεται· στο σκούρο θέμα
       φωτίζονται και το λευκό σβήνει πάνω τους. */
    --on-success: #ffffff;
    --on-warning: #ffffff;
    --on-error:   #ffffff;

    /* Επιφάνειες */
    --bg-primary: #ffffff;
    --bg-secondary: #f4f8fb;
    --bg-tertiary: #eaf2f8;
    --bg-dark: #0f2130;
    --bg-sidebar: #0f2130;
    --bg-card: #ffffff;
    --bg: #f4f8fb;
    --bg-color: #f4f8fb;
    --bg-subtle: #eaf2f8;
    --card-bg: #ffffff;
    --input-bg: #ffffff;

    /* Κείμενο */
    --text-primary: #0d1a26;
    --text-secondary: #5f7285;
    --text-light: #6e8497;
    --text-white: #ffffff;
    --text-color: #0d1a26;
    --text-dark: #0d1a26;
    --text-muted: #5f7285;
    --dark-blue: #0f2130;

    /* Περιγράμματα */
    --border-color: #d7e4ee;
    --border: #d7e4ee;
    --border-light: #eaf2f8;
    --border-strong: #bacfe0;
    --border-focus: #0e7490;
    --border-radius: 0.5rem;
    --radius: 0.5rem;

    /* Σημασιολογικά — ανεξάρτητα από το accent */
    --success-color: #059669;
    --success: #059669;
    --success-color-rgb: 5, 150, 105;
    --warning-color: #b45309;
    --warning: #b45309;
    --error-color: #dc2626;
    --danger-color: #dc2626;
    --danger: #dc2626;
    --info-color: #0284c7;
    --info-text: #0c4a6e;
    --info-bg: #e3f2fb;
    --info-border: #bae6fd;
    --hover-color: #eaf2f8;

    /* Πύλη πελατών — ίδια οικογένεια, ώστε να μη μοιάζει ξένη εφαρμογή */
    --portal-primary: #0e7490;
    --portal-secondary: #5f7285;
    --portal-accent: #0ea5e9;
    --portal-dark: #0f2130;
    --portal-success: #059669;
    --portal-warning: #b45309;
    --portal-error: #dc2626;

    /* Διακοσμητικά gradients που χρησιμοποιούν κάποια templates */
    --qb-purple: #7c3aed;
    --qb-cyan: #0ea5e9;
    --qb-cyan-light: #7dd3fc;
    --qb-gradient: linear-gradient(135deg, #0e7490, #0ea5e9);
    --qb-gradient-soft: linear-gradient(135deg, rgba(14,116,144,.12), rgba(14,165,233,.12));

    /* Απαλά σημασιολογικά πλακάκια (badges, ειδοποιήσεις). Ζεύγος φόντο/κείμενο
       ανά νόημα, ώστε να αντιστρέφονται μαζί στο σκούρο θέμα. */
    --tint-danger-bg:  #fee2e2;  --tint-danger-fg:  #991b1b;
    --tint-success-bg: #d1fae5;  --tint-success-fg: #166534;
    --tint-warn-bg:    #fef3c7;  --tint-warn-fg:    #92400e;
    --tint-info-bg:    #e0f2fe;  --tint-info-fg:    #075985;
    --tint-neutral-bg: #eaf2f8;  --tint-neutral-fg: #334e68;
    --tint-violet-bg:  #ede9fe;  --tint-violet-fg:  #5b21b6;
    /* Στάδια funnel: χρησιμοποιούνται ΚΑΙ ως κείμενο πάνω στη σελίδα ΚΑΙ ως
       γέμισμα μπάρας, οπότε πρέπει να αλλάζουν ανά θέμα. */
    --stage-new: #1d4ed8;      --stage-contacted: #6d28d9;
    --stage-warm: #b45309;     --stage-proposal: #0369a1;
    --stage-won: #15803d;      --stage-lost: #64748b;
    --accent-deep:     #0891b2;
    --accent-bright:   #06b6d4;
    --violet:          #7c3aed;

    /* Πλακίδια στατιστικών — μία οικογένεια αντί για έξι κορεσμένες αποχρώσεις.
       Το χρώμα εδώ δεν είναι διακόσμηση: πράσινο/κεχριμπαρένιο μόνο όταν το
       ίδιο το μέγεθος είναι «καλό» ή «θέλει προσοχή». */
    --tile-teal:   linear-gradient(135deg, #0e7490 0%, #0ea5e9 100%);
    --tile-cyan:   linear-gradient(135deg, #0369a1 0%, #38bdf8 100%);
    --tile-slate:  linear-gradient(135deg, #274b63 0%, #4d7898 100%);
    --tile-deep:   linear-gradient(135deg, #0b4f60 0%, #0e7490 100%);
    /* Τα δύο παρακάτω φέρουν νόημα, όχι ποικιλία: μπαίνουν μόνο όταν ο
       αριθμός είναι από μόνος του «καλός» ή «θέλει προσοχή». */
    --tile-green:  linear-gradient(135deg, #047857 0%, #10b981 100%);
    --tile-amber:  linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
    /* Διακοσμητικό, σε ινδικό αντί για έντονο μωβ ώστε να μένει στην
       οικογένεια. Χρησιμοποιείται και ως φόντο της σελίδας σύνδεσης. */
    --tile-violet: linear-gradient(135deg, #3f3d84 0%, #5b6bc0 100%);
    --nav-active: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);

    /* Τυπογραφία */
    --font-display: "Commissioner", "Helvetica Neue", Arial, sans-serif;
    --font-body: "Fira Sans", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

    /* Σκιές — πιο μαλακές, με τον τόνο του φόντου αντί για καθαρό μαύρο */
    --shadow-sm: 0 1px 2px 0 rgb(13 26 38 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(13 26 38 / 0.08), 0 2px 4px -2px rgb(13 26 38 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(13 26 38 / 0.09), 0 4px 6px -4px rgb(13 26 38 / 0.07);
    --shadow-xl: 0 20px 25px -5px rgb(13 26 38 / 0.10), 0 8px 10px -6px rgb(13 26 38 / 0.08);
    --shadow: 0 1px 2px 0 rgb(13 26 38 / 0.05);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

/* Global Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    line-height: 1.5;
}

body {
    font-family: var(--font-body);
    font-size: 15.5px;
    -webkit-font-smoothing: antialiased;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */

/* Sidebar Navigation */
.sidebar {
    width: 270px;
    background: linear-gradient(195deg, #0b1a27 0%, #0f2130 50%, #0b1a27 100%);
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    border-right: none;
    /* Hide scrollbar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.sidebar-top {
    padding: 1.25rem 1rem 1rem;
    flex-grow: 1;
}

.sidebar h2 {
    color: var(--text-white);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    padding: 0.5rem 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.02em;
}

.sidebar h2 i {
    margin-right: 0.5rem;
    color: #38bdf8;
    font-size: 1.15rem;
}

/* Menu Section Labels */
.sidebar nav > .menu-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    padding: 1rem 0.75rem 0.4rem;
    margin-top: 0.25rem;
}

/* Menu Items */
.sidebar a,
.dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    border-radius: 0.5rem;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar a:hover,
.dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e2e8f0;
    transform: none;
}

.sidebar a.active {
    background: var(--nav-active);
    color: #fff;
    box-shadow: 0 4px 12px rgba(14, 116, 144, 0.45);
    font-weight: 600;
}

.sidebar a.active i {
    color: #fff;
}

.sidebar a i,
.dropdown-btn i {
    width: 18px;
    font-size: 0.95rem;
    color: #64748b;
    transition: color 0.2s;
}

.sidebar a:hover i,
.dropdown-btn:hover i {
    color: #38bdf8;
}

/* Badges */
.badge {
    background: linear-gradient(135deg, var(--error-color), #b91c1c);
    color: var(--on-error);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    margin-left: auto;
    min-width: 1.4rem;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

/* Dropdown Containers */
.dropdown-container {
    display: none;
    flex-direction: column;
    padding-left: 1rem;
    margin: 2px 0 4px 1.1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.dropdown-container a {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 400;
    color: #64748b;
    border-radius: 0.375rem;
}

.dropdown-container a:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
}

/* Active dropdown state */
.dropdown-container a.active {
    background: rgba(37, 99, 235, 0.12);
    color: #60a5fa;
    border-left: none;
    font-weight: 500;
}

/* Persistent dropdown button state */
.dropdown-btn.dropdown-active {
    background: rgba(255, 255, 255, 0.04);
    border-left: none;
}

.dropdown-btn.dropdown-active i {
    color: #38bdf8;
}

/* Dropdown button shows active state when we're inside one of its children */
.dropdown-btn.active {
    background: rgba(37, 99, 235, 0.12);
    color: #60a5fa;
    font-weight: 500;
    border-left: 3px solid #60a5fa;
    padding-left: calc(0.85rem - 3px);
}
.dropdown-btn.active > i:first-child {
    color: #60a5fa;
}

.dropdown-btn .fa-chevron-down {
    font-size: 0.65rem;
    color: #475569;
    transition: transform 0.25s ease, color 0.2s;
}

.dropdown-btn:hover .fa-chevron-down {
    color: #94a3b8;
}

.menu-group {
    margin-bottom: 2px;
}

/* Sidebar Bottom */
.sidebar-bottom {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-bottom a {
    color: #64748b;
    font-size: 0.82rem;
    padding: 0.5rem 0.85rem;
}

.sidebar-bottom a:hover {
    color: #e2e8f0;
}

.sidebar-bottom a i {
    font-size: 0.85rem;
}

/* Main Content Area */
.main-content {
    margin-left: 270px;
    flex: 1;
    padding: var(--spacing-2xl);
    background-color: var(--bg-secondary);
    min-height: 100vh;
}

.page-container {
    max-width: 1600px; /* Increased from 1400px for wider tables */
    margin: 0 auto;
}

/* ========================================
   CARD COMPONENTS
   ======================================== */

.form-box,
.stats-box,
.table-box,
.dashboard-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    transition: all var(--transition-normal);
}

.form-box:hover,
.stats-box:hover,
.table-box:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.stat-card {
    /* Το ίδιο token με τα υπόλοιπα πλακίδια: βαθαίνει μόνο του στο σκούρο
       θέμα, ώστε το λευκό κείμενο να κρατά την αντίθεσή του. */
    background: var(--tile-teal);
    color: var(--on-primary);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.stat-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: var(--spacing-sm);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.stat-card i {
    font-size: 2.5rem;
    opacity: 0.2;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

/* ========================================
   FORM COMPONENTS
   ======================================== */

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
}

.form-column {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

.form-help {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.25rem;
    font-style: italic;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    margin-bottom: var(--spacing-lg);
    transition: all var(--transition-fast);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* ========================================
   BUTTON COMPONENTS
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--on-primary);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-success {
    background: var(--success-color);
    color: var(--on-success);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--on-warning);
}

.btn-danger {
    background: var(--error-color);
    color: var(--on-error);
}

.btn-info {
    background: var(--tile-teal);
    color: var(--on-primary);
    border: none;
}

.btn-info:hover {
    background: linear-gradient(135deg, #0c5f77 0%, #0284c7 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.1rem;
}

/* Legacy button support */
input[type="submit"],
button {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--on-primary);
    box-shadow: var(--shadow-md);
}

input[type="submit"]:hover,
button:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   TABLE COMPONENTS
   ======================================== */

.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: var(--spacing-xl);
    /* Ensure full width usage */
    width: 100%;
}

table {
    width: 100%;
    min-width: 800px; /* Minimum width to prevent cramping */
    border-collapse: collapse;
    background: var(--bg-card);
    font-size: 0.9rem;
    table-layout: fixed; /* Helps with consistent column sizing */
}

thead {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--border-light) 100%);
}

th {
    padding: var(--spacing-lg) var(--spacing-md); /* More horizontal padding */
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap; /* Prevent header text wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

td {
    padding: var(--spacing-lg) var(--spacing-md); /* More horizontal padding */
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    word-wrap: break-word; /* Allow long text to wrap */
    max-width: 0; /* Allow text overflow to work */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Specific column width adjustments for common table layouts */
.table-container table th:first-child,
.table-container table td:first-child {
    width: 20%;
    min-width: 150px;
}

.table-container table th:last-child,
.table-container table td:last-child {
    width: 20%;
    min-width: 140px;
    text-align: center;
}

/* For tables with many columns, make middle columns flexible */
.table-container table th:not(:first-child):not(:last-child),
.table-container table td:not(:first-child):not(:last-child) {
    width: auto;
    min-width: 120px;
}

tbody tr {
    transition: all var(--transition-fast);
}

tbody tr:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.002); /* Reduced scale for less jarring effect */
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.table-actions a,
.table-actions button {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.8rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap; /* Prevent button text wrapping */
}

/* Responsive table improvements */
@media (max-width: 1200px) {
    .table-container {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 1000px; /* Ensure minimum width on smaller screens */
    }
}

@media (max-width: 768px) {
    .table-container {
        margin: 0 -1rem; /* Extend to screen edges on mobile */
        border-radius: 0;
    }
    
    table {
        min-width: 800px;
        font-size: 0.85rem;
    }
    
    th, td {
        padding: var(--spacing-md) var(--spacing-sm);
    }
}

.action-view { color: var(--info-color); }
.action-edit { color: var(--warning-color); }
.action-delete { color: var(--error-color); }
.action-success { color: var(--success-color); }

/* ========================================
   MODAL COMPONENTS
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.8); /* Darker, less transparent */
    backdrop-filter: blur(4px); /* Frosted glass effect */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Higher z-index */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--bg-card);
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 550px;
    border: 1px solid var(--border-color);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--error-color); }

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

/* Layout Utilities */
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none !important; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

/* Status Indicators */
.status-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active { background: rgba(16, 185, 129, 0.1); color: var(--success-color); }
.status-pending { background: rgba(245, 158, 11, 0.1); color: var(--warning-color); }
.status-inactive { background: rgba(239, 68, 68, 0.1); color: var(--error-color); }

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        margin-left: 250px;
        padding: var(--spacing-xl);
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--spacing-lg);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #374151;
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--spacing-lg);
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
    
    .modal-content {
        padding: var(--spacing-lg);
        width: 95%;
    }
}

/* ========================================
   DARK MODE SUPPORT (Optional)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .dark-mode {
        --bg-primary: #1e293b;
        --bg-secondary: #0f172a;
        --bg-tertiary: #334155;
        --bg-card: #1e293b;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --border-color: #374151;
        --border-light: #475569;
    }
}

/* Category tags */
.category-tag {
    background: var(--primary-color);
    color: var(--on-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* ========================================
   TICKET REPLY SECTIONS
   ======================================== */
.ticket-reply-cell {
    background: linear-gradient(135deg, #1e2533 0%, #161b26 100%);
    padding: 18px 20px !important;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
    border-left: 3px solid var(--primary-color);
}

.ticket-reply-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.7rem;
}

.ticket-reply-body {
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.ticket-reply-meta {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ticket-reply-form-cell {
    background: #121923;
    padding: 18px 20px !important;
    border-left: 3px dashed var(--primary-color);
}

.ticket-reply-form textarea {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-md);
    resize: vertical;
}

.reply-form-actions {
    text-align: right;
    margin-top: 10px;
}

.tickets-table button {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 6px 10px;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
}

.tickets-table button:hover {
    background: var(--primary-color);
    color: var(--on-primary);
    border-color: var(--primary-color);
}

/* ========================================
   ENHANCED TABLE STYLES FOR SPECIFIC PAGES
   ======================================== */

/* Client Table Enhancements */
.clients-table-container {
    min-width: 100%;
}

.clients-table th:nth-child(1) { width: 15%; min-width: 140px; } /* Domain */
.clients-table th:nth-child(2) { width: 15%; min-width: 130px; } /* Client */
.clients-table th:nth-child(3) { width: 12%; min-width: 120px; } /* Email */
.clients-table th:nth-child(4) { width: 12%; min-width: 110px; } /* Hosting */
.clients-table th:nth-child(5) { width: 10%; min-width: 100px; } /* Billing */
.clients-table th:nth-child(6) { width: 10%; min-width: 100px; } /* Price */
.clients-table th:nth-child(7) { width: 10%; min-width: 100px; } /* Status */
.clients-table th:nth-child(8) { width: 16%; min-width: 150px; } /* Actions */

/* Projects Table Enhancements */
.projects-table th:nth-child(1) { width: 20%; min-width: 160px; } /* Project Name */
.projects-table th:nth-child(2) { width: 15%; min-width: 130px; } /* Client */
.projects-table th:nth-child(3) { width: 12%; min-width: 100px; } /* Status */
.projects-table th:nth-child(4) { width: 12%; min-width: 100px; } /* Price */
.projects-table th:nth-child(5) { width: 12%; min-width: 100px; } /* Start Date */
.projects-table th:nth-child(6) { width: 12%; min-width: 100px; } /* End Date */
.projects-table th:nth-child(7) { width: 17%; min-width: 140px; } /* Actions */

/* Support Tickets Table Enhancements */
.tickets-table th:nth-child(1) { width: 15%; min-width: 120px; } /* Title */
.tickets-table th:nth-child(2) { width: 15%; min-width: 120px; } /* Client */
.tickets-table th:nth-child(3) { width: 20%; min-width: 150px; } /* Reason */
.tickets-table th:nth-child(4) { width: 12%; min-width: 100px; } /* Status */
.tickets-table th:nth-child(5) { width: 12%; min-width: 100px; } /* Created */
.tickets-table th:nth-child(6) { width: 16%; min-width: 130px; } /* Actions */

/* Proposals Table Enhancements */
.items-table th:nth-child(1) { width: 25%; min-width: 180px; } /* Title */
.items-table th:nth-child(2) { width: 35%; min-width: 200px; } /* Description */
.items-table th:nth-child(3) { width: 12%; min-width: 100px; } /* Price */
.items-table th:nth-child(4) { width: 13%; min-width: 110px; } /* Category */
.items-table th:nth-child(5) { width: 15%; min-width: 120px; } /* Actions */

.proposals-table th:nth-child(1) { width: 30%; min-width: 180px; } /* Customer */
.proposals-table th:nth-child(2) { width: 25%; min-width: 150px; } /* Date */
.proposals-table th:nth-child(3) { width: 20%; min-width: 120px; } /* Amount */
.proposals-table th:nth-child(4) { width: 25%; min-width: 150px; } /* Actions */

/* Text overflow handling for long content */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.text-wrap {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

/* Full-width containers for specific pages */
.full-width-table {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* Better responsive behavior for action buttons */
@media (max-width: 1024px) {
    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .table-actions a,
    .table-actions button {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        width: 100%;
        text-align: center;
    }
}

/* ========================================
   MOBILE-FIRST RESPONSIVE DESIGN
   ======================================== */

/* Mobile Navigation */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        position: fixed;
        height: 100vh;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .mobile-nav-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: var(--primary-color);
        color: var(--on-primary);
        border: none;
        padding: 0.5rem;
        border-radius: 6px;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    .main-content {
        padding: 4rem var(--spacing-md) var(--spacing-lg);
        margin-left: 0;
        width: 100%;
    }
    
    .page-container {
        max-width: none;
        padding: 0;
    }
}

/* ========================================
   CARD-ONLY LAYOUTS (NO TABLES)
   ======================================== */

/* Hide all tables - use cards only */
.table-container {
    display: none !important;
}

/* Enhanced card layouts for all devices */
.cards-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    width: 100%;
}

/* Desktop improvements for cards-container - 4 column grid */
@media (min-width: 769px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }
}

/* Large desktop - 4 cards per row */
@media (min-width: 1200px) {
    .cards-container {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-xl);
    }
}

/* Extra large screens - maintain 4 columns */
@media (min-width: 1600px) {
    .cards-container {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--spacing-lg);
    }
}

/* Base card styles - enhanced for all screen sizes */
.mobile-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.mobile-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Remove margin-bottom when in grid layout */
@media (min-width: 769px) {
    .cards-container .mobile-card {
        margin-bottom: 0;
    }
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
}

.mobile-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex: 1;
    margin-right: var(--spacing-sm);
}

.mobile-card-status {
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.mobile-card-body {
    margin-bottom: var(--spacing-md);
}

.mobile-card-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.mobile-card-field:last-child {
    border-bottom: none;
}

.mobile-card-label {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.9rem;
    min-width: 80px;
}

.mobile-card-value {
    text-align: right;
    flex: 1;
    margin-left: var(--spacing-sm);
    word-break: break-word;
}

.mobile-card-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.mobile-card-actions .btn {
    flex: 1;
    min-width: calc(50% - var(--spacing-xs));
    text-align: center;
    font-size: 0.8rem;
    padding: var(--spacing-sm) var(--spacing-md);
}

.mobile-card-actions .btn:only-child {
    flex: none;
    min-width: 120px;
}

/* Status-specific styles — ζεύγη φόντου/κειμένου από tokens, ώστε να
   αντιστρέφονται μαζί στο σκούρο θέμα αντί να μένουν φωτεινά πλακάκια. */
.status-active { background: var(--tint-success-bg); color: var(--tint-success-fg); }
.status-inactive { background: var(--tint-danger-bg); color: var(--tint-danger-fg); }
.status-pending { background: var(--tint-warn-bg); color: var(--tint-warn-fg); }
.status-completed { background: var(--tint-success-bg); color: var(--tint-success-fg); }
.status-in-progress { background: var(--tint-info-bg); color: var(--tint-info-fg); }
.status-overdue { background: var(--tint-danger-bg); color: var(--tint-danger-fg); }

/* Client-specific card styles */
.client-card .mobile-card-title {
    color: var(--primary-color);
}

.client-card .mobile-card-field.hosting-type .mobile-card-value {
    font-weight: 500;
    color: var(--primary-color);
}

.client-card .mobile-card-field.price .mobile-card-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--success-color);
}

/* Project-specific card styles */
.project-card .mobile-card-header {
    flex-direction: column;
    align-items: stretch;
}

.project-card .mobile-card-title {
    margin-bottom: var(--spacing-xs);
}

.project-card .project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Ticket-specific card styles */
.ticket-card .mobile-card-header {
    align-items: center;
}

.ticket-card .priority-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--spacing-sm);
}

.priority-high { background: #ef4444; }
.priority-medium { background: #f59e0b; }
.priority-low { background: #10b981; }

/* Proposal-specific card styles */
.proposal-card .mobile-card-field.amount .mobile-card-value {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.proposal-card .mobile-card-field.items-count .mobile-card-value {
    background: var(--primary-color);
    color: var(--on-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Enhanced mobile forms */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: var(--spacing-lg);
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        margin-right: 0;
    }
    
    .btn-group {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    .modal-content {
        margin: var(--spacing-md);
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* Mobile search and filters */
@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .search-input {
        width: 100%;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }
    
    .filter-buttons .btn {
        flex: 1;
        min-width: calc(50% - var(--spacing-xs));
        font-size: 0.8rem;
        padding: var(--spacing-sm);
    }
}

/* Mobile-friendly pagination */
@media (max-width: 768px) {
    .pagination {
        flex-wrap: wrap;
        gap: var(--spacing-xs);
        justify-content: center;
    }
    
    .pagination .btn {
        min-width: 40px;
        padding: var(--spacing-sm);
    }
    
    .pagination .btn-text {
        display: none;
    }
    
    .pagination .btn-icon {
        display: inline;
    }
}

/* Touch-friendly interactive elements */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .form-control {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .sidebar a {
        padding: var(--spacing-lg) var(--spacing-xl);
        font-size: 1rem;
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: rgba(255, 255, 255, 0.1);
        margin-left: var(--spacing-lg);
    }
    
    .dropdown:hover .dropdown-menu {
        display: block;
    }
}

/* Improved accessibility for mobile */
@media (max-width: 768px) {
    /* Larger focus indicators */
    button:focus,
    input:focus,
    select:focus,
    textarea:focus,
    a:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
    
    /* Better contrast for small text */
    .text-small,
    .mobile-card-label {
        font-size: 0.9rem;
        color: #374151;
    }
}

/* ========================================
   MOBILE NAVIGATION JAVASCRIPT STYLES
   ======================================== */

.mobile-nav-toggle {
    display: none;
    background: var(--primary-color);
    color: var(--on-primary);
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1.2rem;
    cursor: pointer;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.mobile-nav-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.mobile-nav-toggle:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: block;
    }
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 1400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 10;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-header, .modal-body {
        padding: 1rem;
    }
}


/* ============================================================================
   Τυπογραφία — Commissioner για τίτλους, Fira Sans για σώμα.
   Μπαίνει στο τέλος ώστε να υπερισχύει των παλιών κανόνων font-family.
   ============================================================================ */
h1, h2, h3, h4, h5, h6,
.page-title, .card-title, .stat-value, .brand, .sidebar-top h2 {
    font-family: var(--font-display);
    letter-spacing: -0.011em;
}
h1, h2, .page-title { text-wrap: balance; }

code, pre, kbd, samp, .mono {
    font-family: var(--font-mono);
}

/* Αριθμοί που στοιχίζονται σε στήλες */
table td, table th, .stat-value, .pl-pct, .pl-frac, .pd-big, .tk-id {
    font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {

    /* ============================================================================
       ΣΚΟΥΡΟ ΘΕΜΑ
       Τρεις καταστάσεις, όχι δύο: ρητή επιλογή στάμπαρει data-theme στο <html>,
       ενώ η προεπιλογή «σύστημα» δεν σταμπάρει τίποτα — εκεί αποφασίζει μόνο το
       prefers-color-scheme. Γι' αυτό το media query εξαιρεί το data-theme="light",
       ώστε μια ρητή επιλογή για φωτεινό να νικά ένα σκούρο λειτουργικό.
       Ορίζονται ΜΟΝΟ tokens εδώ — κανένα component, ώστε να μη διχάζεται ο κώδικας.
       ============================================================================ */
    :root:not([data-theme="light"]) {
        --primary-color: #38bdf8;
        --primary-hover: #7dd3fc;
        --primary-dark: #0ea5e9;
        --primary-light: #7dd3fc;
        --secondary-color: #7d97ab;
        --accent-color: #38bdf8;
        --accent-hover: #7dd3fc;
        --teal: #22d3ee;
    --on-primary: #04222d;
    --on-success: #04241a;
    --on-warning: #2e1f04;
    --on-error:   #2f0d0d;
        --accent-deep: #22d3ee;
        --accent-bright: #67e8f9;
        --violet: #a78bfa;
    
        --bg-primary: #0f2130;
        --bg-secondary: #08131c;
        --bg-tertiary: #162c3d;
        --bg-dark: #060e15;
        --bg-sidebar: #060e15;
        --bg-card: #0f2130;
        --bg: #08131c;
        --bg-color: #08131c;
        --bg-subtle: #162c3d;
        --card-bg: #0f2130;
        --input-bg: #162c3d;
    
        --text-primary: #e4eff7;
        --text-secondary: #9fb5c8;
        --text-light: #7d97ab;
        --text-color: #e4eff7;
        --text-dark: #e4eff7;
        --text-muted: #9fb5c8;
        --dark-blue: #060e15;
    
        --border-color: #1f3a4d;
        --border: #1f3a4d;
        --border-light: #162c3d;
        --border-strong: #2d5169;
        --border-focus: #38bdf8;
    
        --success-color: #34d399;
        --success: #34d399;
        --success-color-rgb: 52, 211, 153;
        --warning-color: #fbbf24;
        --warning: #fbbf24;
        --error-color: #f87171;
        --danger-color: #f87171;
        --danger: #f87171;
        --info-color: #38bdf8;
        --info-text: #bae6fd;
        --info-bg: #0d2c3e;
        --info-border: #1e4a63;
        --hover-color: #162c3d;
    
        --tint-danger-bg:  #3a1a1c;  --tint-danger-fg:  #fca5a5;
        --tint-success-bg: #0d2f26;  --tint-success-fg: #6ee7b7;
        --tint-warn-bg:    #33260f;  --tint-warn-fg:    #fcd34d;
        --tint-info-bg:    #0d2c3e;  --tint-info-fg:    #7dd3fc;
        --tint-neutral-bg: #162c3d;  --tint-neutral-fg: #adc4d6;
    --tint-violet-bg:  #241a3d;  --tint-violet-fg:  #c4b5fd;
    --stage-new: #7dabf8;      --stage-contacted: #b69cf7;
    --stage-warm: #f0b45e;     --stage-proposal: #6cc4f0;
    --stage-won: #5cc98a;      --stage-lost: #9fb5c8;
    
        --portal-primary: #38bdf8;
        --portal-secondary: #7d97ab;
        --portal-accent: #67e8f9;
        --portal-dark: #060e15;
        --portal-success: #34d399;
        --portal-warning: #fbbf24;
        --portal-error: #f87171;
    
        --qb-cyan: #38bdf8;
        --qb-cyan-light: #7dd3fc;
        --qb-purple: #a78bfa;
        --qb-gradient: linear-gradient(135deg, #0e7490, #38bdf8);
        --qb-gradient-soft: linear-gradient(135deg, rgba(56,189,248,.14), rgba(103,232,249,.14));
    
        /* Τα πλακίδια μένουν γεμάτα με λευκό κείμενο· απλώς βαθαίνουν λίγο
           ώστε να μη «καίνε» πάνω στο σκούρο φόντο. */
        --tile-teal:   linear-gradient(135deg, #0b5468 0%, #0e7490 100%);
        --tile-cyan:   linear-gradient(135deg, #075985 0%, #0284c7 100%);
        --tile-slate:  linear-gradient(135deg, #1e3a52 0%, #35597a 100%);
        --tile-deep:   linear-gradient(135deg, #073b4a 0%, #0b5468 100%);
        --tile-green:  linear-gradient(135deg, #04543d 0%, #047857 100%);
        --tile-amber:  linear-gradient(135deg, #7c3a06 0%, #b45309 100%);
        --tile-violet: linear-gradient(135deg, #2f2d63 0%, #464f92 100%);
    --nav-active: linear-gradient(135deg, #0b5468 0%, #0e7490 100%);
    
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.35);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.45), 0 2px 4px -2px rgb(0 0 0 / 0.4);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.45);
        --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.55), 0 8px 10px -6px rgb(0 0 0 / 0.5);
        --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.35);
    
        color-scheme: dark;
    }
}


/* ============================================================================
   ΣΚΟΥΡΟ ΘΕΜΑ
   Τρεις καταστάσεις, όχι δύο: ρητή επιλογή στάμπαρει data-theme στο <html>,
   ενώ η προεπιλογή «σύστημα» δεν σταμπάρει τίποτα — εκεί αποφασίζει μόνο το
   prefers-color-scheme. Γι' αυτό το media query εξαιρεί το data-theme="light",
   ώστε μια ρητή επιλογή για φωτεινό να νικά ένα σκούρο λειτουργικό.
   Ορίζονται ΜΟΝΟ tokens εδώ — κανένα component, ώστε να μη διχάζεται ο κώδικας.
   ============================================================================ */
:root[data-theme="dark"] {
    --primary-color: #38bdf8;
    --primary-hover: #7dd3fc;
    --primary-dark: #0ea5e9;
    --primary-light: #7dd3fc;
    --secondary-color: #7d97ab;
    --accent-color: #38bdf8;
    --accent-hover: #7dd3fc;
    --teal: #22d3ee;
    --on-primary: #04222d;
    --on-success: #04241a;
    --on-warning: #2e1f04;
    --on-error:   #2f0d0d;
    --accent-deep: #22d3ee;
    --accent-bright: #67e8f9;
    --violet: #a78bfa;

    --bg-primary: #0f2130;
    --bg-secondary: #08131c;
    --bg-tertiary: #162c3d;
    --bg-dark: #060e15;
    --bg-sidebar: #060e15;
    --bg-card: #0f2130;
    --bg: #08131c;
    --bg-color: #08131c;
    --bg-subtle: #162c3d;
    --card-bg: #0f2130;
    --input-bg: #162c3d;

    --text-primary: #e4eff7;
    --text-secondary: #9fb5c8;
    --text-light: #7d97ab;
    --text-color: #e4eff7;
    --text-dark: #e4eff7;
    --text-muted: #9fb5c8;
    --dark-blue: #060e15;

    --border-color: #1f3a4d;
    --border: #1f3a4d;
    --border-light: #162c3d;
    --border-strong: #2d5169;
    --border-focus: #38bdf8;

    --success-color: #34d399;
    --success: #34d399;
    --success-color-rgb: 52, 211, 153;
    --warning-color: #fbbf24;
    --warning: #fbbf24;
    --error-color: #f87171;
    --danger-color: #f87171;
    --danger: #f87171;
    --info-color: #38bdf8;
    --info-text: #bae6fd;
    --info-bg: #0d2c3e;
    --info-border: #1e4a63;
    --hover-color: #162c3d;

    --tint-danger-bg:  #3a1a1c;  --tint-danger-fg:  #fca5a5;
    --tint-success-bg: #0d2f26;  --tint-success-fg: #6ee7b7;
    --tint-warn-bg:    #33260f;  --tint-warn-fg:    #fcd34d;
    --tint-info-bg:    #0d2c3e;  --tint-info-fg:    #7dd3fc;
    --tint-neutral-bg: #162c3d;  --tint-neutral-fg: #adc4d6;
    --tint-violet-bg:  #241a3d;  --tint-violet-fg:  #c4b5fd;
    --stage-new: #7dabf8;      --stage-contacted: #b69cf7;
    --stage-warm: #f0b45e;     --stage-proposal: #6cc4f0;
    --stage-won: #5cc98a;      --stage-lost: #9fb5c8;

    --portal-primary: #38bdf8;
    --portal-secondary: #7d97ab;
    --portal-accent: #67e8f9;
    --portal-dark: #060e15;
    --portal-success: #34d399;
    --portal-warning: #fbbf24;
    --portal-error: #f87171;

    --qb-cyan: #38bdf8;
    --qb-cyan-light: #7dd3fc;
    --qb-purple: #a78bfa;
    --qb-gradient: linear-gradient(135deg, #0e7490, #38bdf8);
    --qb-gradient-soft: linear-gradient(135deg, rgba(56,189,248,.14), rgba(103,232,249,.14));

    /* Τα πλακίδια μένουν γεμάτα με λευκό κείμενο· απλώς βαθαίνουν λίγο
       ώστε να μη «καίνε» πάνω στο σκούρο φόντο. */
    --tile-teal:   linear-gradient(135deg, #0b5468 0%, #0e7490 100%);
    --tile-cyan:   linear-gradient(135deg, #075985 0%, #0284c7 100%);
    --tile-slate:  linear-gradient(135deg, #1e3a52 0%, #35597a 100%);
    --tile-deep:   linear-gradient(135deg, #073b4a 0%, #0b5468 100%);
    --tile-green:  linear-gradient(135deg, #04543d 0%, #047857 100%);
    --tile-amber:  linear-gradient(135deg, #7c3a06 0%, #b45309 100%);
    --tile-violet: linear-gradient(135deg, #2f2d63 0%, #464f92 100%);
    --nav-active: linear-gradient(135deg, #0b5468 0%, #0e7490 100%);

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.35);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.45), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.45);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.55), 0 8px 10px -6px rgb(0 0 0 / 0.5);
    --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.35);

    color-scheme: dark;
}

/* Κουμπί θέματος — μοιάζει με τα υπόλοιπα στοιχεία της sidebar, αλλά είναι
   <button> γιατί δεν πηγαίνει πουθενά. */
.theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.7rem 1rem;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: inherit;
    font: inherit;
    font-size: 0.92rem;
    text-align: left;
    cursor: pointer;
}
.theme-toggle:hover { background: rgba(255, 255, 255, 0.07); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-color); outline-offset: -2px; }
.theme-toggle i { width: 1.1rem; text-align: center; }


/* ============================================================================
   Flash μηνύματα — ένα σημείο για όλη την εφαρμογή (base.html / base_client.html)
   ============================================================================ */
.flash-stack{display:flex;flex-direction:column;gap:.5rem;margin-bottom:1.2rem}
.flash{
    display:flex; align-items:flex-start; gap:.6rem;
    padding:.7rem 1rem; border-radius:9px; font-size:.9rem; line-height:1.45;
    border-left:3px solid var(--info-color);
    background:var(--tint-info-bg); color:var(--tint-info-fg);
}
.flash i{margin-top:.15rem}
.flash-success{border-left-color:var(--success-color);
               background:var(--tint-success-bg); color:var(--tint-success-fg)}
.flash-error{border-left-color:var(--error-color);
             background:var(--tint-danger-bg); color:var(--tint-danger-fg)}
.flash-warning{border-left-color:var(--warning-color);
               background:var(--tint-warn-bg); color:var(--tint-warn-fg)}

/* ── Σήμα αυτόματων υπενθυμίσεων στην κάρτα πελάτη ───────────────────────── */
.auto-badge{
  display:inline-flex; align-items:center; gap:.3rem;
  font-size:.66rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  padding:.12rem .45rem; border-radius:20px; text-decoration:none; vertical-align:middle;
  background:var(--tint-success-bg, rgba(5,150,105,.14)); color:var(--tint-success-fg, #059669);
  border:1px solid transparent; margin-left:.45rem; line-height:1.5;
}
.auto-badge:hover{ border-color:currentColor; }
.auto-badge i{ font-size:.85em; }
