/* =====================================================================
   Product Media Center — Design System
   ===================================================================== */
:root{
  --navy: #10233d;
  --navy-2: #16304f;
  --ink: #0f172a;
  --ink-soft: #475569;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --gold: #c99a3d;
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e6e9f0;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px -12px rgba(16,24,40,.10);
  --shadow-lg: 0 12px 32px -12px rgba(16,24,40,.22);
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing:antialiased;
}

a{ text-decoration:none; }

/* ---------- Top bar ---------- */
.topbar{
  height:64px;
  background:var(--navy);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
  position:sticky;
  top:0;
  z-index:1030;
  box-shadow:0 2px 10px rgba(0,0,0,.12);
}
.topbar-left, .topbar-right{ display:flex; align-items:center; gap:12px; }
.btn-icon{
  background:transparent; border:none; color:#fff; font-size:1.3rem;
  width:38px; height:38px; border-radius:8px; display:flex; align-items:center; justify-content:center;
}
.btn-icon:hover{ background:rgba(255,255,255,.08); }
.brand{ display:flex; align-items:center; gap:10px; color:#fff; }
.brand-mark{
  width:34px;height:34px;border-radius:9px;
  background:linear-gradient(135deg, var(--gold), #e3bd6a);
  color:var(--navy); display:flex; align-items:center; justify-content:center; font-size:1.05rem;
}
.brand-text{ font-weight:700; letter-spacing:.2px; font-size:1.05rem; }
.branch-pill{
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14);
  padding:6px 12px; border-radius:999px; font-size:.8rem; align-items:center; gap:6px; color:#dbe4f3;
}
.user-chip{
  display:flex; align-items:center; gap:8px; background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14); color:#fff; border-radius:999px; padding:5px 12px 5px 5px;
}
.user-chip .avatar{
  width:26px;height:26px;border-radius:50%; background:var(--gold); color:var(--navy);
  display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.8rem;
}

