/* ============================================================
   VGC Trans CRM — UI refresh (2026)
   Se încarcă după app.css și modernizează tema fără a schimba
   structura funcțională a aplicației.
   ============================================================ */

:root {
    --navy: #0b1324;
    --navy-2: #101b31;
    --navy-3: #182640;
    --accent: #2f6bff;
    --accent-2: #5b8cff;
    --accent-soft: #e8efff;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #101828;
    --muted: #667085;
    --border: #e6eaf2;
    --green: #12a150;
    --green-soft: #e9f9f0;
    --red: #e5484d;
    --red-soft: #fdecec;
    --amber: #d97706;
    --amber-soft: #fef3c7;
    --blue: #2f6bff;
    --blue-soft: #e8efff;
    --violet: #7c3aed;
    --violet-soft: #f1eafe;
    --cyan: #0891b2;
    --cyan-soft: #e6f8fb;
    --pink: #db2777;
    --pink-soft: #fce7f3;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px -22px rgba(16, 24, 40, .22);
    --shadow-lg: 0 24px 60px -28px rgba(16, 24, 40, .32);
    --sidebar-w: 264px;
}

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}
::selection { background: #cfe0ff; color: #081020; }
::-webkit-scrollbar-thumb { background: #cdd6e4; }
::-webkit-scrollbar-thumb:hover { background: #b7c3d5; }

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #0a1222 0%, #0c1930 58%, #0a1222 100%);
    border-right: 1px solid rgba(255, 255, 255, .06);
    position: sticky;
    z-index: 30;
}
.sidebar::before {
    content: ""; position: absolute; top: -120px; left: -90px; width: 260px; height: 260px;
    border-radius: 50%; background: radial-gradient(circle, rgba(47, 107, 255, .3), transparent 68%);
    pointer-events: none;
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar .logo { padding: 22px 18px 18px; gap: 12px; }
.sidebar .logo .mark {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, #2f6bff, #22d3ee);
    box-shadow: 0 12px 26px -12px rgba(47, 107, 255, .95);
    font-size: 18px;
}
.sidebar .logo b { font-size: 16px; letter-spacing: -.025em; }
.sidebar .logo span {
    color: #7c8ba4; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase;
}
.sidebar-close {
    display: none; margin-left: auto; width: 34px; height: 34px; border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .06);
    color: #cbd5e1; cursor: pointer; align-items: center; justify-content: center;
}
.sidebar-close:hover { background: rgba(255, 255, 255, .11); }

.nav { padding: 4px 10px 14px; }
.nav-section {
    color: #5f6f89; font-size: 9.5px; letter-spacing: .14em; padding: 18px 12px 7px;
}
.nav-item {
    padding: 10px 12px; border-radius: 10px; gap: 12px; font-size: 13px;
    color: #9aa8bd; margin-bottom: 3px;
}
.nav-item svg { opacity: .92; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
    background: linear-gradient(90deg, rgba(47, 107, 255, .3), rgba(47, 107, 255, .08));
    color: #fff; box-shadow: inset 2px 0 0 #7aa2ff;
}
.nav-item.active svg { color: #a8c6ff; }
.nav-item .badge-count { background: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, .14); }
.sidebar .user-box {
    padding: 14px 16px; background: rgba(255, 255, 255, .03);
    border-top: 1px solid rgba(255, 255, 255, .07);
}
.sidebar .user-box .avatar {
    width: 34px; height: 34px; background: rgba(47, 107, 255, .18); color: #a8c6ff;
    border: 1px solid rgba(47, 107, 255, .22); font-size: 12px;
}
.sidebar .user-box .who b { font-size: 12.5px; }
.sidebar .user-box .who span { font-size: 10.5px; color: #7c8ba4; }
.sidebar .user-box button { color: #7c8ba4; }
.sidebar .user-box button:hover { color: #fca5a5; background: rgba(255, 255, 255, .06); }

/* ---------- Topbar ---------- */
.topbar {
    height: 68px; padding: 0 28px; gap: 12px;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; font-weight: 750; letter-spacing: -.025em; }
.topbar .crumb { font-size: 11.5px; color: #98a2b3; }
.topbar .topbar-sep { color: #d0d5dd; font-size: 12px; }
.topbar .search input {
    width: 260px; height: 40px; border-radius: 11px; background: #f5f7fb;
    border-color: transparent; padding: 0 12px 0 36px; font-size: 12.5px;
}
.topbar .search input::placeholder { color: #98a2b3; }
.topbar .search input:focus {
    width: 320px; background: #fff; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .1);
}
.topbar .search svg { left: 12px; color: #98a2b3; }
.topbar > .chip {
    background: #f5f7fb; border-color: #e9edf4; color: #475467;
    font-size: 11px; padding: 6px 11px;
}
.topbar .btn-ghost {
    width: 38px; height: 38px; padding: 0; justify-content: center;
    border: 1px solid var(--border); background: #fff; border-radius: 10px; color: #475467;
}
.topbar .btn-ghost:hover { background: #f5f7fb; color: var(--text); }
.icon-btn {
    display: none; width: 38px; height: 38px; border: 1px solid var(--border);
    border-radius: 10px; background: #fff; color: #344054;
    align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:hover { background: #f5f7fb; }
.sidebar-backdrop { display: none; }

/* ---------- Content & cards ---------- */
.content { padding: 28px 28px 48px; max-width: 1680px; width: 100%; margin: 0 auto; }
canvas { width: 100%; max-width: 100%; }
.card { border-radius: var(--radius); border-color: var(--border); box-shadow: var(--shadow); }
.card.pad { padding: 22px; }
.card-head { padding: 16px 20px; }
.card-head h3 { font-size: 15px; letter-spacing: -.015em; }
.card-head .sub { font-size: 11.5px; }
.card-body { padding: 20px; }

/* ---------- KPI ---------- */
.kpis-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; border-radius: var(--radius); transition: transform .18s, box-shadow .18s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 20px 38px -28px rgba(16, 24, 40, .35); }
.kpi .kpi-ic { width: 40px; height: 40px; border-radius: 11px; }
.kpi .kpi-label { margin-top: 14px; font-size: 12px; color: var(--muted); }
.kpi .kpi-val { font-size: 28px; letter-spacing: -.045em; }
.kpi .kpi-delta {
    display: inline-flex; align-items: center; gap: 5px; margin-top: 8px;
    padding: 4px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 650;
    background: #f2f4f7; color: #667085;
}
.kpi .kpi-delta.up { background: var(--green-soft); color: #0f8a46; }
.kpi .kpi-delta.down { background: var(--red-soft); color: #c62a2f; }
.kpi .kpi-delta.neutral { background: #f2f4f7; color: #667085; }
.dashboard-toolbar { margin-bottom: 18px; }
.dashboard-toolbar .seg { flex: none; }
.marketing-side {
    grid-column: 1 / -1;
    display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-content: start;
}
@media (max-width: 900px) { .marketing-side { grid-template-columns: 1fr; } }

/* ---------- Buttons & inputs ---------- */
.btn {
    border-radius: 10px; padding: 9px 15px; font-size: 12.5px; font-weight: 650;
    letter-spacing: -.005em;
    transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, #2f6bff, #2356d8);
    color: #fff; border-color: transparent;
    box-shadow: 0 10px 22px -14px rgba(47, 107, 255, .85);
}
.btn-primary:hover { background: linear-gradient(135deg, #245be0, #1d4bc4); }
.btn-outline { background: #fff; border-color: #dfe5f0; color: #344054; }
.btn-outline:hover { background: #f8faff; border-color: #c9d5e8; }
.btn-ghost { color: #667085; }
.btn-ghost:hover { background: #f4f6fb; color: #101828; }
.btn-danger { background: #e5484d; }
.btn-danger:hover { background: #c62a2f; }
.btn-sm { padding: 6px 11px; font-size: 11.5px; border-radius: 8px; }
.btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible {
    outline: 2px solid #9fbdff; outline-offset: 2px;
}
.field label { font-size: 12px; color: #344054; margin-bottom: 6px; }
.field input, .field select, .field textarea {
    border-radius: 10px; border-color: #dfe5f0; padding: 10px 12px; font-size: 13px;
}
.field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}

/* ---------- Badges, tables, tabs ---------- */
.badge { border-radius: 999px; padding: 3px 9px; font-size: 10.5px; letter-spacing: .01em; font-weight: 700; }
.avatar-sm {
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 700; line-height: 1; flex: none;
}
.tbl { font-size: 12.5px; }
.tbl th {
    background: #f8fafc; color: #667085; font-size: 10.5px;
    letter-spacing: .06em; padding: 11px 16px; border-bottom-color: #e9edf4;
}
.tbl td { padding: 12px 16px; border-bottom-color: #eef1f6; }
.tbl tbody tr:hover { background: #f8faff; }
.tbl .cell-main .sub { font-size: 11.5px; }
.pagination { padding: 13px 16px; border-top-color: #eef1f6; font-size: 12px; }
.tabs { padding: 0 20px; gap: 4px; border-bottom-color: #e9edf4; }
.tabs button { padding: 13px 14px; font-size: 13px; }
.seg { background: #eef2f8; border-color: #e6eaf2; border-radius: 12px; padding: 4px; }
.seg button { border-radius: 9px; padding: 7px 14px; font-size: 12px; }
.seg button.active { background: #fff; box-shadow: 0 2px 10px rgba(16, 24, 40, .08); }

/* ---------- Modal, toast ---------- */
.modal-backdrop {
    background: rgba(7, 14, 28, .55);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.modal { border-radius: 18px; box-shadow: 0 40px 100px -30px rgba(7, 14, 28, .5); }
.modal-head { padding: 18px 24px; }
.modal-head h3 { font-size: 16px; letter-spacing: -.02em; }
.modal-body { padding: 24px; }
.modal-foot {
    padding: 15px 24px; background: #fbfcfe; border-top-color: #eef1f6;
    border-radius: 0 0 18px 18px;
}
.toast {
    border-radius: 12px; background: #0b1324; border: 1px solid rgba(255, 255, 255, .1);
    font-size: 12.5px; padding: 12px 16px;
}

/* ---------- Kanban, calendar, details ---------- */
.kanban { gap: 16px; }
.kan-col {
    flex: 1 1 0; width: auto; min-width: 200px;
    background: #f2f5fa; border-color: #e6eaf2; border-radius: 16px;
}
.kan-col-head { padding: 14px 16px; }
.kan-cards { padding: 4px 10px 12px; }
.kan-card { border-radius: 12px; border-color: #e6eaf2; padding: 13px; }
.kan-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -26px rgba(16, 24, 40, .4); }
.cal-grid { border-radius: 14px; }
.cal-cell { min-height: 112px; }
.cal-cell.today { outline: 2px solid var(--accent); background: #f6f9ff; }
.cal-dow { background: #f8fafc; font-size: 10.5px; }
.detail-grid .ditem label { font-size: 10.5px; }
.empty { padding: 52px 20px; }
.empty svg { opacity: .35; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; }
.login-brand {
    padding: 56px 60px;
    background:
        radial-gradient(800px 500px at 12% 0%, rgba(47, 107, 255, .3), transparent 60%),
        radial-gradient(600px 400px at 100% 100%, rgba(34, 211, 238, .12), transparent 65%),
        linear-gradient(160deg, #07101f 0%, #0b1a35 58%, #102a5c 100%);
}
.login-brand::before {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(90% 80% at 30% 20%, #000 20%, transparent 80%);
    mask-image: radial-gradient(90% 80% at 30% 20%, #000 20%, transparent 80%);
}
.login-brand-inner { position: relative; z-index: 1; max-width: 640px; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-logo .mark {
    width: 42px; height: 42px; border-radius: 12px;
    background: linear-gradient(135deg, #2f6bff, #22d3ee);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff;
    box-shadow: 0 12px 28px -12px rgba(47, 107, 255, .95);
}
.login-logo .who b { display: block; color: #fff; font-size: 15px; letter-spacing: -.02em; }
.login-logo .who span {
    display: block; color: #8095b8; font-size: 9.5px; letter-spacing: .16em;
    text-transform: uppercase; margin-top: 2px;
}
.login-pill {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px;
    border-radius: 999px; background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .09); color: #a8c6ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px;
}
.login-brand h1 {
    font-size: clamp(38px, 4.3vw, 58px); line-height: 1.02; letter-spacing: -.05em;
    font-weight: 800; max-width: 640px;
}
.login-brand h1 span { color: #8db4ff; }
.login-brand .sub { color: #9fb2cf; font-size: 15px; line-height: 1.65; max-width: 500px; margin-top: 16px; }
.login-brand .feat { margin-top: 34px; gap: 10px; }
.login-brand .feat-item {
    padding: 12px 14px; border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .035);
}
.login-brand .feat-item .ic {
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(47, 107, 255, .16); border: 1px solid rgba(47, 107, 255, .18); color: #9cc0ff;
}
.login-brand .feat-item b { font-size: 13.5px; }
.login-brand .feat-item p { color: #8da0bd; font-size: 12px; }
.login-brand .foot { position: relative; z-index: 1; color: #607394; font-size: 11px; }
.login-box { background: linear-gradient(180deg, #f7f9fc, #f2f5fa); padding: 40px; }
.login-card {
    max-width: 420px; padding: 34px; border-radius: 20px;
    border: 1px solid #e6eaf2; box-shadow: 0 40px 90px -50px rgba(15, 23, 42, .45);
}
.login-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-card-mark {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #2f6bff, #22d3ee);
    color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.login-card-head b { display: block; font-size: 13px; letter-spacing: -.01em; }
.login-card-head span {
    display: block; color: #98a2b3; font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
}
.login-card h2 { font-size: 27px; letter-spacing: -.04em; }
.login-card .hint { font-size: 13px; line-height: 1.55; margin-bottom: 24px; }
.login-submit { width: 100%; justify-content: center; padding: 12px; font-size: 13px; }
.login-legal { margin-top: 24px; text-align: center; color: #98a2b3; font-size: 10.5px; }
.login-options label { color: #475467; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .kpis-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .sidebar {
        display: flex;
        position: fixed; top: 0; left: 0; height: 100dvh;
        width: min(300px, 86vw); z-index: 110;
        transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.2, .7, .2, 1);
        box-shadow: 30px 0 80px -40px rgba(0, 0, 0, .65);
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    body.sidebar-open { overflow: hidden; }
    .sidebar-close { display: inline-flex; }
    .sidebar-backdrop {
        display: block; position: fixed; inset: 0; z-index: 105;
        background: rgba(6, 12, 24, .55);
        -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
        opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .menu-toggle { display: inline-flex; }
    .topbar { height: 64px; padding: 0 16px; gap: 10px; }
    .topbar .crumb, .topbar .topbar-sep, .topbar .date-chip { display: none; }
    .topbar h1 {
        font-size: 16px; flex: 1; min-width: 0;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    }
    .topbar .spacer { display: none; }
    .topbar .search { margin-left: auto; }
    .topbar .search input { width: 190px; }
    .topbar .search input:focus { width: 220px; }
    .content { padding: 20px 16px 40px; }
    .kpis-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
    .dashboard-toolbar > .row { flex-direction: column; align-items: stretch; gap: 8px; }
    .dashboard-toolbar .seg { width: 100%; }
    .dashboard-toolbar .seg button { flex: 1; }
    .dashboard-toolbar .small.muted { display: none; }
    .dashboard-toolbar > .btn { width: 100%; justify-content: center; }
    .login-wrap { flex-direction: column; }
    .login-brand { flex: none; padding: 30px 24px 26px; min-height: auto; }
    .login-brand .feat, .login-brand .foot { display: none; }
    .login-brand h1 { font-size: clamp(30px, 8vw, 42px); }
    .login-brand .sub { font-size: 13.5px; margin-top: 12px; }
    .login-logo { margin-bottom: 18px; }
    .login-pill { margin-bottom: 14px; }
    .login-box { padding: 24px 16px 36px; }
    .login-card { padding: 26px 22px; }
}
@media (max-width: 640px) {
    body { overflow-x: hidden; }
    .topbar .search { display: none; }
    .kpis-grid { grid-template-columns: 1fr; }
    .content { padding: 16px 12px 36px; }
    .card-head { padding: 14px 16px; }
    .card-body { padding: 16px; }
    .field-row, .field-row-3 { grid-template-columns: 1fr; }
    .modal-backdrop { padding: 16px 10px; }
    .modal-body { padding: 18px; }
    .modal-head { padding: 16px 18px; }
    .modal-foot { padding: 12px 18px; }
    .login-brand { padding: 24px 18px 22px; }
    .login-brand h1 { font-size: 30px; }
    .login-brand .sub { display: none; }
    .login-card { padding: 24px 18px; }
    .kanban { gap: 12px; }
    .kan-col { min-width: 270px; }
    .row.spread { flex-wrap: wrap; align-items: flex-start; }
    .row.spread > .row { width: 100%; flex-wrap: wrap; }
    .row.spread > .btn { flex: 0 0 auto; }
    #view input#q { width: 100% !important; }
    .seg { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .seg::-webkit-scrollbar { display: none; }
    .seg button { flex: 0 0 auto; }
    .table-wrap:has(.empty) { overflow-x: hidden; }
    .table-wrap:has(.empty) table.tbl { display: block; width: 100%; }
    .table-wrap:has(.empty) table.tbl thead { display: none; }
    .table-wrap:has(.empty) table.tbl tbody,
    .table-wrap:has(.empty) table.tbl tr,
    .table-wrap:has(.empty) table.tbl td { display: block; width: 100%; }
    .table-wrap:has(.empty) table.tbl td { padding: 0; border-bottom: 0; }
    .table-wrap:has(.empty) .empty { width: 100%; padding: 36px 20px; }
}
