/* ===========================================================================
   Digitan CRM · Stylesheet (v2 — clean / soft / Influmo-style)
   =========================================================================== */

/* Fonts: Plus Jakarta Sans (body) + Manrope (display) — loaded via <link> in header.php */

:root {
    /* surfaces */
    --bg:           #F4F6FA;
    --bg-soft:      #EDF0F5;
    --surface:      #FFFFFF;
    --surface-2:    #F7F8FB;
    --border:       #ECEEF2;
    --border-strong:#E0E3EA;

    /* text */
    --text:         #0B0D12;
    --text-muted:   #6B7280;
    --text-soft:    #9CA3AF;

    /* brand */
    --brand-cyan:   #2BA3FF;
    --brand-purple: #7B2CDB;
    --brand-pink:   #FF2EAA;
    --brand-grad:   linear-gradient(135deg, #2BA3FF 0%, #7B2CDB 50%, #FF2EAA 100%);
    --brand-grad-soft: linear-gradient(135deg, #E9F4FF 0%, #F1E8FE 50%, #FFE9F4 100%);

    /* accent (active state, primary highlight) — soft cream-pink that complements brand */
    --accent-bg:    #FFEFC2;
    --accent-fg:    #7C5A0E;

    /* status colors (Influmo-style soft pastel pills) */
    --success-bg:   #DCFCE7;
    --success-fg:   #166534;
    --warning-bg:   #FEF3C7;
    --warning-fg:   #92400E;
    --danger-bg:    #FEE2E2;
    --danger-fg:    #991B1B;
    --info-bg:      #DBEAFE;
    --info-fg:      #1E40AF;
    --neutral-bg:   #F3F4F6;
    --neutral-fg:   #4B5563;

    /* radii */
    --r-sm:  10px;
    --r:     14px;
    --r-lg:  18px;
    --r-xl:  24px;
    --r-2xl: 32px;
    --r-full:999px;

    /* shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, .05);
    --shadow:    0 4px 16px rgba(15, 23, 42, .06);
    --shadow-lg: 0 16px 40px rgba(15, 23, 42, .10);

    --sidebar-w: 84px;

    /* fonts (with full Greek + Greek Extended support) */
    --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Inter', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg:        #0B0F1A;
    --bg-soft:   #0F1524;
    --surface:   #141A2B;
    --surface-2: #1A2238;
    --border:    #232C45;
    --border-strong:#2C3654;
    --text:      #F1F5F9;
    --text-muted:#94A3B8;
    --text-soft: #64748B;
    --neutral-bg:#222B41;
    --neutral-fg:#CBD5E1;
}

/* =====================================================================
   Base
   ===================================================================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-feature-settings: 'cv11','ss01','ss03','tnum';
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
    font-size: 14px;
    letter-spacing: -.005em;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: inherit; }
h1, h2, h3, h4 {
    font-family: var(--font-display);
    letter-spacing: -.022em;
    font-weight: 700;
}
.kpi-value, .topbar-title h1 { font-family: var(--font-display); }
/* tabular numbers for tables, prices, KPIs */
.kpi-value, .kpi-trend, table.data td, .progress, .badge, .calendar { font-variant-numeric: tabular-nums; }

.lucide { stroke-width: 1.75; vertical-align: middle; flex-shrink: 0; }

/* =====================================================================
   Brand mark (logo)
   ===================================================================== */
.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--brand-grad);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 18px rgba(123, 44, 219, .28);
    flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }

/* =====================================================================
   Auth (login / install)
   ===================================================================== */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(1100px 600px at 85% -20%, rgba(255, 46, 170, .15), transparent 60%),
        radial-gradient(800px 500px at -10% 120%, rgba(43, 163, 255, .15), transparent 60%),
        var(--bg);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-lg);
    padding: 36px 32px;
    border: 1px solid var(--border);
}
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.auth-brand h1 {
    margin: 4px 0 0;
    font-size: 22px;
    font-weight: 700;
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-brand p { margin: 0; color: var(--text-muted); font-size: 13px; }

/* =====================================================================
   App shell
   ===================================================================== */
.app {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 22px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
    align-items: center;
    gap: 8px;
}
.sidebar-brand {
    margin-bottom: 18px;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    width: 100%;
    align-items: center;
}
.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    margin-top: 8px;
}
.nav-link {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s ease;
    position: relative;
}
.nav-link:hover {
    background: var(--surface-2);
    color: var(--text);
}
.nav-link.is-active {
    background: var(--accent-bg);
    color: var(--accent-fg);
}
.nav-link.is-active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--brand-grad);
    border-radius: 2px;
}

