/* ─── CNC-Voss Design System ─────────────────────────────── */
:root {
  --primary:   #1B3A5C;
  --primary-l: #254d7a;
  --gold:      #E8A838;
  --gold-l:    #f0bc5a;
  --success:   #2E7D52;
  --danger:    #D94F4F;
  --warn:      #E8A838;
  --bg:        #f0f2f5;
  --card:      #ffffff;
  --text:      #1A1A2E;
  --sub:       #6B7280;
  --border:    #e5e7eb;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ─── Layout ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo .brand {
  font-size: 18px;
  font-weight: 800;
  color: white;
  letter-spacing: .5px;
}
.sidebar-logo .sub {
  font-size: 11px;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 2px;
}
.sidebar-logo .user-info {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
}
.sidebar-logo .user-name {
  font-size: 13px;
  font-weight: 700;
  color: white;
}
.sidebar-logo .user-role {
  font-size: 11px;
  color: var(--gold);
  margin-top: 2px;
}

nav { flex: 1; padding: 12px 0; overflow-y: auto; }

.nav-section {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 14px 20px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: white; }
.nav-item.active {
  background: rgba(232,168,56,.15);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 700;
}
.nav-item .ni { font-size: 16px; width: 20px; text-align: center; }

.nav-sep { height: 1px; background: rgba(255,255,255,.1); margin: 8px 16px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.logout-link {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logout-link:hover { color: var(--danger); }

.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar h2 { font-size: 20px; font-weight: 800; color: var(--primary); }
.topbar .ts { font-size: 12px; color: var(--sub); }

.content { padding: 28px; flex: 1; }

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  color: var(--primary);
}

/* ─── Stats Grid ─────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 18px 16px;
  text-align: center;
}
.stat-card .ico { font-size: 24px; margin-bottom: 6px; }
.stat-card .val { font-size: 32px; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: 12px; color: var(--sub); margin-top: 2px; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
}
.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-l); }
.btn-gold      { background: var(--gold); color: var(--primary); }
.btn-gold:hover { background: var(--gold-l); }
.btn-outline   { background: transparent; color: var(--primary); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); }
.btn-danger    { background: var(--danger); color: white; }
.btn-warn      { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.btn-success   { background: var(--success); color: white; }
.btn-sm        { padding: 5px 10px; font-size: 12px; }

/* ─── Tables ─────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: #f8fafc; }
th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 700;
     color: var(--sub); letter-spacing: .5px; text-transform: uppercase;
     border-bottom: 1px solid var(--border); }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f9fafb; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge-ok   { background: #d1fae5; color: #065f46; }
.badge-err  { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ─── Forms ─────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; font-weight: 600;
                    color: var(--sub); margin-bottom: 5px; }
.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border .15s;
}
.form-control:focus { border-color: var(--primary); }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warn    { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── Login Page ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .brand {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}
.login-logo .brand span { color: var(--gold); }
.login-logo .sub {
  font-size: 13px;
  color: var(--sub);
  margin-top: 4px;
}

/* ─── Product Cards ──────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.product-card {
  background: white;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  transition: all .2s;
  display: block;
}
.product-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.product-card .pc-icon { font-size: 36px; margin-bottom: 12px; }
.product-card .pc-name { font-size: 16px; font-weight: 800; color: var(--primary); }
.product-card .pc-desc { font-size: 12px; color: var(--sub); margin-top: 4px; }
.product-card .pc-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #d1fae5;
  color: #065f46;
}
.product-card .pc-badge.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

/* ─── Empty State ────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--sub);
}
.empty .ico { font-size: 48px; margin-bottom: 12px; }

/* ─── Gold Accent ────────────────────────────────────────── */
.gold-line {
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-l));
  border-radius: 2px;
  margin-bottom: 20px;
}

/* ─── Admin Badge ────────────────────────────────────────── */
.admin-badge {
  background: var(--gold);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: .5px;
}

@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main { margin-left: 200px; }
  .content { padding: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