/* ---------- Shell / Sidebar ---------- */
.app-shell{ display:flex; min-height:calc(100vh - 64px); }
.app-shell.no-sidebar{ min-height:100vh; }
.sidebar{
  width:250px; flex-shrink:0; background:#fff; border-right:1px solid var(--border);
  position:sticky; top:64px; height:calc(100vh - 64px); overflow-y:auto; padding:18px 12px;
}
.sidebar-section{
  font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; color:#94a3b8;
  font-weight:700; padding:14px 12px 6px;
}
.sidebar-link{
  display:flex; align-items:center; gap:11px; color:var(--ink-soft); padding:10px 12px;
  border-radius:var(--radius-sm); font-weight:500; font-size:.92rem; margin-bottom:2px;
}
.sidebar-link i{ font-size:1.05rem; width:20px; text-align:center; color:#94a3b8; }
.sidebar-link:hover{ background:#f1f5fb; color:var(--ink); }
.sidebar-link.active{ background:#eaf1ff; color:var(--accent-2); font-weight:600; }
.sidebar-link.active i{ color:var(--accent-2); }
.sidebar-backdrop{ display:none; }

.app-main{ flex:1; min-width:0; }
.app-content{ padding:24px; max-width:1400px; }

/* ---------- Page header ---------- */
.page-head{ display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:14px; margin-bottom:22px; }
.page-title{ font-size:1.5rem; font-weight:800; color:var(--ink); margin:0; }
.page-sub{ color:var(--ink-soft); font-size:.9rem; margin-top:2px; }

/* ---------- Cards ---------- */
.card{ border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.stat-card{
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  padding:18px 20px; box-shadow:var(--shadow); display:flex; align-items:center; gap:14px;
}
.stat-icon{
  width:46px;height:46px;border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:1.25rem;
  background:#eaf1ff; color:var(--accent-2);
}
.stat-icon.gold{ background:#fbf1de; color:#a97a1f; }
.stat-icon.green{ background:#e8f7ee; color:#1a8f4c; }
.stat-icon.red{ background:#fdecec; color:#c23434; }
.stat-value{ font-size:1.45rem; font-weight:800; line-height:1.1; }
.stat-label{ font-size:.8rem; color:var(--ink-soft); }

/* ---------- Product grid ---------- */
.product-card{
  background:var(--card); border:1px solid var(--border); border-radius:var(--radius);
  overflow:hidden; box-shadow:var(--shadow); transition:transform .15s ease, box-shadow .15s ease;
  height:100%; display:flex; flex-direction:column;
}
.product-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-lg); }
.product-thumb{
  aspect-ratio:4/3; width:100%; object-fit:cover; background:#eef1f6; display:block;
}
.product-thumb-placeholder{
  aspect-ratio:4/3; width:100%; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg,#eef2f8,#e4e9f2); color:#9aa5b6; font-size:2rem;
}
.product-body{ padding:14px 16px 16px; display:flex; flex-direction:column; gap:6px; flex:1; }
.product-code{ font-size:.72rem; font-weight:700; letter-spacing:.04em; color:var(--gold); text-transform:uppercase; }
.product-name{ font-weight:700; font-size:1rem; color:var(--ink); margin:0; }
.product-cat{ font-size:.78rem; color:var(--ink-soft); }
.product-meta{ margin-top:auto; display:flex; justify-content:space-between; align-items:center; font-size:.76rem; color:#94a3b8; padding-top:8px; border-top:1px dashed var(--border); }

/* ---------- Buttons ---------- */
.btn-primary{ background:var(--accent); border-color:var(--accent); }
.btn-primary:hover{ background:var(--accent-2); border-color:var(--accent-2); }
.btn-navy{ background:var(--navy); border-color:var(--navy); color:#fff; }
.btn-navy:hover{ background:var(--navy-2); border-color:var(--navy-2); color:#fff; }
.btn-gold{ background:var(--gold); border-color:var(--gold); color:#fff; }
.btn-gold:hover{ background:#b3872f; border-color:#b3872f; color:#fff; }

/* ---------- Media gallery ---------- */
.media-tile{
  border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; background:#fff;
  box-shadow:var(--shadow); position:relative;
}
.media-tile .thumb-wrap{ aspect-ratio:1/1; overflow:hidden; background:#000; display:flex; align-items:center; justify-content:center; }
.media-tile img, .media-tile video{ width:100%; height:100%; object-fit:cover; }
.media-tile .play-badge{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:46px; height:46px; border-radius:50%; background:rgba(0,0,0,.55); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:1.3rem; pointer-events:none;
}
.media-info{ padding:10px 12px; font-size:.78rem; }
.media-name{ font-weight:600; color:var(--ink); word-break:break-all; }
.media-sub{ color:#94a3b8; }
.media-actions{ display:flex; gap:6px; padding:0 12px 12px; }

/* ---------- Login page ---------- */
.login-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(1200px 700px at 20% -10%, #1a3a63 0%, var(--navy) 45%, var(--ink) 100%);
  padding:20px;
}
.login-card{
  width:100%; max-width:400px; background:#fff; border-radius:18px; padding:36px 32px;
  box-shadow:0 30px 60px -20px rgba(0,0,0,.5);
}
.login-logo{
  width:54px;height:54px;border-radius:14px; margin:0 auto 16px;
  background:linear-gradient(135deg, var(--gold), #e3bd6a); color:var(--navy);
  display:flex; align-items:center; justify-content:center; font-size:1.6rem;
}
.login-title{ text-align:center; font-weight:800; font-size:1.3rem; margin-bottom:2px; }
.login-sub{ text-align:center; color:var(--ink-soft); font-size:.85rem; margin-bottom:26px; }

/* ---------- Tables ---------- */
.table-card{ background:#fff; border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.table > :not(caption) > * > *{ padding:.85rem 1rem; vertical-align:middle; }
.table thead th{ background:#f8fafc; font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:#64748b; border-bottom:1px solid var(--border); }
.badge-role-admin{ background:#fdecec; color:#b3261e; }
.badge-role-employee{ background:#eaf1ff; color:#1d4ed8; }
.badge-status-active{ background:#e8f7ee; color:#1a8f4c; }
.badge-status-inactive{ background:#f1f3f6; color:#64748b; }

/* ---------- Searchable select (category picker etc.) ---------- */
.searchable-select{ position:relative; }
.searchable-select .ss-input{ cursor:text; background:#fff; }
.searchable-select .ss-panel{
  position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:1060;
  background:#fff; border:1px solid var(--border); border-radius:10px;
  max-height:280px; overflow-y:auto; box-shadow:var(--shadow-lg); display:none; padding:4px;
}
.searchable-select.open .ss-panel{ display:block; }
.ss-option{ padding:8px 12px; cursor:pointer; font-size:.88rem; border-radius:7px; color:var(--ink); }
.ss-option:hover, .ss-option.ss-active{ background:#eef4ff; color:var(--accent-2); }
.ss-option.ss-selected{ font-weight:600; }
.ss-empty{ padding:10px 12px; color:#94a3b8; font-size:.85rem; }

/* ---------- Misc ---------- */
.section-label{ font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:#94a3b8; margin-bottom:10px; }
.empty-state{ text-align:center; padding:60px 20px; color:#94a3b8; }
.empty-state i{ font-size:2.6rem; margin-bottom:12px; display:block; }
.dropzone{
  border:2px dashed #c7d2e0; border-radius:var(--radius-sm); padding:26px; text-align:center; color:var(--ink-soft);
  background:#f8fafc; cursor:pointer; transition:.15s;
}
.dropzone.dragover{ border-color:var(--accent); background:#eef4ff; color:var(--accent-2); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px){
  .sidebar{
    position:fixed; left:0; top:64px; z-index:1040; transform:translateX(-100%);
    transition:transform .2s ease; box-shadow:0 10px 30px rgba(0,0,0,.2);
  }
  .sidebar.open{ transform:translateX(0); }
  .sidebar-backdrop{
    display:none; position:fixed; inset:64px 0 0 0; background:rgba(15,23,42,.35); z-index:1035;
  }
  .sidebar-backdrop.show{ display:block; }
  .app-content{ padding:16px; }
}
@media (max-width: 575.98px){
  .login-card{ padding:28px 20px; }
}
