:root {
    --gold: #d4af37;
    --gold-2: #c5a35a;
    --gold-3: #f3e2b0;
    --gold-dark: #8a6a22;
    --ink: #0a0a0a;
    --ink-2: #141414;
    --ink-3: #1c1c1c;
    --panel: #111111;
    --line: rgba(212, 175, 55, .22);
    --text: #f6f1e4;
    --muted: #b7ae99;
    --paper: #f6f3ec;
    --paper-2: #fffdf8;
    --danger: #c0392b;
    --ok: #1e8a5a;
    --warn: #c47b12;
    --info: #2b6ea3;
    --shadow: 0 18px 50px rgba(0, 0, 0, .28);
    --radius: 18px;
    --side: 280px;
    --client: var(--gold);
    --font: Arial, Helvetica, sans-serif;
    --serif: Arial, Helvetica, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    color: var(--ink);
    background: var(--paper);
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

button, input, select, textarea {
    font-family: inherit;
}

/* ===== Landing / Login ===== */
.auth-body {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(212, 175, 55, .18), transparent 55%),
        radial-gradient(900px 500px at 110% 20%, rgba(212, 175, 55, .1), transparent 50%),
        #050505;
    color: var(--text);
}

.auth-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 5, 5, .72);
    backdrop-filter: blur(14px);
}

.auth-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
    padding: 12px 36px;
}

.auth-top-brand {
    font-size: 12px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold-3);
    white-space: nowrap;
}

.auth-switch {
    display: flex;
    padding: 4px;
    border: 1px solid rgba(212, 175, 55, .35);
    border-radius: 999px;
    background: #0a0a0a;
}

.auth-switch a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 138px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 999px;
    transition: .2s ease;
}

.auth-switch a:hover {
    color: var(--gold-3);
}

.auth-switch a.active {
    color: #111;
    background: linear-gradient(180deg, #f1d47a, var(--gold));
    box-shadow: 0 6px 16px rgba(212, 175, 55, .28);
}

.auth-wrap {
    display: grid;
    grid-template-columns: 1.15fr .95fr;
    min-height: 100vh;
    padding-top: 68px;
}

.auth-hero {
    padding: 48px 64px;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--line);
}

.auth-hero::after {
    content: "";
    position: absolute;
    inset: auto -80px -120px auto;
    width: 420px;
    height: 420px;
    background: url("../img/lotus.svg") no-repeat center / contain;
    opacity: .08;
    pointer-events: none;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-logo img,
.brand-lotus {
    width: 52px;
    height: 52px;
    object-fit: contain;
    mix-blend-mode: screen;
}

.logo-word {
    font-family: var(--serif);
    letter-spacing: .28em;
    font-size: 18px;
    font-weight: 600;
}

.logo-word small {
    display: block;
    letter-spacing: .42em;
    font-size: 9px;
    color: var(--gold-2);
    margin-top: 2px;
}

.script {
    font-family: var(--serif);
    font-style: italic;
    color: var(--gold-3);
    margin: 72px 0 10px;
    font-size: 28px;
    letter-spacing: .02em;
}

.auth-hero h1 {
    font-family: var(--serif);
    font-size: clamp(36px, 5vw, 58px);
    line-height: .95;
    margin: 0 0 18px;
    font-weight: 600;
    letter-spacing: .02em;
}

.auth-hero p.lead {
    max-width: 520px;
    color: var(--muted);
    line-height: 1.7;
    font-weight: 300;
}

.portal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 42px;
    max-width: 640px;
}

.portal-card {
    display: block;
    text-decoration: none;
    padding: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    border-radius: 16px;
    transition: .22s ease;
    min-height: 128px;
}

.portal-card:hover,
.portal-card.active {
    border-color: var(--gold);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, .12);
    background: rgba(212, 175, 55, .06);
}

.portal-code {
    display: inline-block;
    font-size: 11px;
    letter-spacing: .18em;
    color: var(--gold);
    border: 1px solid var(--line);
    padding: 4px 8px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.portal-card strong {
    display: block;
    font-size: 20px;
    margin-bottom: 4px;
}

.portal-card span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: #0e0e0e;
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    font-family: var(--serif);
    font-size: 34px;
    margin: 0 0 6px;
}

