/* ==========================================================================
   Selcom Brand Hub — Stylesheet
   Design language: "control room for the brand" — a calm, dark utility
   shell with a bright signal-orange accent used sparingly, so the assets
   and guideline colors displayed *inside* the app are what stand out, not
   the chrome around them.

   NOTE ON COLOR: --brand-accent is a placeholder (#FF5A1F). Swap it for
   Selcom's real primary hex the moment you have it — it is the only color
   referenced by name below and touches nothing structural.
   ========================================================================== */

:root {
  /* Palette */
  --ink-900: #0E1116;
  --ink-800: #161B22;
  --ink-700: #1F2530;
  --ink-600: #2B3240;
  --line: #2A3140;
  --paper: #F6F7F9;
  --paper-raised: #FFFFFF;
  --text-900: #12151B;
  --text-600: #565E6C;
  --text-400: #8A93A3;
  --brand-accent: #FF5A1F;      /* <-- replace with Selcom primary */
  --brand-accent-ink: #7A2A0C;
  --ok: #1C9A6C;
  --warn: #D68A00;

  /* Type */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  /* Metrics */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --sidebar-w: 248px;
  --shadow-card: 0 1px 2px rgba(16, 20, 28, 0.06), 0 8px 24px -12px rgba(16, 20, 28, 0.12);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--text-900);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--ink-900);
  color: #C9CFDA;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 22px;
  color: #fff;
}
.sidebar__mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--brand-accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff;
  flex-shrink: 0;
}
.sidebar__brand strong { font-size: 15px; letter-spacing: -0.01em; }
.sidebar__brand span { display: block; font-size: 11px; color: #7C879B; }

.nav-group { margin-bottom: 18px; }
.nav-group__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: #5C6577; padding: 0 10px 8px; font-weight: 600;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; color: #C9CFDA;
  margin-bottom: 2px; transition: background .12s, color .12s;
}
.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-link:hover { background: var(--ink-700); color: #fff; }
.nav-link.is-active { background: var(--ink-700); color: #fff; }
.nav-link.is-active svg { color: var(--brand-accent); }
.nav-link .count {
  margin-left: auto; font-size: 11px; color: #6B7386;
  background: var(--ink-700); padding: 1px 7px; border-radius: 20px;
}

.sidebar__footer {
  margin-top: auto; padding-top: 14px; border-top: 1px solid var(--ink-700);
  display: flex; align-items: center; gap: 10px;
}
.sidebar__avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--ink-700);
  object-fit: cover; flex-shrink: 0;
}
.sidebar__user { flex: 1; min-width: 0; }
.sidebar__user strong { display: block; font-size: 12.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user span { font-size: 11px; color: #6B7386; }
.icon-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: #8A93A3; flex-shrink: 0;
}
.icon-btn:hover { background: var(--ink-700); color: #fff; }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- Main column ---------- */
.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: rgba(246,247,249,0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid #E7E9EE;
  padding: 16px 32px;
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
}
.topbar h1 { font-size: 19px; margin: 0; letter-spacing: -0.01em; }
.topbar p { margin: 2px 0 0; font-size: 13px; color: var(--text-600); }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #E1E4EA; border-radius: 10px;
  padding: 8px 12px; min-width: 260px;
}
.search-box svg { width: 16px; height: 16px; color: var(--text-400); flex-shrink: 0; }
.search-box input { border: none; outline: none; font-size: 13.5px; width: 100%; background: transparent; }

.content { padding: 28px 32px 60px; max-width: 1280px; }

/* ---------- Category chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: #fff; border: 1px solid #E1E4EA; color: var(--text-600);
}
.chip svg { width: 14px; height: 14px; }
.chip.is-active { background: var(--ink-900); color: #fff; border-color: var(--ink-900); }

/* ---------- Asset grid ---------- */
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.asset-card {
  background: var(--paper-raised); border: 1px solid #E7E9EE; border-radius: var(--radius-lg);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .15s, transform .15s;
}
.asset-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); }
.asset-card__preview {
  aspect-ratio: 4/3; background: linear-gradient(135deg, #F1F2F5, #E7E9EE);
  display: flex; align-items: center; justify-content: center; color: #B7BDC9;
  position: relative;
}
.asset-card__preview svg { width: 34px; height: 34px; }
.asset-card__ext {
  position: absolute; top: 10px; left: 10px;
  background: var(--ink-900); color: #fff; font-family: var(--font-mono);
  font-size: 10px; font-weight: 600; letter-spacing: 0.03em;
  padding: 3px 7px; border-radius: 5px; text-transform: uppercase;
}
.asset-card__body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.asset-card__body h3 { font-size: 14px; margin: 0; letter-spacing: -0.01em; }
.asset-card__body p { font-size: 12.5px; color: var(--text-600); margin: 0; line-height: 1.4; }
.asset-card__meta {
  margin-top: auto; padding-top: 10px; display: flex; align-items: center;
  justify-content: space-between; font-size: 11.5px; color: var(--text-400); font-family: var(--font-mono);
}
.btn-download {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--ink-900); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 9px 12px; font-size: 12.5px; font-weight: 600; margin-top: 10px; width: 100%;
  transition: background .12s;
}
.btn-download svg { width: 14px; height: 14px; }
.btn-download:hover { background: var(--brand-accent); }

