:root {
    --tkt-navy: #11294b;
    --tkt-navy-2: #1b3a66;
    --tkt-gold: #c5a864;
    --tkt-bg: #f4f6fb;
    --tkt-border: #e2e8f0;
    --tkt-muted: #64748b;
    --tkt-sidebar-w: 248px;
}

body { background: var(--tkt-bg); color: #0f172a; font-size: 14px; }
a { text-decoration: none; }

/* Shell */
.tkt-shell { display: flex; min-height: 100vh; }
.tkt-sidebar {
    width: var(--tkt-sidebar-w); background: var(--tkt-navy); color: #cbd5e1;
    position: fixed; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; z-index: 1030;
    transition: transform .2s ease;
}
.tkt-brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: var(--tkt-gold); font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.tkt-brand i { font-size: 22px; }
.tkt-brand-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; clip-path: circle(48%); box-shadow: 0 0 0 2px var(--tkt-gold); background: #fff; }
.tkt-nav { flex: 1; overflow-y: auto; padding: 8px 10px 16px; }
.tkt-nav-heading { text-transform: uppercase; font-size: 11px; letter-spacing: .06em; color: #7c8db0; padding: 14px 10px 6px; }
.tkt-nav-link { display: flex; align-items: center; gap: 10px; color: #cbd5e1; padding: 8px 12px; border-radius: 8px; margin-bottom: 2px; }
.tkt-nav-link i { font-size: 16px; width: 18px; text-align: center; }
.tkt-nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.tkt-nav-link.active { background: var(--tkt-gold); color: var(--tkt-navy); font-weight: 600; }
.tkt-sidebar-foot { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.tkt-sidebar-foot a { color: #94a3b8; }
.tkt-main { flex: 1; margin-left: var(--tkt-sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.tkt-topbar { position: sticky; top: 0; z-index: 1020; background: #fff; border-bottom: 1px solid var(--tkt-border); display: flex; align-items: center; gap: 10px; padding: 10px 20px; }
.tkt-topbar-title { font-weight: 600; font-size: 16px; margin-right: auto; }
.tkt-search { position: relative; align-items: center; }
.tkt-search i { position: absolute; left: 10px; color: var(--tkt-muted); }
.tkt-search input { padding-left: 30px; width: 260px; }
.tkt-content { padding: 20px; }
.tkt-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--tkt-navy); color: var(--tkt-gold); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.tkt-notif-menu { width: 340px; max-height: 420px; overflow-y: auto; }
.tkt-notif { white-space: normal; border-bottom: 1px solid var(--tkt-border); padding: 8px 14px; }
.tkt-notif.unread { background: #eff6ff; }
.tkt-notif-time { font-size: 11px; color: var(--tkt-muted); }

@media (max-width: 991.98px) {
    .tkt-sidebar { transform: translateX(-100%); }
    .tkt-sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .tkt-main { margin-left: 0; }
}

/* Cards */
.card { border: 1px solid var(--tkt-border); border-radius: 10px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--tkt-border); font-weight: 600; }
.tkt-stat { display: flex; align-items: center; gap: 14px; padding: 16px; color: inherit; }
.tkt-stat:hover { color: inherit; }
.tkt-stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.tkt-stat-value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.tkt-stat-label { color: var(--tkt-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* Badges */
.tkt-status { font-weight: 600; }
.tkt-status-primary { background: #dbeafe; color: #1d4ed8; }
.tkt-status-info { background: #cffafe; color: #0e7490; }
.tkt-status-warning { background: #fef3c7; color: #b45309; }
.tkt-status-purple { background: #ede9fe; color: #6d28d9; }
.tkt-status-secondary { background: #e2e8f0; color: #475569; }
.tkt-status-success { background: #dcfce7; color: #15803d; }
.tkt-status-dark { background: #1e293b; color: #f8fafc; }
.tkt-status-danger { background: #fee2e2; color: #b91c1c; }
.tkt-status-light { background: #f1f5f9; color: #94a3b8; text-decoration: line-through; }
.tkt-priority { background: color-mix(in srgb, var(--pcolor) 15%, white); color: var(--pcolor); border: 1px solid color-mix(in srgb, var(--pcolor) 35%, white); font-weight: 600; }
.tkt-overdue { color: #dc2626; font-weight: 600; }
.tkt-sla-ok { color: #16a34a; }

/* Tables */
.table > :not(caption) > * > * { padding: .6rem .75rem; vertical-align: middle; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--tkt-muted); background: #f8fafc; white-space: nowrap; }
.tkt-ticket-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; color: var(--tkt-navy); white-space: nowrap; }
.tkt-tabs .nav-link { color: var(--tkt-muted); font-weight: 600; }
.tkt-tabs .nav-link.active { color: var(--tkt-navy); border-bottom: 3px solid var(--tkt-gold); background: transparent; }
.tkt-tabs .nav-link .badge { font-weight: 600; }

/* Conversation */
.tkt-thread { display: flex; flex-direction: column; gap: 14px; }
.tkt-msg { display: flex; gap: 12px; }
.tkt-msg-body { flex: 1; background: #fff; border: 1px solid var(--tkt-border); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.tkt-msg-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--tkt-muted); margin-bottom: 6px; }
.tkt-msg-head strong { color: #0f172a; font-size: 13px; }
.tkt-msg-text { white-space: normal; word-wrap: break-word; }
.tkt-msg.customer .tkt-avatar { background: var(--tkt-gold); color: var(--tkt-navy); }
.tkt-msg.customer .tkt-msg-body { border-left: 3px solid var(--tkt-gold); }
.tkt-msg.staff .tkt-msg-body { border-left: 3px solid var(--tkt-navy-2); }
.tkt-msg.note .tkt-msg-body { background: #fffbeb; border-color: #fde68a; border-left: 3px solid #f59e0b; }
.tkt-msg.system { justify-content: center; }
.tkt-msg.system .tkt-sys { font-size: 12px; color: var(--tkt-muted); background: #eef2f7; border-radius: 20px; padding: 4px 12px; }
.tkt-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tkt-att { display: flex; align-items: center; gap: 8px; border: 1px solid var(--tkt-border); border-radius: 8px; padding: 6px 10px; background: #f8fafc; color: #0f172a; max-width: 260px; }
.tkt-att img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.tkt-att i { font-size: 22px; color: var(--tkt-navy-2); }
.tkt-att span { display: flex; flex-direction: column; overflow: hidden; font-size: 12px; }
.tkt-att span, .tkt-att small { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.tkt-att small { color: var(--tkt-muted); }
.tkt-meta dt { font-size: 11px; text-transform: uppercase; color: var(--tkt-muted); font-weight: 600; letter-spacing: .03em; }
.tkt-meta dd { margin-bottom: 10px; }
.tkt-resolution { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 12px 14px; }
.tkt-stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.tkt-stars input { display: none; }
.tkt-stars label { font-size: 28px; color: #cbd5e1; cursor: pointer; }
.tkt-stars input:checked ~ label, .tkt-stars label:hover, .tkt-stars label:hover ~ label { color: #f59e0b; }
.tkt-star-static { color: #f59e0b; }
.tkt-timeline { list-style: none; padding-left: 0; margin: 0; }
.tkt-timeline li { position: relative; padding: 0 0 12px 18px; font-size: 12px; }
.tkt-timeline li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--tkt-gold); }
.tkt-timeline li::after { content: ''; position: absolute; left: 7px; top: 14px; bottom: 0; width: 2px; background: var(--tkt-border); }
.tkt-timeline li:last-child::after { display: none; }

/* Auth */
.tkt-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--tkt-navy), #0b1a30); padding: 20px; }
.tkt-auth-card { background: #fff; width: 100%; max-width: 420px; border-radius: 14px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.tkt-auth-brand { color: var(--tkt-gold); background: var(--tkt-navy); display: inline-block; padding: 6px 12px; border-radius: 8px; font-weight: 700; margin-bottom: 16px; }

/* Login page */
.gm-login { margin: 0; min-height: 100vh; font-family: 'Inter', system-ui, sans-serif; background: #f7f4ec; }
.gm-login-shell { display: flex; min-height: 100vh; }
.gm-login-brand {
    position: relative; overflow: hidden; flex: 1.1; color: #e2e8f0; display: flex; flex-direction: column; justify-content: center; padding: 48px 56px;
    background:
        radial-gradient(circle at 15% 20%, rgba(197,168,100,.18), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(197,168,100,.12), transparent 45%),
        linear-gradient(145deg, #0b1a30 0%, #11294b 55%, #0d2140 100%);
}
.gm-login-brand::before {
    content: ''; position: absolute; inset: 0; opacity: .07; pointer-events: none;
    background-image: linear-gradient(30deg, #c5a864 12%, transparent 12.5%, transparent 87%, #c5a864 87.5%, #c5a864),
                      linear-gradient(150deg, #c5a864 12%, transparent 12.5%, transparent 87%, #c5a864 87.5%, #c5a864),
                      linear-gradient(30deg, #c5a864 12%, transparent 12.5%, transparent 87%, #c5a864 87.5%, #c5a864),
                      linear-gradient(150deg, #c5a864 12%, transparent 12.5%, transparent 87%, #c5a864 87.5%, #c5a864);
    background-size: 80px 140px; background-position: 0 0, 0 0, 40px 70px, 40px 70px;
}
.gm-login-glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -62%); background: radial-gradient(circle, rgba(197,168,100,.22), transparent 65%); filter: blur(10px); }
.gm-login-brand-inner { position: relative; max-width: 520px; margin: 0 auto; text-align: center; animation: gmFadeUp .8s ease both; }
.gm-emblem { width: 190px; height: 190px; margin: 0 auto 26px; border-radius: 50%; padding: 6px; background: linear-gradient(135deg, #f5e6b8, #c5a864 45%, #8a6a2c); box-shadow: 0 18px 50px rgba(0,0,0,.45), 0 0 0 10px rgba(197,168,100,.08); animation: gmFloat 6s ease-in-out infinite; }
.gm-emblem img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; clip-path: circle(49%); display: block; background: #fff; }
.gm-login-brand h1 { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 46px; font-weight: 700; color: #fff; margin: 0 0 6px; letter-spacing: .5px; }
.gm-login-brand h1 span { background: linear-gradient(90deg, #f5e6b8, #c5a864, #e9d49a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gm-tagline { color: #c5a864; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; margin-bottom: 36px; }
.gm-features { list-style: none; padding: 0; margin: 0; text-align: left; display: grid; gap: 14px; }
.gm-features li { display: flex; gap: 14px; align-items: flex-start; background: rgba(255,255,255,.04); border: 1px solid rgba(197,168,100,.18); border-radius: 12px; padding: 14px 16px; backdrop-filter: blur(4px); }
.gm-features i { font-size: 20px; color: #c5a864; width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(197,168,100,.12); }
.gm-features strong { display: block; color: #fff; font-weight: 600; font-size: 14px; }
.gm-features span { color: #94a3b8; font-size: 13px; }
.gm-login-brand-foot { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; font-size: 12px; color: #64748b; }

.gm-login-form-side { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: radial-gradient(circle at 100% 0, rgba(197,168,100,.12), transparent 40%), #f7f4ec; }
.gm-login-card { width: 100%; max-width: 420px; background: #fff; border-radius: 20px; padding: 40px 38px 32px; border: 1px solid #ece4cf; box-shadow: 0 30px 60px -20px rgba(17,41,75,.25), 0 0 0 1px rgba(197,168,100,.06); animation: gmFadeUp .7s .1s ease both; }
.gm-login-logo { display: block; width: 230px; max-width: 80%; margin: 0 auto; }
.gm-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 22px; color: #c5a864; }
.gm-divider span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #d9c48f, transparent); }
.gm-login-card h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; font-size: 30px; color: #11294b; text-align: center; margin: 0; }
.gm-sub { text-align: center; color: #64748b; font-size: 14px; margin: 4px 0 24px; }
.gm-label { display: block; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.gm-input { position: relative; display: flex; align-items: center; margin-bottom: 18px; }
.gm-input > i { position: absolute; left: 14px; color: #94a3b8; font-size: 16px; transition: color .2s; }
.gm-input input { width: 100%; height: 48px; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 0 44px 0 42px; font-size: 15px; background: #fbfaf7; transition: border-color .2s, box-shadow .2s, background .2s; }
.gm-input input:focus { outline: none; border-color: #c5a864; background: #fff; box-shadow: 0 0 0 4px rgba(197,168,100,.18); }
.gm-input:focus-within > i { color: #c5a864; }
.gm-eye { position: absolute; right: 8px; border: 0; background: transparent; color: #94a3b8; width: 34px; height: 34px; border-radius: 8px; }
.gm-eye:hover { color: #11294b; background: #f1f5f9; }
.gm-btn { width: 100%; height: 50px; border: 0; border-radius: 12px; margin-top: 6px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: .03em; color: #11294b; background: linear-gradient(135deg, #f1dfa7 0%, #c5a864 50%, #a8873f 100%); background-size: 200% 200%; box-shadow: 0 10px 24px -8px rgba(168,135,63,.7); transition: background-position .4s, transform .15s, box-shadow .2s; }
.gm-btn:hover { background-position: 100% 100%; box-shadow: 0 14px 28px -8px rgba(168,135,63,.85); }
.gm-btn:active { transform: translateY(1px); }
.gm-btn i { transition: transform .2s; }
.gm-btn:hover i { transform: translateX(4px); }
.gm-alert { display: flex; gap: 8px; align-items: center; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 18px; }
.gm-login-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 22px; padding-top: 18px; border-top: 1px dashed #e7dcc0; font-size: 12px; color: #64748b; }
.gm-login-note i { color: #c5a864; font-size: 15px; }
@keyframes gmFadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes gmFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-width: 991.98px) {
    .gm-login-brand { display: none; }
    .gm-login-form-side { min-height: 100vh; background: radial-gradient(circle at 50% 0, rgba(197,168,100,.25), transparent 50%), linear-gradient(160deg, #0b1a30, #11294b); }
}
@media (max-width: 420px) { .gm-login-card { padding: 30px 22px 24px; border-radius: 16px; } }

.btn-primary { background: var(--tkt-navy); border-color: var(--tkt-navy); }
.btn-primary:hover, .btn-primary:focus { background: var(--tkt-navy-2); border-color: var(--tkt-navy-2); }
.btn-gold { background: var(--tkt-gold); color: var(--tkt-navy); font-weight: 600; }
.btn-gold:hover { background: #b39350; color: var(--tkt-navy); }
.perm-grid .form-check { margin-bottom: 6px; }
.form-label { font-weight: 600; font-size: 13px; }
.required::after { content: ' *'; color: #dc2626; }