.auth-card .hint {
    color: var(--muted);
    margin-bottom: 28px;
    font-size: 14px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold-2);
    margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    background: #161616;
    border: 1px solid #2a2a2a;
    color: var(--text);
    border-radius: 12px;
    padding: 13px 14px;
    outline: none;
    transition: .2s;
}

.app-body .field input,
.app-body .field select,
.app-body .field textarea {
    background: #fff;
    color: var(--ink);
    border-color: #e4dcc8;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .16);
}

.field textarea {
    min-height: 140px;
    resize: vertical;
}

.staff-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--gold-2);
    font-size: 13px;
}

.auth-foot {
    margin-top: 28px;
    color: #7d7664;
    font-size: 12px;
}

/* ===== App shell ===== */
.app-body {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(900px 400px at 100% 0, rgba(212, 175, 55, .08), transparent 50%),
        var(--paper);
}

.sidebar {
    width: var(--side);
    background: linear-gradient(180deg, #0b0b0b, #111);
    color: var(--text);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid var(--line);
    z-index: 20;
    scrollbar-width: thin;
    scrollbar-color: rgba(212, 175, 55, .45) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, .4);
    border-radius: 999px;
}

.sidebar-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 6px 8px 12px;
    border-bottom: 1px solid var(--line);
}

.brand-name {
    font-family: var(--serif);
    letter-spacing: .32em;
    font-size: 15px;
}

