@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* ── Core Backgrounds ─────────────────────────────── */
    --bg: #0f0b1a;
    --surface: #1a1228;
    --surface-soft: #241a36;
    --surface-mid: #2d2040;

    /* ── Glass Panels ─────────────────────────────────── */
    --panel: rgba(255, 255, 255, .07);
    --panel-strong: rgba(255, 255, 255, .12);

    /* ── Text ─────────────────────────────────────────── */
    --text: #f5f0ff;
    --muted: #b8a8d4;
    --subtle: #7a6a9a;

    /* ── Brand Accents (from logo gradient) ───────────── */
    --violet: #8B5CF6;
    /* core purple  */
    --violet-deep: #6D28D9;
    /* deep purple  */
    --violet-light: #A78BFA;
    /* light purple */
    --violet-soft: rgba(139, 92, 246, .16);
    --violet-glow: rgba(139, 92, 246, .32);

    --amber: #F59E0B;
    /* logo gold    */
    --amber-light: #FCD34D;
    /* bright gold  */
    --amber-soft: rgba(245, 158, 11, .16);

    --orange: #F97316;
    /* logo orange  */
    --orange-soft: rgba(249, 115, 22, .14);

    /* ── Semantic ─────────────────────────────────────── */
    --danger: #F43F5E;
    --danger-soft: rgba(244, 63, 94, .14);
    --success: #10B981;
    --success-soft: rgba(16, 185, 129, .14);

    /* ── Borders ──────────────────────────────────────── */
    --line: rgba(255, 255, 255, .10);
    --line-accent: rgba(139, 92, 246, .35);

    /* ── Misc ─────────────────────────────────────────── */
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 20px 60px rgba(0, 0, 0, .45);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .3);
    --shadow-glow: 0 0 40px rgba(139, 92, 246, .2);

    font-family: 'Inter', Tahoma, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, .35) transparent;
}

*::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, .35);
    border-radius: 99px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, .6);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(ellipse at 80% -5%, rgba(109, 40, 217, .28), transparent 38%),
        radial-gradient(ellipse at -5% 95%, rgba(249, 115, 22, .12), transparent 32%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, .06), transparent 60%),
        linear-gradient(160deg, #0d0a18 0%, #130d22 40%, #1a1030 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.shell {
    display: grid;
    grid-template-columns: 292px 1fr;
    min-height: 100vh;
}

/* ── Login page: no sidebar ──────────────────────────── */
body.page-login .shell {
    grid-template-columns: 1fr;
}

body.page-login .sidebar {
    display: none;
}

body.page-login .main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    width: 100%;
}

body.page-login .login-card {
    margin: 0;
    width: min(460px, 100%);
}


.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    border-left: 1px solid var(--line);
    background:
        radial-gradient(ellipse at 85% 5%, rgba(139, 92, 246, .22), transparent 40%),
        radial-gradient(ellipse at 10% 90%, rgba(249, 115, 22, .10), transparent 35%),
        linear-gradient(180deg, rgba(255, 255, 255, .08) 0%, rgba(255, 255, 255, .03) 100%),
        #160e28;
    box-shadow: 2px 0 48px rgba(0, 0, 0, .5), inset -1px 0 0 rgba(255, 255, 255, .06);
    backdrop-filter: blur(24px);
    overflow-y: auto;
    overflow-x: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .04);
    transition: background .2s;
}

.brand:hover {
    background: rgba(255, 255, 255, .07);
}

.brand>span:last-child {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text);
}

.brand-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

.nav {
    display: grid;
    gap: 6px;
}

/* nav section label */
.nav-label {
    padding: 10px 4px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--subtle);
}

.nav a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 0 14px;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
    font-size: 14px;
    font-weight: 500;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .15s ease;
}

.nav a:hover {
    transform: translateX(-2px);
}

.nav a:hover,
.nav a.active {
    color: var(--text);
    border-color: rgba(139, 92, 246, .5);
    background: linear-gradient(135deg,
            rgba(139, 92, 246, .28) 0%,
            rgba(109, 40, 217, .14) 100%);
    box-shadow: 0 8px 28px rgba(139, 92, 246, .2), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.nav a.active::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    right: 0;
    width: 3px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--violet-light), var(--violet-deep));
    box-shadow: 0 0 10px var(--violet), 0 0 20px var(--violet-glow);
}

.nav b {
    min-width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    color: #0d0a14;
    background: linear-gradient(135deg, var(--amber-light), var(--amber));
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(245, 158, 11, .4);
}

.main {
    width: min(1160px, 100%);
    padding: 34px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--violet-soft);
    border: 1px solid rgba(139, 92, 246, .2);
    color: var(--violet-light);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

h2 {
    margin-bottom: 0;
    font-size: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}

