:root {
  --ink: #191715;
  --ink-soft: #2b2825;
  --gold: #a98b55;
  --gold-dark: #80683f;
  --cream: #f5f1e8;
  --cream-deep: #eae2d3;
  --paper: #fffdf8;
  --muted: #746d63;
  --line: #ddd4c5;
  --success: #3f7152;
  --danger: #a6423a;
  --warning: #9a6828;
  --shadow: 0 22px 55px rgba(37, 31, 24, .09);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% 0%, rgba(169, 139, 85, .14), transparent 28rem),
    linear-gradient(180deg, #faf8f2 0%, var(--cream) 100%);
  font-family: "Manrope", Arial, sans-serif;
}

a { color: var(--gold-dark); }
a:hover { color: var(--ink); }

.app-navbar {
  min-height: 82px;
  background: rgba(25, 23, 21, .97);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 9px 30px rgba(0, 0, 0, .12);
}

.brand-link { display: flex; align-items: center; gap: 14px; color: white; text-decoration: none; }
.brand-link:hover { color: white; }
.brand-mark { width: 60px; height: 50px; object-fit: contain; background: #f6f0e4; border-radius: 9px; padding: 5px; }
.brand-copy strong { display: block; font-family: "Cormorant Garamond", Georgia, serif; font-size: 22px; line-height: 1; letter-spacing: .5px; }
.brand-copy small { display: block; margin-top: 4px; color: #bbaa8e; font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }

.nav-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; color: #eee8de; font-size: 13px; }
.user-avatar { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(196, 163, 101, .55); border-radius: 50%; color: #d8bd88; font-weight: 800; }
.user-role { display: block; color: #a99f92; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; }

.main-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.eyebrow { margin: 0 0 8px; color: var(--gold-dark); font-size: 10px; font-weight: 800; letter-spacing: 2.2px; text-transform: uppercase; }
.page-title { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(34px, 5vw, 52px); font-weight: 700; line-height: 1; }
.page-subtitle { max-width: 650px; margin: 12px 0 0; color: var(--muted); line-height: 1.65; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }

.surface { overflow: hidden; border: 1px solid rgba(128, 104, 63, .2); border-radius: 18px; background: rgba(255, 253, 248, .91); box-shadow: var(--shadow); }
.surface-body { padding: 30px; }
.section-title { margin: 0 0 6px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 27px; font-weight: 700; }
.section-copy { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.btn { border-radius: 9px; padding: 10px 17px; font-size: 13px; font-weight: 750; }
.btn-brand { border: 1px solid var(--gold); background: var(--gold); color: #171410; }
.btn-brand:hover, .btn-brand:focus { border-color: #c0a46f; background: #c0a46f; color: #171410; }
.btn-dark-brand { border: 1px solid var(--ink); background: var(--ink); color: white; }
.btn-dark-brand:hover { border-color: var(--gold-dark); background: var(--gold-dark); color: white; }
.btn-ghost { border: 1px solid rgba(255,255,255,.22); color: #eee8de; background: transparent; }
.btn-ghost:hover { border-color: var(--gold); color: #f0d49d; }
.btn-outline-brand { border: 1px solid var(--line); color: var(--ink); background: transparent; }
.btn-outline-brand:hover { border-color: var(--gold); background: #f5eddd; color: var(--ink); }

.form-label { margin-bottom: 7px; color: #4c463f; font-size: 12px; font-weight: 800; }
.form-control, .form-select {
  min-height: 47px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background-color: #fffefb;
  color: var(--ink);
  font-size: 14px;
}
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(169, 139, 85, .13); }
textarea.form-control { min-height: 150px; }
.form-hint { color: var(--muted); font-size: 11px; }

.auth-shell { display: grid; min-height: 610px; grid-template-columns: 1.05fr .95fr; overflow: hidden; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.auth-brand { position: relative; display: flex; min-height: 100%; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 46px; background: var(--ink); color: white; }
.auth-brand::after { position: absolute; right: -110px; bottom: -130px; width: 390px; height: 390px; border: 1px solid rgba(196, 163, 101, .27); border-radius: 50%; content: ""; box-shadow: 0 0 0 60px rgba(196,163,101,.04), 0 0 0 120px rgba(196,163,101,.025); }
.auth-logo { position: relative; z-index: 1; width: 190px; max-height: 130px; padding: 10px 14px; border-radius: 12px; background: var(--cream); object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0,0,0,.28)); }
.auth-brand-content { position: relative; z-index: 1; max-width: 480px; }
.auth-brand h1 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(38px, 5vw, 64px); font-weight: 600; line-height: .98; }
.auth-brand p { max-width: 430px; margin: 20px 0 0; color: #c8c0b5; line-height: 1.7; }
.auth-brand-foot { position: relative; z-index: 1; color: #8f887e; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 6vw, 72px); }
.auth-panel h2 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 42px; font-weight: 700; }
.auth-panel .lead { margin: 8px 0 30px; color: var(--muted); font-size: 13px; }
.auth-switch { margin: 24px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.metric-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,253,248,.72); }
.metric-card span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 6px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 30px; line-height: 1; }

.filter-bar { display: grid; grid-template-columns: 210px minmax(240px, 1fr) auto; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); background: #f7f2e8; }
.table { margin: 0; --bs-table-bg: transparent; }
.table thead th { padding: 15px 18px; border-bottom: 1px solid var(--line); background: #262320; color: #d9ccb8; font-size: 9px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap; }
.table tbody td { padding: 17px 18px; border-color: #e8e0d4; color: #403b35; font-size: 13px; vertical-align: middle; }
.table tbody tr:hover { --bs-table-hover-bg: rgba(169, 139, 85, .065); }
.ticket-id { font-family: "Cormorant Garamond", Georgia, serif; font-size: 19px; font-weight: 700; color: var(--ink); }
.cell-main { color: var(--ink); font-weight: 750; }
.cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

.status-pill, .priority-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 100px; font-size: 10px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-open { background: #f4e6c8; color: #8a5e22; }
.status-done { background: #dceadf; color: #376548; }
.priority-low { background: #ebe8e2; color: #655f58; }
.priority-medium { background: #eee4cf; color: #80612f; }
.priority-high { background: #f1d9cd; color: #964a31; }
.priority-critical { background: #efd2d1; color: #963a38; }

.empty-state { padding: 58px 24px; text-align: center; }
.empty-icon { display: grid; width: 52px; height: 52px; margin: 0 auto 14px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--gold-dark); font-size: 22px; }
.empty-state h3 { margin: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 25px; }
.empty-state p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.guide-card { padding: 26px; border-radius: 18px; background: var(--ink); color: white; }
.guide-card h3 { margin: 0 0 13px; font-family: "Cormorant Garamond", Georgia, serif; font-size: 27px; }
.guide-card p, .guide-card li { color: #bdb6ad; font-size: 12px; line-height: 1.65; }
.guide-card ol { margin: 0; padding-left: 18px; }
.guide-card li + li { margin-top: 9px; }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.detail-item { padding: 22px 25px; background: var(--paper); }
.detail-item.full { grid-column: 1 / -1; }
.detail-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.detail-value { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.65; }
.resolution-box { border-left: 4px solid var(--success); background: #f2f7f2; }

.alert { border: 0; border-radius: 10px; box-shadow: 0 8px 22px rgba(40,33,25,.07); font-size: 13px; }

@media (max-width: 850px) {
  .app-navbar { padding: 12px 0; }
  .app-navbar .container { align-items: flex-start; }
  .nav-actions { flex-wrap: wrap; justify-content: flex-end; }
  .brand-copy { display: none; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 300px; padding: 32px; }
  .auth-brand h1 { font-size: 44px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .form-layout { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .main-shell { width: min(100% - 24px, 1180px); padding-top: 26px; }
  .brand-mark { width: 50px; height: 42px; }
  .user-chip > div { display: none; }
  .nav-actions { gap: 7px; }
  .nav-actions .btn { padding: 8px 10px; font-size: 11px; }
  .auth-panel { padding: 34px 24px; }
  .auth-brand { min-height: 0; padding: 26px 24px; gap: 24px; }
  .auth-logo { width: 130px; max-height: 82px; padding: 7px 10px; }
  .auth-brand h1 { font-size: 36px; line-height: 1; }
  .auth-brand p { margin-top: 13px; line-height: 1.5; }
  .auth-brand-foot { display: none; }
  .metric-row { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.full { grid-column: auto; }
  .surface-body { padding: 23px 19px; }
}