.empty-state {
  text-align: center; padding: 70px 20px; color: var(--text-400);
}
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: .6; }
.empty-state p { font-size: 13.5px; }

/* ---------- Login page ---------- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--ink-900); color: #fff; padding: 24px;
  background-image: radial-gradient(circle at 15% 20%, rgba(255,90,31,0.14), transparent 40%),
                     radial-gradient(circle at 85% 80%, rgba(255,90,31,0.10), transparent 40%);
}
.login-card {
  background: var(--ink-800); border: 1px solid var(--ink-700); border-radius: var(--radius-lg);
  padding: 40px 36px; width: 100%; max-width: 380px; text-align: center;
}
.login-card .sidebar__mark { margin: 0 auto 18px; width: 44px; height: 44px; font-size: 18px; border-radius: 12px; }
.login-card h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: -0.01em; }
.login-card p { font-size: 13.5px; color: #8A93A3; margin: 0 0 26px; line-height: 1.5; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1F2530; border-radius: 10px; padding: 12px 16px;
  font-size: 14px; font-weight: 600; width: 100%; border: none;
}
.btn-google:hover { background: #F1F2F5; }
.login-note { margin-top: 20px; font-size: 11.5px; color: #5C6577; }
.login-error {
  background: rgba(214, 60, 20, 0.15); border: 1px solid rgba(214,60,20,0.35);
  color: #FF9166; font-size: 12.5px; border-radius: 8px; padding: 10px 12px; margin-bottom: 18px; text-align: left;
}

/* ---------- Guidelines page ---------- */
.guide-hero {
  background: var(--ink-900); color: #fff; border-radius: var(--radius-lg);
  padding: 42px 36px; margin-bottom: 30px; position: relative; overflow: hidden;
}
.guide-hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(255,90,31,0.25), transparent 55%);
}
.guide-hero h1 { position: relative; font-size: 28px; margin: 0 0 8px; letter-spacing: -0.02em; }
.guide-hero p { position: relative; color: #A6AEBD; max-width: 520px; font-size: 14px; line-height: 1.55; margin: 0; }

.guide-section { margin-bottom: 34px; }
.guide-section__head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.guide-section__head .eyebrow { font-family: var(--font-mono); font-size: 11px; color: var(--brand-accent); font-weight: 600; }
.guide-section__head h2 { font-size: 18px; margin: 0; letter-spacing: -0.01em; }

.swatch-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.swatch { border-radius: var(--radius-md); overflow: hidden; border: 1px solid #E7E9EE; background: #fff; }
.swatch__color { height: 80px; }
.swatch__meta { padding: 10px 12px; }
.swatch__meta strong { display: block; font-size: 12.5px; }
.swatch__meta span { font-family: var(--font-mono); font-size: 11px; color: var(--text-600); }

.type-sample { background: #fff; border: 1px solid #E7E9EE; border-radius: var(--radius-md); padding: 22px 24px; margin-bottom: 12px; }
.type-sample .label { font-size: 11px; color: var(--text-400); font-family: var(--font-mono); margin-bottom: 8px; }

.dos-donts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dos-donts .card { border-radius: var(--radius-md); padding: 18px 20px; }
.dos-donts .do { background: #EAF7F1; border: 1px solid #CDEBDD; }
.dos-donts .dont { background: #FCEEEA; border: 1px solid #F4D3C7; }
.dos-donts h4 { margin: 0 0 8px; font-size: 13px; }
.dos-donts .do h4 { color: var(--ok); }
.dos-donts .dont h4 { color: #C4441F; }
.dos-donts ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-600); line-height: 1.7; }

/* ---------- Tables (logs / admin) ---------- */
.panel { background: #fff; border: 1px solid #E7E9EE; border-radius: var(--radius-lg); overflow: hidden; }
.panel__head { padding: 16px 20px; border-bottom: 1px solid #E7E9EE; display: flex; justify-content: space-between; align-items: center; }
.panel__head h2 { font-size: 15px; margin: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 10px 20px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-400); border-bottom: 1px solid #E7E9EE; font-weight: 600;
}
table.data td { padding: 12px 20px; border-bottom: 1px solid #F0F1F4; color: var(--text-900); }
table.data tr:last-child td { border-bottom: none; }
table.data .mono { font-family: var(--font-mono); font-size: 12px; color: var(--text-600); }
.tag { display: inline-flex; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.tag.admin { background: #FDE9E0; color: var(--brand-accent-ink); }
.tag.staff { background: #EDEFF3; color: var(--text-600); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid #E7E9EE; border-radius: var(--radius-md); padding: 16px 18px; }
.stat-card .num { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stat-card .lbl { font-size: 12px; color: var(--text-600); margin-top: 2px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 14px; max-width: 480px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #DDE0E6; border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; background: #fff;
}
.field textarea { resize: vertical; min-height: 70px; }
.btn-primary {
  background: var(--ink-900); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 13.5px; font-weight: 600;
}
.btn-primary:hover { background: var(--brand-accent); }
.btn-ghost { background: transparent; border: 1px solid #DDE0E6; border-radius: var(--radius-sm); padding: 10px 18px; font-size: 13.5px; font-weight: 600; color: var(--text-600); }
.flash { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.flash.ok { background: #EAF7F1; color: #147A54; border: 1px solid #CDEBDD; }
.flash.err { background: #FCEEEA; color: #C4441F; border: 1px solid #F4D3C7; }

/* ---------- Public shell (no login required) ---------- */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; }
.public-nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--ink-900); color: #fff;
  padding: 14px 32px;
  display: flex; align-items: center; gap: 28px;
}
.public-nav__brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.public-nav__brand strong { font-size: 15px; letter-spacing: -0.01em; }
.public-nav__brand span { display: block; font-size: 11px; color: #7C879B; }
.public-nav__links { display: flex; align-items: center; gap: 4px; }
.public-nav__links a {
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500;
  color: #C9CFDA; transition: background .12s, color .12s;
}
.public-nav__links a:hover { background: var(--ink-700); color: #fff; }
.public-nav__links a.is-active { background: var(--ink-700); color: #fff; }
.public-nav__admin {
  font-size: 12.5px; font-weight: 600; color: #8A93A3; padding: 7px 12px;
  border: 1px solid var(--ink-700); border-radius: 999px; display: flex; align-items: center; gap: 6px;
}
.public-nav__admin:hover { color: #fff; border-color: #3A4356; }
.public-nav__admin svg { width: 13px; height: 13px; }
.public-nav__toggle { display: none; background: none; border: none; color: #fff; font-size: 20px; }

.public-main .content { max-width: 1240px; margin: 0 auto; padding: 32px 32px 60px; }
.public-topbar {
  border-bottom: 1px solid #E7E9EE; padding: 22px 32px;
}
.public-topbar__inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

.public-footer {
  margin-top: auto; border-top: 1px solid #E7E9EE; background: #fff;
  padding: 18px 32px; display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-400); flex-wrap: wrap; gap: 8px;
}
.public-footer a { color: var(--text-600); font-weight: 500; }
.public-footer a:hover { color: var(--brand-accent); }

@media (max-width: 900px) {
  .public-nav { padding: 12px 18px; flex-wrap: wrap; }
  .public-nav__links { order: 3; width: 100%; padding-top: 8px; border-top: 1px solid var(--ink-700); margin-top: 8px; display: none; }
  .public-nav__links.is-open { display: flex; flex-wrap: wrap; }
  .public-nav__toggle { display: block; }
  .public-topbar { padding: 16px 18px; }
  .public-main .content { padding: 20px 18px 50px; }
}

/* ---------- Mobile ---------- */
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 30% 0 0; z-index: 30; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 20px 0 40px rgba(0,0,0,0.3);
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: var(--radius-sm); background: #fff; border: 1px solid #E1E4EA;
  }
  .topbar { padding: 14px 18px; flex-wrap: wrap; }
  .search-box { min-width: 0; flex: 1; order: 3; width: 100%; }
  .content { padding: 20px 18px 50px; }
  .dos-donts { grid-template-columns: 1fr; }
}