.btn.primary {
    background: linear-gradient(135deg, var(--violet-deep) 0%, var(--violet) 60%, var(--violet-light) 100%);
    box-shadow: 0 8px 32px rgba(139, 92, 246, .4), 0 2px 8px rgba(0, 0, 0, .3);
    transition: all .2s ease;
}

.btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 40px rgba(139, 92, 246, .55), 0 4px 12px rgba(0, 0, 0, .3);
}

.btn.secondary {
    border: 1px solid rgba(255, 255, 255, .12);
    background: linear-gradient(135deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .04));
    transition: all .2s ease;
}

.btn.secondary:hover {
    border-color: var(--line-accent);
    background: linear-gradient(135deg, rgba(139, 92, 246, .14), rgba(255, 255, 255, .06));
}

.btn.danger {
    border: 1px solid rgba(244, 63, 94, .4);
    background: linear-gradient(135deg, rgba(244, 63, 94, .16), rgba(244, 63, 94, .08));
    transition: all .2s ease;
}

.btn.danger:hover {
    box-shadow: 0 4px 20px rgba(244, 63, 94, .3);
}

.small-btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stats div,
.panel,
.login-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(145deg,
            rgba(255, 255, 255, .08) 0%,
            rgba(139, 92, 246, .04) 50%,
            rgba(255, 255, 255, .03) 100%);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: border-color .2s, box-shadow .2s, transform .2s;
}

.stats div:hover,
.panel:hover {
    border-color: rgba(139, 92, 246, .22);
    box-shadow: var(--shadow), var(--shadow-glow), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.stats div {
    padding: 24px;
}

.stats span {
    display: block;
    margin-bottom: 6px;
    font-size: 40px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    color: var(--text);
}

.stats p {
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.panel {
    padding: 22px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
    color: var(--muted);
}

.panel-head h2 {
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
}

.ticket-list {
    display: grid;
    gap: 10px;
}

.ticket-row,
.notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(139, 92, 246, .04));
    transition: all .2s ease;
}

.ticket-row:hover,
.notification:hover {
    border-color: rgba(139, 92, 246, .45);
    background: linear-gradient(135deg, rgba(139, 92, 246, .10), rgba(255, 255, 255, .05));
    box-shadow: 0 4px 24px rgba(139, 92, 246, .14);
    transform: translateY(-1px);
}

.ticket-row small,
.notification small,
.comment small {
    display: block;
    margin-top: 7px;
    color: var(--muted);
}

.ticket-row-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ticket-time {
    font-size: 12px;
    color: var(--subtle);
    white-space: nowrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.3px;
    color: var(--muted);
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .08);
}

.pill.new {
    color: var(--violet-light);
    background: var(--violet-soft);
    border-color: rgba(139, 92, 246, .28);
}

.pill.review,
.pill.progress {
    color: var(--amber-light);
    background: var(--amber-soft);
    border-color: rgba(245, 158, 11, .28);
}

.pill.waiting {
    color: var(--orange);
    background: var(--orange-soft);
    border-color: rgba(249, 115, 22, .28);
}

.pill.done {
    color: #34D399;
    background: var(--success-soft);
    border-color: rgba(16, 185, 129, .28);
}

.form {
    display: grid;
    gap: 12px;
}

.form label {
    color: var(--muted);
    font-size: 14px;
}

input,
select,
textarea {
    width: 100%;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

input,
select {
    min-height: 46px;
    padding: 0 14px;
}

select {
    appearance: none;
    padding-left: 42px;
    background:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%) left 18px center / 7px 7px no-repeat,
        linear-gradient(135deg, var(--muted) 50%, transparent 50%) left 13px center / 7px 7px no-repeat,
        rgba(255, 255, 255, .09);
    color-scheme: dark;
    cursor: pointer;
}

select:hover {
    border-color: rgba(155, 92, 255, .38);
    background:
        linear-gradient(45deg, transparent 50%, var(--text) 50%) left 18px center / 7px 7px no-repeat,
        linear-gradient(135deg, var(--text) 50%, transparent 50%) left 13px center / 7px 7px no-repeat,
        rgba(255, 255, 255, .12);
}

select option {
    color: var(--text);
    background: #180f2a;
}

textarea {
    padding: 14px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(139, 92, 246, .7);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .16), 0 0 12px rgba(139, 92, 246, .1);
    background: rgba(255, 255, 255, .09);
}

.form-panel {
    max-width: 760px;
}

.ticket-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 18px;
    margin-bottom: 18px;
}

.clients-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 18px;
    align-items: start;
}

.client-list {
    display: grid;
    gap: 10px;
}

.client-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(139, 92, 246, .04));
    transition: all .2s ease;
}

.client-row:hover {
    border-color: rgba(139, 92, 246, .3);
    background: linear-gradient(135deg, rgba(139, 92, 246, .09), rgba(255, 255, 255, .04));
    box-shadow: 0 4px 20px rgba(139, 92, 246, .12);
}