.brand-sub {
    color: var(--gold-2);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.sidebar-portal {
    background: rgba(212, 175, 55, .07);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
}

.portal-kicker {
    display: block;
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 4px;
}

.sidebar-portal strong {
    display: block;
    font-size: 16px;
}

.sidebar-portal small {
    color: var(--muted);
    font-size: 12px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #d8d0bc;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    position: relative;
}

.side-nav a:hover,
.side-nav a.active {
    background: rgba(212, 175, 55, .12);
    color: var(--gold-3);
}

.nav-cta {
    background: linear-gradient(180deg, #e8d5a3, #c5a35a 58%, #9d7c2e) !important;
    color: #1a1408 !important;
    font-weight: 600;
    margin-top: 6px;
}

.nav-cta.active,
.nav-cta:hover {
    filter: brightness(1.05);
}

.nav-ico {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
}

.nav-ico svg {
    width: 18px;
    height: 18px;
}

.nav-badge {
    margin-left: auto;
    background: var(--gold);
    color: #1a1408;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    border-radius: 999px;
    padding: 2px 6px;
}

.nav-cta .nav-badge {
    background: #1a1408;
    color: var(--gold-3);
}

.side-projects {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.side-projects a {
    text-decoration: none;
    font-size: 11px;
    letter-spacing: .08em;
    border: 1px solid var(--line);
    color: var(--gold-2);
    padding: 5px 8px;
    border-radius: 999px;
}

.side-projects a.active {
    background: var(--gold);
    color: #1a1408;
    border-color: var(--gold);
}

.sidebar-foot {
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 14px;
    background: linear-gradient(180deg, rgba(17, 17, 17, 0), #111 16px);
}

.user-chip {
    display: flex;
    gap: 10px;
    align-items: center;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--gold);
    color: #1a1408;
    font-weight: 700;
    font-size: 12px;
}

.user-chip strong {
    display: block;
    font-size: 13px;
}

.user-chip small {
    color: var(--muted);
    font-size: 11px;
}

.logout-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--gold-2);
    font-size: 12px;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 28px 10px;
}

.topbar h1 {
    margin: 0;
    font-family: var(--serif);
    font-size: 34px;
    font-weight: 600;
}

.crumb {
    margin: 0;
    color: #8a8170;
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.menu-btn {
    display: none;
    border: 1px solid #e4dcc8;
    background: #fff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
}

.app-content {
    padding: 10px 28px 40px;
    flex: 1;
}

.app-footer {
    padding: 8px 28px 22px;
    color: #8a8170;
    font-size: 12px;
}

.sidebar-overlay {
    display: none;
}

/* ===== Buttons / UI ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    cursor: pointer;
    text-decoration: none;
    border-radius: 12px;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 14px;
}

.btn-gold {
    background: linear-gradient(180deg, #e8d5a3, #c5a35a 55%, #9d7c2e);
    color: #1a1408;
    box-shadow: 0 10px 24px rgba(197, 163, 90, .28);
}

.btn-gold:hover {
    filter: brightness(1.05);
}

.btn-dark {
    background: var(--ink);
    color: var(--gold-3);
}

.btn-ghost {
    background: transparent;
    border: 1px solid #ddd3bb;
    color: var(--ink);
}

.btn-danger {
    background: #8b1e1e;
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(1.08);
}

.btn-sm {
    padding: 7px 11px;
    font-size: 12px;
    border-radius: 10px;
}

.btn-block {
    width: 100%;
}

.reset-pass {
    display: flex;
    gap: 6px;
    align-items: center;
    min-width: 230px;
}

.reset-pass input[type="password"] {
    flex: 1;
    min-width: 0;
    border: 1px solid #e4dcc8;
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
}

.raise-top {
    margin-left: auto;
}

.flash {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.flash-success {
    background: #e8f6ee;
    color: #1e5c3a;
}

.flash-error {
    background: #fdecea;
    color: #8a241c;
}

.flash-info {
    background: #eef4fb;
    color: #1d4e7a;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.stat {
    background: var(--paper-2);
    border: 1px solid #eadfca;
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 8px 24px rgba(20, 16, 8, .04);
}

.stat span {
    display: block;
    color: #8a8170;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.stat strong {
    font-family: var(--serif);
    font-size: 36px;
    display: block;
    margin: 6px 0 0;
}

.stat.gold {
    background: linear-gradient(160deg, #1a160d, #0d0d0d);
    color: var(--gold-3);
    border-color: var(--gold-dark);
}

.stat.gold span {
    color: var(--gold-2);
}

.panel {
    background: var(--paper-2);
    border: 1px solid #eadfca;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 8px 24px rgba(20, 16, 8, .04);
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-head h2,
.panel h2 {
    font-family: var(--serif);
    margin: 0;
    font-size: 26px;
}

.hero-cta {
    display: grid;
    grid-template-columns: 1.4fr .8fr;
    gap: 16px;
    margin-bottom: 22px;
}

.hero-cta .copy {
    background: linear-gradient(145deg, #0d0d0d, #1a160d);
    color: var(--text);
    border-radius: 22px;
    padding: 28px;
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.hero-cta .copy::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -40px;
    width: 180px;
    height: 180px;
    background: url("../img/lotus.svg") no-repeat center / contain;
    opacity: .12;
}

.hero-cta h2 {
    font-family: var(--serif);
    font-size: 34px;
    margin: 0 0 8px;
}

.hero-cta p {
    color: var(--muted);
    max-width: 560px;
}

.client-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.compact-cards {
    margin-bottom: 0;
}

.client-mini {
    text-decoration: none;
    background: var(--paper-2);
    border: 1px solid #eadfca;
    border-radius: 16px;
    padding: 16px;
    display: block;
}

.client-mini:hover {
    border-color: var(--gold);
}

.client-mini b {
    display: block;
    font-size: 18px;
}

.client-mini small {
    color: #8a8170;
    display: block;
    margin-top: 4px;
}

.table-wrap {
    overflow: auto;
}

table.tickets {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table.tickets th {
    text-align: left;
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #8a8170;
    padding: 10px 12px;
    border-bottom: 1px solid #eadfca;
}

table.tickets td {
    padding: 13px 12px;
    border-bottom: 1px solid #f0e9da;
    vertical-align: middle;
}

table.tickets tr:hover td {
    background: #fbf7ee;
}

table.tickets.wide {
    min-width: 2100px;
    font-size: 12px;
}

table.tickets.wide th,
table.tickets.wide td {
    white-space: nowrap;
    font-size: 12px;
    padding: 10px 10px;
    vertical-align: top;
}

table.tickets.wide td.wrap,
table.tickets.wide .desc-clip {
    white-space: normal;
    min-width: 160px;
    max-width: 240px;
}

.desc-clip {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.row-actions form {
    margin: 0;
}

.sla-met {
    color: #1e5c3a;
    font-weight: 700;
    white-space: normal;
    min-width: 140px;
}

.sla-lad {
    color: #9a2f1c;
    font-weight: 700;
    white-space: normal;
    min-width: 140px;
}

.solution-box {
    margin-top: 16px;
    padding: 12px 14px;
    background: #f3f8f4;
    border: 1px solid #cfe3d4;
    border-radius: 12px;
}

.solution-box p {
    margin: 6px 0 0;
    white-space: pre-wrap;
    line-height: 1.55;
}

.ticket-title {
    display: block;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
}

.ticket-title:hover {
    color: var(--gold-dark);
}

.mono {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: #6f6758;
}

.pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
}

.st-new { background: #ece6ff; color: #4b35a0; }
.st-open { background: #e7f1fb; color: #1d4e7a; }
.st-in_progress { background: #fff4d8; color: #8a5a00; }
.st-pending { background: #fdecd8; color: #9a4b12; }
.st-resolved { background: #e5f6ec; color: #1e5c3a; }
.st-closed { background: #eeebe4; color: #5c5649; }

.pr-low { background: #eef2f5; color: #44505c; }
.pr-medium { background: #e7f1fb; color: #1d4e7a; }
.pr-high { background: #fff0d8; color: #8a4b00; }
.pr-critical { background: #fde8e6; color: #9a1f16; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.filters input,
.filters select {
    border: 1px solid #e4dcc8;
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
}

.filters input {
    min-width: 240px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1.4fr .8fr;
    gap: 16px;
}

.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.grid-form .full {
    grid-column: 1 / -1;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment {
    display: flex;
    gap: 12px;
}

.comment .bubble {
    background: #fbf7ee;
    border: 1px solid #eadfca;
    border-radius: 14px;
    padding: 12px 14px;
    flex: 1;
}

.comment.internal .bubble {
    background: #111;
    color: #f6f1e4;
    border-color: #2a2a2a;
}

.comment .meta {
    font-size: 12px;
    color: #8a8170;
    margin-bottom: 6px;
}

.comment.internal .meta {
    color: var(--gold-2);
}

.meta-list {
    display: grid;
    gap: 10px;
}

.meta-list div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #eadfca;
}

.empty {
    text-align: center;
    padding: 40px 16px;
    color: #8a8170;
}

.file-box {
    border: 1px dashed #d2c6a8;
    border-radius: 14px;
    padding: 16px;
    background: #fcfaf4;
}

.attach-list a {
    display: flex;
    justify-content: space-between;
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 1px solid #f0e9da;
    color: var(--ink);
    font-size: 13px;
}

.check {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.help {
    color: #8a8170;
    font-size: 12px;
    margin-top: 6px;
}

@media (max-width: 1080px) {
    .stats,
    .client-cards,
    .hero-cta,
    .grid-2,
    .auth-wrap,
    .portal-grid {
        grid-template-columns: 1fr;
    }
    .raise-top {
        display: none;
    }
    .auth-top-inner {
        padding: 12px 18px;
    }
    .auth-switch a {
        min-width: 0;
        padding: 9px 14px;
    }
}

@media (max-width: 860px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        height: 100dvh;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: .25s ease;
    }
    .sidebar.open {
        transform: none;
    }
    .menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .sidebar-overlay.show {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 15;
    }
    .app-content, .topbar, .app-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    .grid-form {
        grid-template-columns: 1fr;
    }
    .auth-top-brand {
        display: none;
    }
    .auth-top-inner {
        justify-content: center;
    }
    .auth-switch {
        width: 100%;
        max-width: 380px;
    }
    .auth-switch a {
        flex: 1;
    }
}

.contents {
    display: contents;
}

.sla-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.col-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.col-card {
    border: 1px solid #eadfca;
    border-radius: 14px;
    padding: 12px;
    background: #fbf7ee;
}

.col-card form + form {
    margin-top: 8px;
}

.extra-col-head {
    margin-top: 4px;
}
