:root {
  --ame: #215159;
  --ame-deep: #0d2f34;
  --ame-ink: #0b2226;
  --gold: #d4aa45;
  --gold-soft: #f2dfaa;
  --bg: #f2f6f5;
  --card: #ffffff;
  --text: #13292c;
  --muted: #748486;
  --border: #dfe8e6;
  --danger: #ba3b3b;
  --success: #18765e;
  --warning: #a96f0b;
  --shadow: 0 20px 50px rgba(18, 55, 60, .09);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: Montserrat, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 92% -10%, rgba(212,170,69,.16), transparent 30rem),
    linear-gradient(180deg, #f8fbfa 0, var(--bg) 38rem);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 264px; padding: 28px 20px;
  background: linear-gradient(170deg, #133e44 0%, #0b272b 74%);
  color: #fff; z-index: 40; display: flex; flex-direction: column;
  box-shadow: 18px 0 50px rgba(11,39,43,.14);
}
.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 34px; }

.brand-image { width: 182px; height: 46px; object-fit: contain; object-position: left center; }
.brand-image-login { width: 210px; height: 52px; }
.footer-dream { display:inline-flex; align-items:center; gap:7px; }
.footer-dream img { width:92px; height:18px; object-fit:contain; }

.brand-badge {
  width: 46px; height: 46px; border: 1px solid rgba(212,170,69,.62); border-radius: 15px;
  display: grid; place-items: center; color: var(--gold-soft); font-weight: 800; letter-spacing: -.05em;
  background: linear-gradient(145deg, rgba(255,255,255,.08), rgba(212,170,69,.07));
}
.brand-copy strong { display: block; font-size: 15px; letter-spacing: .04em; }
.brand-copy span { display: block; font-size: 11px; color: rgba(255,255,255,.56); margin-top: 3px; }
.nav-section { margin-top: 6px; }
.nav-label { color: rgba(255,255,255,.35); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; margin: 20px 12px 9px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 13px; border-radius: 14px;
  color: rgba(255,255,255,.72); margin: 4px 0; font-weight: 650; font-size: 14px;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(212,170,69,.13); color: #fff; box-shadow: inset 0 0 0 1px rgba(212,170,69,.22); }
.nav-icon { width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.06); display:grid;place-items:center; font-size: 12px; }
.sidebar-foot { margin-top: auto; padding: 16px 12px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: rgba(255,255,255,.42); line-height: 1.65; }
.sidebar-foot strong { color: rgba(255,255,255,.72); }

.main { margin-left: 264px; min-height: 100vh; display:flex; flex-direction:column; }
.topbar {
  min-height: 84px; display:flex; align-items:center; justify-content:space-between; gap: 18px;
  padding: 18px 34px; position: sticky; top:0; z-index:30; backdrop-filter: blur(18px);
  background: rgba(248,251,250,.79); border-bottom: 1px solid rgba(223,232,230,.7);
}
.eyebrow { text-transform: uppercase; color: var(--gold); font-weight: 850; letter-spacing: .13em; font-size: 10px; }
.page-title { margin: 4px 0 0; font-size: clamp(23px, 3vw, 32px); letter-spacing: -.04em; }
.top-actions { display:flex; gap:10px; align-items:center; flex-wrap: wrap; justify-content:flex-end; }
.content { width:100%; max-width: 1500px; margin:0 auto; padding: 30px 34px 52px; flex:1; }
.page-footer { padding: 20px 34px 28px; color: var(--muted); font-size: 12px; display:flex; justify-content:space-between; gap:16px; border-top:1px solid var(--border); }
.page-footer .dream { color: var(--ame); font-weight: 800; }