.client-row small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.client-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.client-actions form {
    margin: 0;
}

.client-actions span:not(.pill) {
    color: var(--muted);
    text-align: left;
}

.ticket-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ticket-meta span {
    padding: 6px 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, .055);
}

.description {
    color: #f6f0fb;
    line-height: 1.9;
}

.attachment img {
    width: min(520px, 100%);
    max-height: 360px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, .2);
}

.comments {
    display: grid;
    gap: 12px;
}

.comment {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .055);
    transition: border-color .2s;
}

.comment:hover {
    border-color: rgba(255, 255, 255, .15);
}

.admin-comment {
    border-color: rgba(139, 92, 246, .35);
    background: linear-gradient(135deg,
            rgba(139, 92, 246, .12) 0%,
            rgba(109, 40, 217, .06) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}

.comment>strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.admin-comment>strong {
    color: var(--violet-light);
}

.comment p {
    margin: 10px 0 0;
    line-height: 1.85;
    font-size: 14px;
}

.mini-attachment {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--violet-light);
    background: var(--violet-soft);
    border: 1px solid rgba(139, 92, 246, .2);
}

.comment-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.notification {
    margin-bottom: 10px;
}

.notification.unread {
    border-color: rgba(139, 92, 246, .45);
    background: linear-gradient(135deg,
            rgba(139, 92, 246, .16) 0%,
            rgba(109, 40, 217, .08) 100%);
    box-shadow: 0 4px 20px rgba(139, 92, 246, .15);
}

.empty {
    padding: 48px 28px;
    color: var(--muted);
    text-align: center;
    border: 1px dashed rgba(139, 92, 246, .2);
    border-radius: var(--radius-lg);
    font-size: 14px;
    letter-spacing: 0.2px;
    background: rgba(139, 92, 246, .03);
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(139, 92, 246, .14), rgba(109, 40, 217, .07));
    border: 1px solid rgba(139, 92, 246, .38);
    box-shadow: 0 4px 16px rgba(139, 92, 246, .12);
}

.alert.danger {
    background: var(--danger-soft);
    border-color: rgba(244, 63, 94, .38);
    box-shadow: 0 4px 16px rgba(244, 63, 94, .12);
}

.login-card {
    width: min(440px, calc(100vw - 36px));
    margin: 8vh auto;
    padding: 36px 32px;
    text-align: center;
    border-color: rgba(139, 92, 246, .2);
    box-shadow: var(--shadow), 0 0 80px rgba(139, 92, 246, .12);
}

.login-logo {
    width: 150px;
    height: 150px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    border: 1px solid rgba(139, 92, 246, .25);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(ellipse at 50% 80%, rgba(249, 115, 22, .22), transparent 50%),
        radial-gradient(ellipse at 50% 20%, rgba(139, 92, 246, .22), transparent 55%),
        rgba(255, 255, 255, .04);
    box-shadow: 0 8px 32px rgba(139, 92, 246, .2), inset 0 1px 0 rgba(255, 255, 255, .1);
}

.login-logo img {
    width: 140px;
    height: 140px;
    padding: 0;
    object-fit: contain;
    background: transparent;
    border-radius: 10px;
    box-shadow: none;
    filter: drop-shadow(0 4px 16px rgba(139, 92, 246, .25));
}

.login-card h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, var(--violet-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.login-card p,
.demo-users {
    color: var(--muted);
    line-height: 1.7;
    font-size: 14px;
}

.demo-users {
    margin-top: 18px;
    padding: 12px 16px;
    font-size: 12px;
    font-family: monospace;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
    color: var(--subtle);
    text-align: left;
    direction: ltr;
}

/* ── Ticket Assignment ────────────────────────────────── */
.assign-divider {
    height: 1px;
    background: var(--line);
    margin: 18px 0 0;
}

.assigned-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.assigned-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--violet-deep), var(--violet));
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.unassigned-note {
    margin: 8px 0 12px;
    font-size: 13px;
    color: var(--subtle);
}

.assignee-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--violet-light);
    background: var(--violet-soft);
    border: 1px solid rgba(139, 92, 246, .2);
    border-radius: 999px;
    white-space: nowrap;
}

@media (max-width: 860px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 18px;
    }

    .nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .main {
        padding: 18px;
    }

    .topbar,
    .ticket-row,
    .notification {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats,
    .ticket-layout,
    .clients-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: 26px;
    }

    .nav {
        grid-template-columns: 1fr;
    }
}

/* ── Assignee Filters ────────────────────────────── */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 99px;
    cursor: pointer;
    transition: all .2s ease;
}

.filter-btn:hover {
    color: var(--text);
    border-color: var(--panel-strong);
    background: var(--surface-mid);
}

.filter-btn.active {
    color: #fff;
    background: var(--violet);
    border-color: var(--violet);
    box-shadow: 0 4px 12px rgba(139, 92, 246, .25);
}