/* tooltip on icon-only sidebar */
.nav-link::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #0B0D12;
    color: #fff;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 100;
}
.nav-link:hover::after { opacity: 1; }

/* =====================================================================
   Main area
   ===================================================================== */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 32px 20px;
    background: transparent;
}
.topbar-title {
    flex: 1;
    min-width: 0;
}
.topbar-title h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -.028em;
    color: var(--text);
    line-height: 1.15;
}
.topbar-title p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all .15s ease;
}
.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
}
.menu-toggle { display: none; }

.badge-dot {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--brand-pink);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--r-full);
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
    border: 2px solid var(--surface);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s ease;
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-grad);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    flex-shrink: 0;
}

.page {
    padding: 4px 32px 32px;
    flex: 1;
}

/* =====================================================================
   Cards
   ===================================================================== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 24px;
}
.card-flat {
    background: var(--surface);
    border-radius: var(--r-xl);
    padding: 22px;
    border: 1px solid var(--border);
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.card-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.card-header .subtitle {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.section-grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 2fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1300px) {
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}

/* =====================================================================
   KPI cards (Influmo-style: icon, label, big number, trend pill)
   ===================================================================== */
.kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.kpi-head {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}
.kpi-head .kpi-icon {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.kpi-body {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.kpi-value {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -.025em;
    color: var(--text);
}
.kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--r-full);
}
.kpi-trend.up   { background: var(--success-bg); color: var(--success-fg); }
.kpi-trend.down { background: var(--danger-bg);  color: var(--danger-fg); }
.kpi-trend svg  { width: 12px; height: 12px; }
.kpi-foot { font-size: 12px; color: var(--text-soft); }

/* =====================================================================
   Buttons
   ===================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: all .15s ease;
    background: var(--surface);
    color: var(--text);
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary {
    background: var(--accent-bg);
    color: var(--accent-fg);
    border: none;
}
.btn-primary:hover {
    background: #FFE49E;
    box-shadow: 0 6px 16px rgba(252, 211, 77, .35);
}
.btn-brand {
    background: var(--brand-grad);
    color: #fff;
    border: none;
    box-shadow: 0 6px 18px rgba(123, 44, 219, .25);
}
.btn-brand:hover { box-shadow: 0 10px 24px rgba(123, 44, 219, .35); transform: translateY(-1px); }
.btn-ghost {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn-danger {
    background: var(--danger-bg);
    color: var(--danger-fg);
}
.btn-danger:hover { background: #FCA5A5; color: #fff; }
.btn-success {
    background: var(--success-bg);
    color: var(--success-fg);
}
.btn-success:hover { background: #86EFAC; }
.btn-block { width: 100%; }
.btn-sm    { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; gap: 5px; }
.btn-lg    { padding: 12px 22px; font-size: 14.5px; border-radius: 14px; }
.btn svg   { width: 16px; height: 16px; }
.btn-sm svg{ width: 14px; height: 14px; }

/* =====================================================================
   Forms
   ===================================================================== */
.form { display: flex; flex-direction: column; gap: 14px; }
.form h3 {
    margin: 6px 0 -2px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .8px;
}
label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 500;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="date"], input[type="datetime-local"],
input[type="search"], input[type="url"], input[type="file"],
select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(123, 44, 219, .12);
}
textarea { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.checkbox-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    margin-top: 26px;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
}
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--brand-purple); }