.btn {
  border: 0; min-height: 44px; padding: 0 17px; border-radius: 13px; display:inline-flex; align-items:center; justify-content:center;
  gap:9px; font-weight: 780; font-size: 13px; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color:#fff; background: linear-gradient(135deg, #285f66, #123d43); box-shadow: 0 10px 24px rgba(33,81,89,.21); }
.btn-gold { color:#2b2517; background: linear-gradient(135deg, #ebc969, #d4aa45); box-shadow: 0 10px 24px rgba(212,170,69,.22); }
.btn-soft { color:var(--ame-deep); background:#e7efed; }
.btn-ghost { color:var(--ame); background:#fff; border:1px solid var(--border); }
.btn-danger { color:#fff; background:var(--danger); }
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: 11px; font-size:12px; }
.btn-wide { width:100%; }

.grid { display:grid; gap:18px; }
.grid-4 { grid-template-columns: repeat(4,minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.card {
  background: rgba(255,255,255,.92); border:1px solid rgba(220,230,228,.9); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow:hidden;
}
.card-pad { padding:22px; }
.kpi { position:relative; min-height:142px; }
.kpi::after { content:""; position:absolute; width:72px; height:72px; border-radius:50%; right:-23px; top:-20px; background:rgba(212,170,69,.11); }
.kpi-label { color: var(--muted); font-size: 12px; font-weight:700; }
.kpi-value { font-size: 34px; font-weight: 850; letter-spacing:-.05em; margin-top:10px; }
.kpi-sub { color:var(--muted); font-size:12px; margin-top:8px; }

.rank-card { min-height: 190px; padding:22px; position:relative; overflow:hidden; }
.rank-card.gold { background: linear-gradient(140deg, #1b4b52 0%, #0c2f34 100%); color:#fff; border-color:transparent; }
.rank-card.gold::after { content:""; position:absolute; width:170px;height:170px;border-radius:50%;right:-65px;bottom:-75px;background:rgba(212,170,69,.13); }
.rank-badge { display:inline-flex; gap:7px; align-items:center; padding:7px 10px; border-radius:999px; background:rgba(212,170,69,.16); color:var(--gold-soft); font-size:10px; font-weight:850; text-transform:uppercase; letter-spacing:.1em; }
.rank-name { font-size:22px; font-weight:850; letter-spacing:-.035em; margin:20px 0 5px; }
.rank-meta { opacity:.65; font-size:12px; }
.rank-value { font-size:30px; font-weight:900; color:var(--gold-soft); margin-top:16px; letter-spacing:-.04em; }
.rank-desc { font-size:11px; opacity:.66; }

.section-head { display:flex; justify-content:space-between; align-items:flex-end; gap:16px; margin: 30px 0 13px; }
.section-head h2 { margin:0; font-size:19px; letter-spacing:-.03em; }
.section-head p { margin:5px 0 0; color:var(--muted); font-size:12px; }

.table-card { overflow:auto; }
table { width:100%; border-collapse:collapse; min-width:760px; }
th { text-align:left; padding:14px 18px; font-size:10px; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); background:#f7f9f9; }
td { padding:16px 18px; border-top:1px solid #edf1f0; font-size:13px; vertical-align:middle; }
tr:hover td { background:#fbfdfc; }
.table-title { font-weight:800; }
.table-sub { color:var(--muted); font-size:11px; margin-top:3px; }
.number { font-variant-numeric: tabular-nums; font-weight:750; }

.status { display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border-radius:999px; font-size:11px; font-weight:800; background:#eef2f1; color:#536160; }
.status::before { content:""; width:7px;height:7px;border-radius:50%;background:currentColor;opacity:.72; }
.status-available { background:#e4f3ee; color:#18765e; }
.status-limited { background:#fff2d8; color:#a96f0b; }
.status-sold_out { background:#f7e5e5; color:#aa3434; }
.status-error { background:#faeaea; color:#ba3b3b; }

.flash { border-radius:16px; padding:14px 17px; margin-bottom:18px; border:1px solid; font-size:13px; font-weight:650; }
.flash-success { background:#e8f5f0; border-color:#c5e8dc; color:#176650; }
.flash-error { background:#fff0f0; border-color:#f0caca; color:#a63535; }

.form-card { max-width:1000px; }
.form-section { padding:24px; border-bottom:1px solid var(--border); }
.form-section:last-child { border-bottom:0; }
.form-section h3 { margin:0 0 6px; font-size:16px; }
.form-section > p { margin:0 0 19px; color:var(--muted); font-size:12px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.field { display:flex; flex-direction:column; gap:7px; }
.field.full { grid-column:1/-1; }
label { font-size:11px; font-weight:800; color:#425657; }
input, select, textarea {
  width:100%; border:1px solid #d9e3e1; background:#fbfdfc; color:var(--text); border-radius:13px;
  min-height:46px; padding:11px 13px; outline:none; transition:border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height:110px; resize:vertical; }
input:focus, select:focus, textarea:focus { border-color:#76a2a7; background:#fff; box-shadow:0 0 0 4px rgba(33,81,89,.08); }
.help { color:var(--muted); font-size:10px; line-height:1.55; }
.form-error { background:#fff0f0; color:#a63535; border:1px solid #f0caca; padding:12px 14px; border-radius:13px; font-size:12px; margin-bottom:16px; }

.category-builder { display:grid; gap:10px; }
.category-row { display:grid; grid-template-columns:1.4fr .75fr .75fr auto; gap:9px; align-items:end; padding:12px; border:1px solid var(--border); border-radius:15px; background:#f8faf9; }
.category-row .field { gap:5px; }
.category-row button { width:42px; height:42px; border:0;border-radius:12px;background:#f1e6e6;color:#a13b3b;font-weight:900; }

.artist-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.artist-card { padding:20px; transition:transform .16s ease, box-shadow .16s ease; }
.artist-card:hover { transform:translateY(-3px); box-shadow:0 24px 60px rgba(18,55,60,.13); }
.artist-avatar { width:48px;height:48px;border-radius:16px;background:linear-gradient(145deg,#1b535a,#0e3136);color:var(--gold-soft);display:grid;place-items:center;font-weight:900;margin-bottom:18px; }
.artist-name { font-size:18px;font-weight:850;letter-spacing:-.03em; }
.artist-meta { color:var(--muted);font-size:11px;margin-top:5px; }
.artist-stats { display:flex;gap:18px;margin-top:17px;padding-top:15px;border-top:1px solid var(--border);font-size:11px;color:var(--muted); }
.artist-stats strong { display:block;color:var(--text);font-size:15px; }

.hero-detail { background:linear-gradient(145deg,#174950,#0a2b30); color:#fff; padding:26px; border-radius:26px; position:relative; overflow:hidden; }
.hero-detail::after { content:""; position:absolute;width:250px;height:250px;border-radius:50%;right:-85px;top:-105px;background:rgba(212,170,69,.12); }
.hero-detail h2 { margin:7px 0 6px;font-size:clamp(25px,4vw,37px);letter-spacing:-.05em; }
.hero-detail .meta { display:flex;gap:10px;flex-wrap:wrap;color:rgba(255,255,255,.68);font-size:12px; }
.hero-actions { display:flex;gap:10px;flex-wrap:wrap;margin-top:22px;position:relative;z-index:2; }
.hero-actions .btn-ghost { background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.15);color:#fff; }

.metric-strip { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:18px; }
.metric-mini { background:#fff;border:1px solid var(--border);border-radius:17px;padding:16px; }
.metric-mini span { color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:800; }
.metric-mini strong { display:block;font-size:23px;margin-top:7px;letter-spacing:-.04em; }
.metric-mini small { color:var(--muted);font-size:10px; }

.category-cards { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px; }
.category-card { padding:17px;border:1px solid var(--border);border-radius:18px;background:#fff; }
.category-card-head { display:flex;justify-content:space-between;gap:10px;align-items:start; }
.category-card h4 { margin:0;font-size:15px; }
.price { color:var(--ame);font-weight:850; }
.category-stats { display:grid;grid-template-columns:repeat(2,1fr);gap:9px;margin-top:15px; }
.category-stat { background:#f5f8f7;border-radius:12px;padding:10px; }
.category-stat span { display:block;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.07em; }
.category-stat strong { display:block;margin-top:4px;font-size:15px; }

.progress-track { height:8px;border-radius:999px;background:#e6ecea;overflow:hidden; }
.progress-bar { height:100%;background:linear-gradient(90deg,var(--ame),var(--gold));border-radius:999px; }

.chart { display:flex;align-items:end;gap:5px;height:140px;padding:12px 4px 0;overflow:hidden; }
.chart-bar { flex:1;min-width:6px;max-width:24px;background:linear-gradient(180deg,var(--gold),var(--ame));border-radius:8px 8px 3px 3px;opacity:.78; }
.chart-empty { color:var(--muted);font-size:12px;padding:40px 0;text-align:center; }

.update-overlay { position:fixed;inset:0;background:rgba(7,25,28,.67);backdrop-filter:blur(8px);z-index:100;display:none;align-items:center;justify-content:center;padding:20px; }
.update-overlay.open { display:flex; }
.update-modal { width:min(520px,100%);background:#fff;border-radius:28px;padding:27px;box-shadow:0 40px 100px rgba(0,0,0,.24);text-align:center; }
.update-ring { width:84px;height:84px;margin:0 auto 18px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--gold) 0 72%,#e7eceb 72%);position:relative; }
.update-ring::after { content:"";position:absolute;inset:8px;border-radius:50%;background:#fff; }
.update-ring strong { position:relative;z-index:1;font-size:22px;color:var(--ame-deep); }
.update-modal h3 { margin:4px 0;font-size:22px; }
.update-message { color:var(--muted);font-size:12px;min-height:20px;margin:8px 0 18px; }
.update-progress { height:8px;background:#edf1f0;border-radius:999px;overflow:hidden; }
.update-progress span { display:block;height:100%;width:12%;background:linear-gradient(90deg,var(--ame),var(--gold));border-radius:999px;transition:width .35s; }
.update-error { color:var(--danger);font-size:12px;margin-top:12px; }

.empty { text-align:center;padding:54px 24px; }
.empty-badge { width:58px;height:58px;border-radius:19px;background:#e5eeec;color:var(--ame);display:grid;place-items:center;margin:0 auto 15px;font-weight:900; }
.empty h3 { margin:0 0 6px; }
.empty p { color:var(--muted);font-size:12px;max-width:420px;margin:0 auto 17px; }

.login-page { min-height:100vh;display:grid;grid-template-columns:1.1fr .9fr;background:#0c2e33; }
.login-visual { padding:56px;display:flex;flex-direction:column;justify-content:space-between;color:#fff;position:relative;overflow:hidden;background:radial-gradient(circle at 22% 18%,rgba(212,170,69,.2),transparent 24rem),linear-gradient(150deg,#174950,#09262b); }
.login-visual::after { content:"";position:absolute;width:500px;height:500px;border-radius:50%;right:-220px;bottom:-240px;border:1px solid rgba(212,170,69,.28);box-shadow:0 0 0 70px rgba(212,170,69,.03),0 0 0 140px rgba(212,170,69,.025); }
.login-visual h1 { font-size:clamp(42px,6vw,76px);letter-spacing:-.065em;line-height:.98;max-width:680px;margin:0; }
.login-visual h1 span { color:var(--gold-soft); }
.login-visual p { max-width:530px;color:rgba(255,255,255,.62);line-height:1.7;font-size:14px; }
.login-panel { background:#f7faf9;display:grid;place-items:center;padding:30px; }
.login-card { width:min(430px,100%); }
.login-card h2 { font-size:31px;letter-spacing:-.05em;margin:0 0 7px; }
.login-card > p { color:var(--muted);font-size:13px;margin:0 0 24px; }
.login-credit { margin-top:28px;color:var(--muted);font-size:11px;text-align:center; }
.login-credit strong { color:var(--ame); }

.mobile-nav { display:none; }
.mobile-only { display:none; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .grid-3, .artist-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .metric-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .category-cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  body { padding-bottom:74px; }
  .sidebar { display:none; }
  .main { margin-left:0; }
  .topbar { min-height:72px;padding:13px 16px; }
  .topbar .page-title { font-size:22px; }
  .content { padding:18px 14px 30px; }
  .page-footer { padding:20px 16px 26px;flex-direction:column;align-items:center;text-align:center; }
  .mobile-nav { display:grid;grid-template-columns:repeat(4,1fr);position:fixed;left:10px;right:10px;bottom:9px;height:62px;background:rgba(13,47,52,.96);backdrop-filter:blur(16px);border-radius:19px;z-index:80;box-shadow:0 18px 50px rgba(13,47,52,.26);padding:6px; }
  .mobile-nav a { color:rgba(255,255,255,.57);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:3px;border-radius:13px;font-size:9px;font-weight:750; }
  .mobile-nav a.active { background:rgba(212,170,69,.14);color:#fff; }
  .mobile-nav b { font-size:14px;line-height:1; }
  .desktop-only { display:none!important; }
  .mobile-only { display:initial; }
  .grid-4, .grid-3, .grid-2, .artist-grid, .category-cards { grid-template-columns:1fr; }
  .form-grid { grid-template-columns:1fr; }
  .field.full { grid-column:auto; }
  .category-row { grid-template-columns:1fr 1fr; }
  .category-row .field:first-child { grid-column:1/-1; }
  .category-row button { align-self:end; }
  .hero-detail { padding:21px;border-radius:22px; }
  .metric-strip { grid-template-columns:1fr 1fr; }
  .section-head { align-items:center; }
  .table-card { margin-left:-14px;margin-right:-14px;border-radius:0;border-left:0;border-right:0;box-shadow:none; }
  .login-page { grid-template-columns:1fr;min-height:100dvh;background:#f7faf9; }
  .login-visual { min-height:260px;padding:28px 22px; }
  .login-visual h1 { font-size:42px; }
  .login-visual p { display:none; }
  .login-panel { padding:28px 20px 42px;align-items:start; }
  .top-actions .btn { min-height:42px;padding:0 13px; }
}

@media (max-width: 520px) {
  .grid-4 { grid-template-columns:1fr 1fr; gap:10px; }
  .kpi { min-height:125px; }
  .kpi-value { font-size:27px; }
  .card-pad, .rank-card { padding:17px; }
  .metric-strip { grid-template-columns:1fr 1fr;gap:9px; }
  .metric-mini { padding:13px; }
  .metric-mini strong { font-size:19px; }
  .top-actions .btn-soft { display:none; }
  .category-row { grid-template-columns:1fr; }
  .category-row .field:first-child { grid-column:auto; }
}
.category-manage { margin-top:14px; padding-top:12px; border-top:1px solid var(--border); }
.category-manage summary { cursor:pointer; color:var(--ame); font-size:11px; font-weight:850; }
.category-edit-form { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.category-edit-form .field:first-of-type { grid-column:1/-1; }
.category-edit-form .btn { grid-column:1/-1; }
@media (max-width: 520px) { .category-edit-form { grid-template-columns:1fr; } .category-edit-form .field:first-of-type, .category-edit-form .btn { grid-column:auto; } }

/* Final brand integrations */
.user-pill { min-height:38px; padding:0 12px; border:1px solid var(--border); background:#fff; border-radius:999px; display:inline-flex; align-items:center; gap:8px; font-size:12px; font-weight:800; color:var(--ame-deep); }
.user-dot { width:8px; height:8px; border-radius:50%; background:var(--gold); box-shadow:0 0 0 4px rgba(212,170,69,.14); }
.login-credit { display:flex; justify-content:center; align-items:center; gap:8px; }
.login-credit img { width:108px; max-height:28px; object-fit:contain; }
.settings-dream { display:flex; align-items:center; gap:9px; font-size:12px; color:var(--muted); }
.settings-dream img { width:145px; max-height:38px; object-fit:contain; }
@media (max-width:820px) {
  .brand-image-login { width:190px; height:48px; }
  .login-credit img { width:96px; }
}
