:root {
    color-scheme: light;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --surface: #ffffff;
    --canvas: #eff5fe;
    --navy: #0f294a;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --blue-soft: #eff6ff;
    --yellow: #f6cb55;
    --font-helvetica: "Helvetica", "Helvetica Neue", Arial, sans-serif;
    font: 400 15px/1.5 var(--font-helvetica);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font-helvetica); }
a { color: var(--blue); font-weight: 500; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; letter-spacing: -.025em; line-height: 1.22; color: var(--ink); font-family: var(--font-helvetica); }
h1 { font-size: clamp(1.45rem, 2.5vw, 1.85rem); overflow-wrap: anywhere; font-weight: 600; }
h2 { font-size: 1.08rem; font-weight: 600; }
h3 { margin-top: 1.4rem; font-size: .95rem; font-weight: 600; }
p { margin: .45rem 0; }
.muted { color: var(--muted); font-size: .9rem; }
.mono, pre { font-family: ui-monospace, monospace; font-size: .84rem; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; max-height: 20rem; overflow: auto; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: .75rem; }
.skip { position: absolute; z-index: 20; inset: .5rem auto auto .5rem; background: white; padding: .75rem; transform: translateY(-150%); border-radius: 8px; }
.skip:focus { transform: none; }

/* Shell & White KameraKita Sidebar */
.shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #ffffff; border-right: 1px solid var(--line); color: var(--ink); padding: 1.25rem .9rem; display: flex; flex-direction: column; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .65rem; color: var(--ink); text-decoration: none; line-height: 1.15; padding: .35rem .5rem; }
.brand-logo { display: grid; place-items: center; background: var(--blue-soft); border-radius: 10px; padding: .28rem; width: 2.6rem; height: 2.6rem; flex: 0 0 auto; }
.brand-name { font-weight: 600; font-size: 1.02rem; letter-spacing: -.02em; }
.brand-accent { color: var(--blue); }
.brand small { display: block; color: var(--muted); font-size: .62rem; letter-spacing: .08em; margin-top: .18rem; font-weight: 700; }
.sidebar nav { display: grid; gap: .25rem; }
.nav-group { font-size: .68rem; font-weight: 700; letter-spacing: .08em; color: #94a3b8; padding: .85rem .75rem .3rem; }
.sidebar nav a { display: flex; align-items: center; gap: .65rem; color: #475569; border-radius: 10px; padding: .62rem .78rem; text-decoration: none; font-weight: 600; font-size: .92rem; transition: background .15s ease, color .15s ease; }
.sidebar nav a:hover { background: #f8fafc; color: var(--ink); }
.sidebar nav a[aria-current] { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.nav-icon { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; opacity: .82; }
.sidebar nav a[aria-current] .nav-icon { opacity: 1; color: var(--blue); }

.signout { margin-top: auto; display: grid; gap: .55rem; padding-top: .85rem; border-top: 1px solid var(--line); }
.user-foot { display: flex; align-items: center; gap: .65rem; padding: .35rem .4rem; }
.user-avatar { width: 2.2rem; height: 2.2rem; border-radius: 999px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: .9rem; flex: 0 0 auto; }
.user-meta { min-width: 0; display: grid; }
.admin-email { font-size: .82rem; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: .68rem; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.logout-btn { width: 100%; justify-content: flex-start; gap: .55rem; min-height: 38px; border-color: var(--line); color: #475569; font-size: .85rem; }
.logout-btn:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.workspace { display: flex; flex-direction: column; min-width: 0; }
.topbar { background: rgba(255, 255, 255, .86); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: .85rem clamp(1rem, 2.8vw, 2.2rem); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.topbar-title { font-size: 1.2rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.tz-pill { display: inline-flex; align-items: center; padding: .3rem .75rem; border-radius: 999px; background: white; border: 1px solid var(--line); color: var(--muted); font-size: .78rem; font-weight: 600; }
.main { padding: 1.35rem clamp(1rem, 2.8vw, 2.2rem) 3rem; width: 100%; max-width: 96rem; }

/* Panels, Buttons, Inputs, Badges */
.page-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page-heading { margin: 0 0 1.25rem; }
.page-heading p, .section-heading p { color: var(--muted); margin-bottom: 0; }
.section-heading { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 24px rgba(15, 23, 42, .04); min-width: 0; }
.panel + .panel { margin-top: 1rem; }
.padded { padding: 1.25rem; }

button, .button, input, select, textarea { font: inherit; min-height: 42px; border: 1px solid #cbd5e1; border-radius: 10px; background: white; color: var(--ink); padding: .5rem .8rem; transition: all .15s ease; }
button, .button { display: inline-flex; align-items: center; justify-content: center; font-weight: 650; cursor: pointer; text-decoration: none; font-size: .9rem; }
button:hover, .button:hover { background: #f8fafc; border-color: #94a3b8; }
.primary { background: var(--blue); color: white; border-color: var(--blue); box-shadow: 0 4px 12px rgba(37, 99, 235, .22); }
.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
label { font-size: .85rem; font-weight: 650; color: #334155; }
input, select, textarea { width: 100%; min-width: 0; }
textarea { resize: vertical; }
.stack { display: grid; gap: .4rem; margin-top: .9rem; }
.stack label:not(:first-child), .stack button { margin-top: .5rem; }
.actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: .28rem; border-radius: 999px; padding: .22rem .6rem; font-size: .76rem; font-weight: 700; line-height: 1.3; background: #f1f5f9; color: #334155; }
.pending { background: #fef3c7; color: #92400e; }
.approved, .valid { background: #dcfce7; color: #166534; }
.revision_requested, .empty.badge { background: #ffedd5; color: #9a3412; }
.rejected, .invalid { background: #fee2e2; color: #991b1b; }
.empty:not(.badge) { margin: 0; padding: 1.35rem; color: var(--muted); }

/* Dashboard KameraKita.ai Layout */
.kk-dashboard { display: grid; gap: 1.25rem; }
.kk-greeting { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 1.25rem; }
.kk-greeting-left { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.kk-avatar { width: 2.85rem; height: 2.85rem; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex: 0 0 auto; }
.kk-greeting-title { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.kk-greeting-title h1 { font-size: 1.18rem; }
.kk-role-badge { font-size: .68rem; font-weight: 800; padding: .18rem .55rem; border-radius: 999px; background: var(--blue-soft); color: var(--blue); letter-spacing: .04em; }

.kk-hero-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.15rem; align-items: stretch; }
.kk-hero-card { border-radius: 20px; padding: 1.45rem; color: white; background: linear-gradient(135deg, #2563eb 0%, #1d8cf8 55%, #0ea5e9 100%); box-shadow: 0 18px 38px rgba(37, 99, 235, .24); display: flex; flex-direction: column; gap: .9rem; }
.kk-hero-top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; }
.kk-hero-kicker { font-size: .74rem; font-weight: 700; letter-spacing: .06em; color: rgba(255, 255, 255, .88); }
.kk-glass-pill { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .24rem .7rem; font-size: .76rem; font-weight: 600; }
.kk-hero-value-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.kk-hero-number { font-size: clamp(2rem, 3.6vw, 2.7rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.kk-hero-status-pill { background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; padding: .22rem .65rem; font-size: .74rem; font-weight: 700; }
.kk-hero-sub { margin: 0; color: rgba(255, 255, 255, .88); font-size: .9rem; }
.kk-hero-queues { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin-top: .2rem; }
.kk-queue-box { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); border-radius: 12px; padding: .75rem .85rem; color: white; text-decoration: none; display: grid; gap: .25rem; transition: background .15s ease; }
.kk-queue-box:hover { background: rgba(255, 255, 255, .22); }
.kk-queue-label { font-size: .7rem; font-weight: 700; letter-spacing: .05em; color: rgba(255, 255, 255, .86); display: flex; align-items: center; gap: .35rem; }
.kk-queue-box strong { font-size: 1.15rem; font-weight: 800; }
.dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; }
.dot-amber { background: #fbbf24; }
.dot-sky { background: #7dd3fc; }
.dot-rose { background: #fda4af; }
.kk-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin-top: auto; padding-top: .25rem; }
.kk-btn-white { background: white; color: var(--blue); border-radius: 10px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; font-size: .9rem; }
.kk-btn-white:hover { background: #f8fafc; }
.kk-btn-glass { background: rgba(255, 255, 255, .16); color: white; border: 1px solid rgba(255, 255, 255, .28); border-radius: 10px; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; font-size: .9rem; }
.kk-btn-glass:hover { background: rgba(255, 255, 255, .25); }

.kk-card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.kk-section-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: #64748b; }
.kk-section-label { font-size: .72rem; font-weight: 800; letter-spacing: .09em; color: #64748b; margin-top: .25rem; }
.kk-progress-list { display: grid; gap: .95rem; }
.kk-progress-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; font-size: .86rem; margin-bottom: .35rem; }
.kk-progress-row span { color: var(--muted); font-size: .8rem; }
.kk-bar { height: 7px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.kk-bar-fill { display: block; height: 100%; border-radius: 999px; }
.kk-bar-fill.is-green { background: #10b981; }
.kk-bar-fill.is-blue { background: #2563eb; }
.kk-bar-fill.is-indigo { background: #6366f1; }
.kk-bar-fill.is-amber { background: #f59e0b; }

.kk-analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; align-items: stretch; }
.kk-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .6rem; align-items: end; height: 12.5rem; padding-top: .5rem; }
.kk-chart-col { display: flex; flex-direction: column; align-items: center; gap: .35rem; height: 100%; }
.kk-chart-val { font-size: .74rem; font-weight: 700; color: var(--muted); }
.kk-chart-track { flex: 1; width: 100%; max-width: 2.4rem; background: #f1f5f9; border-radius: 8px; display: flex; align-items: flex-end; overflow: hidden; }
.kk-chart-bar { width: 100%; border-radius: 8px; background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%); transition: height .2s ease; }
.kk-chart-bar.is-empty { background: #cbd5e1; }
.kk-chart-lbl { font-size: .72rem; color: var(--muted); font-weight: 600; }

.kk-stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.kk-stat-tile { padding: 1.1rem 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.kk-stat-tile > div { display: grid; gap: .25rem; }
.kk-stat-kicker { font-size: .68rem; font-weight: 700; letter-spacing: .07em; color: var(--muted); }
.kk-stat-tile strong { font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.kk-stat-icon { width: 2.5rem; height: 2.5rem; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; flex: 0 0 auto; }
.kk-stat-icon.is-blue { background: #eff6ff; color: #2563eb; }
.kk-stat-icon.is-indigo { background: #eef2ff; color: #4f46e5; }
.kk-stat-icon.is-purple { background: #f5f3ff; color: #7c3aed; }
.kk-stat-icon.is-green { background: #ecfdf5; color: #059669; }

/* Tables, Filters, Chips, Details, Support */
.chip-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .95rem; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: .35rem .85rem; border-radius: 999px; background: white; border: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 600; text-decoration: none; }
.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.chip.is-active { background: var(--blue); border-color: var(--blue); color: white; }
.filters-modern { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; padding: 1.15rem 1.25rem; align-items: end; }
.filters-modern label { display: grid; gap: .35rem; font-size: .82rem; color: var(--muted); }
.filters-modern .filter-wide { grid-column: span 2; }
.filters-modern .filter-actions { justify-content: flex-start; }

.data { width: 100%; border-collapse: collapse; text-align: left; }
.data th, .data td { border-bottom: 1px solid var(--line); padding: .8rem 1rem; overflow-wrap: anywhere; vertical-align: middle; }
.data thead th { background: #f8fafc; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.data tbody tr:last-child > * { border-bottom: 0; }
.data tbody tr:hover { background: #f8fbff; }
.row-meta, .mobile-label { font-weight: 400; color: var(--muted); font-size: .8rem; }
.mobile-label { display: none; }
.record-link { display: inline-flex; align-items: center; min-height: 36px; }

.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .75rem; padding: 1rem; border-top: 1px solid var(--line); }
.pagination a, .back { display: inline-flex; align-items: center; min-height: 40px; }
.pagination span { color: var(--muted); }
.review-grid, .account-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.review-grid .panel, .account-grid .panel { margin: 0; }
.revision-picker { margin: .9rem 0; }
.revision-picker .actions { margin-top: .3rem; }
.video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0c1628; border-radius: 12px; }
.downloads { display: flex; flex-wrap: wrap; gap: .75rem; padding: .6rem 0; }
.downloads a { min-height: 40px; display: inline-flex; align-items: center; }
.inline-link { margin-left: .8rem; }
.metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.metadata dt { color: var(--muted); font-size: .82rem; }
.metadata dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.history, details { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .75rem; overflow-wrap: anywhere; }
summary { cursor: pointer; font-weight: 650; min-height: 38px; }
.notice { margin: .8rem 0; border-radius: 10px; padding: .75rem 1rem; }
.notice ul { margin: .35rem 0; padding-left: 1.3rem; }
.failure, .field-error { color: #991b1b; }
.failure { background: #fee2e2; }
.success { background: #dcfce7; color: #166534; }

.dashboard-events { list-style: none; margin: 0; padding: .5rem 1.25rem; }
.dashboard-events li { display: grid; gap: .3rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.dashboard-events li:last-child { border-bottom: 0; }
.dashboard-event-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--muted); }

/* Support Inbox */
.support-grid { display: grid; grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.thread-list { list-style: none; margin: 0; padding: 0; }
.thread-list li + li { border-top: 1px solid var(--line); }
.thread-item { display: grid; gap: .15rem; padding: .9rem 1.15rem; text-decoration: none; color: var(--ink); }
.thread-item span { font-size: .8rem; color: var(--muted); font-weight: 400; }
.thread-item:hover { background: #f8fafc; }
.thread-item.is-active { background: var(--blue-soft); border-left: 3px solid var(--blue); }
.support-head { padding-bottom: .85rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.support-head p { margin: .2rem 0 0; }
.chat-stream { display: grid; gap: .75rem; max-height: 28rem; overflow-y: auto; padding: .25rem 0 1rem; }
.chat-bubble { max-width: 82%; padding: .75rem 1rem; border-radius: 14px; border: 1px solid var(--line); }
.chat-bubble.is-user { justify-self: start; background: #f8fafc; }
.chat-bubble.is-staff { justify-self: end; background: var(--blue-soft); border-color: #bfdbfe; }
.chat-bubble p { margin: .35rem 0 0; white-space: pre-wrap; }
.chat-meta { display: flex; justify-content: space-between; gap: 1rem; font-size: .76rem; color: var(--muted); font-weight: 600; }

/* Login Page */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at top right, #dbeafe, transparent 50%), var(--canvas); }
.login-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(100%, 56rem); background: white; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .08); }
.login-hero { padding: 2.2rem; color: white; background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%); display: grid; align-content: space-between; gap: 1rem; }
.login-hero-title { font-size: 1.85rem; font-weight: 800; line-height: 1.15; margin: 0; }
.login-hero-title em { font-style: normal; color: #fde68a; display: block; }
.login-hero-copy { color: rgba(255, 255, 255, .9); margin: 0; }
.login-art { max-width: 14rem; margin: .5rem auto 0; }
.login-panel { padding: 2.2rem; display: grid; align-content: center; }
.login-mark { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.25rem; }
.login-mark img { width: 2.2rem; height: 2.2rem; border-radius: 8px; }
.login-form { display: grid; gap: .9rem; margin-top: 1.25rem; }
.login-field { display: grid; gap: .35rem; }
.login-password { position: relative; }
.login-password:has(button:not([hidden])) input { padding-right: 6.5rem; }
.login-password button { position: absolute; inset: 4px 4px 4px auto; min-height: 34px; border: 0; background: transparent; color: var(--blue); font-size: .8rem; }
.login-password button[hidden] { display: none; }

@media (max-width: 1120px) {
    .kk-hero-grid, .kk-analytics-grid { grid-template-columns: minmax(0, 1fr); }
    .kk-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .shell { display: block; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: .75rem 1rem; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
    .nav-group { display: none; }
    .sidebar nav { display: flex; flex-wrap: wrap; }
    .signout { display: flex; align-items: center; margin: 0; padding: 0; border: 0; }
    .user-meta { display: none; }
    .logout-label { display: none; }
    .filters-modern { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters-modern .filter-wide { grid-column: 1 / -1; }
    .support-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
    .review-grid, .account-grid { grid-template-columns: minmax(0, 1fr); }
    .data thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
    .data, .data tbody { display: block; }
    .data tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: .6rem 1rem; gap: .4rem .75rem; }
    .data tr + tr { border-top: 1px solid var(--line); }
    .data th, .data td { padding: .18rem 0; border: 0; }
    .data th { grid-column: 1 / -1; }
    .mobile-label { display: block; }
}
@media (max-width: 680px) {
    .login-card { grid-template-columns: minmax(0, 1fr); }
    .login-hero-copy, .login-art { display: none; }
    .kk-hero-queues { grid-template-columns: minmax(0, 1fr); }
    .kk-stats-grid, .filters-modern { grid-template-columns: minmax(0, 1fr); }
}