/* =====================================================================
   Alerts
   ===================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: var(--success-bg); color: var(--success-fg); }
.alert-error,
.alert-danger  { background: var(--danger-bg);  color: var(--danger-fg); }
.alert-info    { background: var(--info-bg);    color: var(--info-fg); }
.alert-warning { background: var(--warning-bg); color: var(--warning-fg); }
.alert svg { flex-shrink: 0; }

/* =====================================================================
   Tables
   ===================================================================== */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    overflow: hidden;
}
.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
table.data thead th {
    text-align: left;
    padding: 14px 20px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12.5px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    white-space: nowrap;
}
table.data thead th .sort-th {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}
table.data thead th .sort-th svg { width: 12px; height: 12px; opacity: .55; }
table.data tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .15s ease; }
table.data tbody tr:hover { background: var(--surface-2); }

.cell-client {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.cell-client .avatar { width: 38px; height: 38px; font-size: 13px; }
.cell-client b { font-weight: 600; display: block; color: var(--text); }
.cell-client small { color: var(--text-muted); font-size: 12px; }

/* =====================================================================
   Pills / Badges
   ===================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    background: var(--neutral-bg);
    color: var(--neutral-fg);
    white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge.success { background: var(--success-bg); color: var(--success-fg); }
.badge.warning { background: var(--warning-bg); color: var(--warning-fg); }
.badge.danger  { background: var(--danger-bg);  color: var(--danger-fg); }
.badge.info    { background: var(--info-bg);    color: var(--info-fg); }
.badge.brand   { background: #F1E8FE; color: var(--brand-purple); }
.badge.accent  { background: var(--accent-bg); color: var(--accent-fg); }
.badge-pill    { padding: 5px 12px; font-size: 12.5px; }

/* =====================================================================
   Toolbar (search + filter + actions)
   ===================================================================== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.search-input {
    flex: 1;
    min-width: 220px;
    position: relative;
}
.search-input > svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    width: 18px; height: 18px;
}
.search-input input {
    padding-left: 44px;
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--r-full);
    height: 44px;
}
.search-input input:focus { box-shadow: 0 0 0 3px rgba(123, 44, 219, .10); }

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    height: 44px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 500;
}
.filter-btn:hover { background: var(--surface-2); }

.toolbar select {
    height: 44px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0 36px 0 14px;
    font-size: 13.5px;
}

.toolbar input[type="date"] {
    height: 44px;
    border-radius: var(--r-full);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 0 14px;
    font-size: 13.5px;
}

/* =====================================================================
   Segmented control
   ===================================================================== */
.segmented {
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 4px;
    gap: 2px;
}
.segmented a, .segmented button {
    padding: 7px 14px;
    border-radius: var(--r-full);
    color: var(--text-muted);
    background: transparent;
    border: none;
    font-size: 12.5px;
    cursor: pointer;
    font-weight: 500;
    text-decoration: none;
}
.segmented a.is-active, .segmented button.is-active {
    background: var(--text);
    color: var(--surface);
    font-weight: 600;
}

/* =====================================================================
   Modal
   ===================================================================== */
.modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow-y: auto; }
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(11, 13, 18, .55);
    backdrop-filter: blur(4px);
    pointer-events: auto;
    animation: fadeIn .2s ease;
}
.modal {
    position: relative;
    margin: 5vh auto;
    max-width: 640px;
    background: var(--surface);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    pointer-events: auto;
    animation: popIn .25s cubic-bezier(.22, 1, .36, 1);
}
.modal-large { max-width: 880px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h3 { margin: 0; font-size: 19px; font-weight: 700; }
.modal-close {
    background: var(--surface-2);
    border: none;
    width: 36px; height: 36px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover { background: var(--neutral-bg); color: var(--text); }
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn  { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* =====================================================================
   Utilities
   ===================================================================== */
.muted { color: var(--text-muted); font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.flex-1 { flex: 1; }
.gap-sm { gap: 8px; }
.mt-2 { margin-top: 18px; }
.mb-2 { margin-bottom: 18px; }
.mb-3 { margin-bottom: 24px; }
.text-right { text-align: right; }
.text-success { color: var(--success-fg); }
.text-danger  { color: var(--danger-fg); }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 12px; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state h3 { margin: 0 0 6px; color: var(--text); font-weight: 600; }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; color: var(--text-soft); }

/* =====================================================================
   Sidebar overlay (mobile)
   ===================================================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 40;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.is-open { display: block; }

@media (max-width: 980px) {
    /* Mobile: hide sidebar entirely (replaced by bottom-nav) */
    .sidebar { display: none; }
    .sidebar-overlay { display: none !important; }
    .menu-toggle { display: none !important; }

    .topbar { padding: 16px 18px; }
    .page {
        padding: 0 18px calc(108px + env(safe-area-inset-bottom)) !important;
    }
    .topbar-title h1 { font-size: 22px; }
}

/* =====================================================================
   Mobile bottom navigation (app-like)
   ===================================================================== */
.bottom-nav { display: none; }

@media (max-width: 980px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0; right: 0; bottom: 0;
        z-index: 60;
        padding: 6px 6px calc(8px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.86);
        -webkit-backdrop-filter: saturate(180%) blur(18px);
        backdrop-filter: saturate(180%) blur(18px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -8px 24px -12px rgba(15, 23, 42, .10);
        justify-content: space-around;
        align-items: stretch;
    }

    .bn-tab {
        flex: 1 1 0;
        min-width: 0;
        background: none;
        border: 0;
        padding: 8px 2px 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        color: var(--text-muted);
        text-decoration: none;
        font: inherit;
        cursor: pointer;
        border-radius: 14px;
        transition: color .15s ease, background .15s ease, transform .15s ease;
    }
    .bn-tab:active { transform: scale(.96); }

    .bn-icon {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px; height: 32px;
        border-radius: 12px;
        transition: background .2s ease;
    }

    .bn-tab.is-active {
        color: var(--brand);
    }
    .bn-tab.is-active .bn-icon {
        background: linear-gradient(135deg, rgba(123, 44, 219, .14), rgba(34, 211, 238, .14));
    }

    .bn-label {
        font-size: 10.5px;
        font-weight: 600;
        letter-spacing: .01em;
        line-height: 1;
        white-space: nowrap;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    @media (max-width: 380px) {
        .bn-label { font-size: 9.5px; }
        .bn-tab { padding: 8px 2px 6px; }
    }

    .bn-badge {
        position: absolute;
        top: -2px; right: -6px;
        min-width: 16px; height: 16px;
        padding: 0 5px;
        border-radius: 999px;
        background: var(--danger, #ef4444);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        box-shadow: 0 0 0 2px rgba(255, 255, 255, .92);
    }
}

/* Bottom sheet (Περισσότερα) */
.bn-sheet-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .42);
    z-index: 70;
    backdrop-filter: blur(2px);
}
.bn-sheet-overlay.is-open { display: block; }

.bn-sheet {
    display: none;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 80;
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -16px 40px -12px rgba(15, 23, 42, .25);
    padding: 12px 18px calc(22px + env(safe-area-inset-bottom));
    max-height: 80vh;
    overflow-y: auto;
    animation: bn-sheet-slide .26s cubic-bezier(.22, .61, .36, 1);
}
.bn-sheet.is-open { display: block; }

@keyframes bn-sheet-slide {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.bn-sheet-handle {
    width: 40px; height: 4px;
    background: var(--border);
    border-radius: 4px;
    margin: 6px auto 14px;
}
.bn-sheet-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px;
}
.bn-sheet-header h3 {
    margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em;
}
.bn-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.bn-sheet-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 10px;
    background: var(--surface-soft, #f7f8fa);
    border-radius: 16px;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: background .15s ease, transform .15s ease;
}
.bn-sheet-item:active { transform: scale(.97); }
.bn-sheet-item.is-active {
    background: linear-gradient(135deg, rgba(123, 44, 219, .14), rgba(34, 211, 238, .14));
    color: var(--brand);
}
.bn-sheet-ic {
    width: 44px; height: 44px;
    background: #fff;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.bn-sheet-item.is-active .bn-sheet-ic { color: var(--brand); }
.bn-sheet-logout { color: var(--danger, #ef4444); }
.bn-sheet-logout .bn-sheet-ic { color: var(--danger, #ef4444); }

/* =====================================================================
   Tab bar
   ===================================================================== */
.tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
    overflow-x: auto;
}
.tab-bar a {
    padding: 12px 16px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    font-weight: 500;
    font-size: 13.5px;
    white-space: nowrap;
}
.tab-bar a.is-active {
    color: var(--text);
    border-bottom-color: var(--text);
    font-weight: 600;
}

/* =====================================================================
   Detail / list items
   ===================================================================== */
.detail-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
}
@media (max-width: 980px) {
    .detail-grid { grid-template-columns: 1fr; }
}
.detail-list { display: grid; gap: 12px; }
.detail-list .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    gap: 10px;
}
.detail-list .row:last-child { border-bottom: none; }
.detail-list .row span:first-child {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.detail-list .row span:last-child { font-weight: 600; text-align: right; word-break: break-word; }
.detail-list svg { width: 14px; height: 14px; }

.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    transition: background .15s ease;
    border: 1px solid transparent;
}
.list-item:hover {
    background: var(--surface-2);
    border-color: var(--border);
}
.list-item .avatar { width: 40px; height: 40px; font-size: 13px; }

/* =====================================================================
   Charts / visuals
   ===================================================================== */
.chart-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}
.chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.type-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
.type-domain      { background: #2BA3FF; }
.type-hosting     { background: #7B2CDB; }
.type-ssl         { background: #16A34A; }
.type-email       { background: #F59E0B; }
.type-seo         { background: #FF2EAA; }
.type-social      { background: #EC4899; }
.type-website     { background: #0EA5E9; }
.type-maintenance { background: #6366F1; }
.type-design      { background: #8B5CF6; }
.type-ads         { background: #EF4444; }
.type-other       { background: #94A3B8; }

/* progress bar */
.progress {
    height: 8px;
    background: var(--surface-2);
    border-radius: var(--r-full);
    overflow: hidden;
}
.progress > div {
    height: 100%;
    background: var(--brand-grad);
    border-radius: var(--r-full);
    transition: width .3s ease;
}

/* gauge donut center */
.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.gauge-center .v {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.gauge-center .l {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

/* "soft" stat box on dashboard */
.task-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
}
.task-row:last-child { border-bottom: none; }
.task-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}
.task-icon.brand { background: #F1E8FE; color: var(--brand-purple); }
.task-icon.success { background: var(--success-bg); color: var(--success-fg); }
.task-icon.warning { background: var(--warning-bg); color: var(--warning-fg); }
.task-icon.danger  { background: var(--danger-bg);  color: var(--danger-fg); }

/* Calendar */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.calendar .cell {
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--surface-2);
    padding: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    position: relative;
}
.calendar .cell.has-event { background: var(--accent-bg); color: var(--accent-fg); }
.calendar .cell.today { outline: 2px solid var(--brand-purple); outline-offset: -1px; color: var(--text); }
.calendar .cell .dot {
    position: absolute;
    bottom: 6px; right: 6px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand-pink);
}
.calendar-head {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 8px;
}
.calendar-head span {
    text-align: center;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: .6px;
}

/* Soft scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-soft); }

/* Print */
@media print {
    .sidebar, .topbar, .icon-btn, .toolbar { display: none !important; }
    .page { padding: 0; }
    body { background: #fff; }
    .card { border: 1px solid #ccc; box-shadow: none; }
}

/* Hide on mobile helper */
@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
    .topbar { gap: 8px; }
    .topbar-actions { gap: 6px; }
    .topbar-actions .btn-primary,
    .topbar-actions .btn-brand { padding: 8px 12px; font-size: 12.5px; }
    .topbar-actions .icon-btn { width: 38px; height: 38px; }
    .user-chip { padding: 4px; }
    .user-chip span:not(.avatar) { display: none; }
    .topbar-title h1 { font-size: 20px; }
    .kpi { padding: 14px; }
    .kpi-value { font-size: 22px; }
    .card { padding: 18px; }
    .topbar { padding: 14px 16px 12px; }
    .page { padding: 0 12px 20px; }
    table.data thead th, table.data tbody td { padding: 12px 14px; }
    .modal { margin: 16px; padding: 22px; max-width: calc(100% - 32px); }
    .form-row { grid-template-columns: 1fr; }
}

/* Tooltip suppress on touch */
@media (hover: none) {
    .nav-link::after { display: none; }
}
