/* ═══════════════════════════════════════════════════════
   AMBACO — SUPER ADMIN SHARED STYLES
   Usage: <link rel="stylesheet" href="../sa-shared.css">
   ═══════════════════════════════════════════════════════ */

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

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', sans-serif; }

:root {
  --green: #009543; --green-d: #006f30; --green-l: #E8F5EE; --green-ll: #F0FDF4;
  --red: #C8282D; --red-l: #FEE2E2;
  --sidebar: #0F1117; --dark: #1A1A1A;
  --text: #0F172A; --muted: #64748B;
  --border: #E2E8F0; --card-b: #EEF2F6;
  --bg: #F8FAFC; --white: #FFFFFF;
  --blue: #2563EB; --blue-l: #EFF6FF;
  --orange: #F97316; --orange-l: #FFF7ED;
  --yellow: #FDE910;
  --purple: #7C3AED; --purple-l: #EDE9FE;
}

body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; display: flex; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ── SIDEBAR ── */
.sidebar {
  width: 260px; min-height: 100vh; background: var(--sidebar);
  display: flex; flex-direction: column; flex-shrink: 0; position: fixed;
  top: 0; left: 0; bottom: 0; overflow-y: auto;
}
.s-logo { padding: 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.s-logo-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.s-logo-box { width: 36px; height: 36px; background: var(--green); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.s-brand { font-size: 17px; font-weight: 900; color: var(--white); letter-spacing: -.5px; }
.s-brand-sub { font-size: 7px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.s-role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(220,38,38,.15); border: 1px solid rgba(220,38,38,.3);
  color: #FCA5A5; font-size: 9px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; padding: 3px 10px; border-radius: 12px;
}
.s-user { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; gap: 10px; }
.s-av { width: 34px; height: 34px; border-radius: 50%; background: #DC2626; color: white; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.s-uname { font-size: 11px; font-weight: 700; color: var(--white); }
.s-urole { font-size: 9px; color: var(--muted); margin-top: 2px; }

.s-nav { flex: 1; padding: 8px 0; }
.s-section { font-size: 8px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.25); padding: 12px 20px 4px; }
.s-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 20px;
  cursor: pointer; transition: .15s; border-left: 3px solid transparent;
  text-decoration: none;
}
.s-item:hover { background: rgba(255,255,255,.04); }
.s-item.active { background: rgba(0,149,67,.15); border-left-color: var(--green); }
.s-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.s-label { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.45); }
.s-item.active .s-label { color: var(--white); font-weight: 600; }
.s-item.active .s-dot { background: var(--green); }
.s-item:not(.active) .s-dot { background: rgba(255,255,255,.25); }
.s-badge { margin-left: auto; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 8px; color: white; }
.s-badge.green { background: var(--green); }
.s-badge.orange { background: var(--orange); }
.s-badge.red { background: var(--red); }

.s-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.06); }
.s-logout { width: 100%; padding: 10px; background: var(--red); color: white; border: none; border-radius: 10px; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ── MAIN ── */
.main { margin-left: 260px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── TOP BAR ── */
.topbar {
  height: 64px; background: var(--white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text); flex: 1; }
.topbar-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.admin-badge {
  display: flex; align-items: center; gap: 6px;
  background: rgba(220,38,38,.08); border: 1px solid rgba(220,38,38,.2);
  padding: 5px 12px; border-radius: 20px;
}
.admin-badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #DC2626; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }
.admin-badge-text { font-size: 11px; font-weight: 700; color: #DC2626; }
.tb-av { width: 34px; height: 34px; border-radius: 50%; background: #DC2626; color: white; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ── PAGE CONTENT ── */
.content { padding: 26px 28px; flex: 1; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--text); }
.section-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── BTNS ── */
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1; padding: 0 16px; height: 38px; font-family: 'Montserrat', sans-serif; }
.btn-primary { background: var(--green); color: white; }
.btn-ghost { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: var(--red); color: white; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 11px; }
.btn-xs { height: 26px; padding: 0 10px; font-size: 10px; border-radius: 6px; }

/* ── CARDS ── */
.card { background: var(--white); border: 1px solid var(--card-b); border-radius: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); overflow: hidden; }
.card-p { padding: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 7px; }

/* ── KPI ── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--white); border: 1px solid var(--card-b); border-radius: 20px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); position: relative; overflow: hidden; }
.kpi-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 4px; border-radius: 0 0 20px 20px; }
.kpi-label { font-size: 9px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.kpi-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px; }
.kpi-trend { font-size: 11px; font-weight: 600; }

/* ── TABLE ── */
.table-wrap { background: var(--white); border: 1px solid var(--card-b); border-radius: 20px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 18px; font-size: 9px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); background: #FCFCFD; text-align: left; white-space: nowrap; }
.data-table td { padding: 14px 18px; font-size: 12px; color: var(--text); border-bottom: 1px solid #F1F5F9; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--bg); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.b-active { background: var(--green-l); color: #16A34A; }
.b-inactive { background: #F3F4F6; color: #6B7280; }
.b-admin { background: var(--red-l); color: #DC2626; border: 1px solid #FECACA; }
.b-agent { background: var(--blue-l); color: var(--blue); }
.b-direction { background: var(--purple-l); color: var(--purple); }
.b-published { background: var(--green-l); color: #16A34A; }
.b-draft { background: #F3F4F6; color: #6B7280; }
.b-info { background: var(--blue-l); color: var(--blue); }
.b-urgent { background: var(--red-l); color: var(--red); }
.b-warn { background: var(--orange-l); color: var(--orange); }
.b-comp { background: var(--orange-l); color: var(--orange); }

/* ── FORM ── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.form-input { width: 100%; height: 40px; border: 1.5px solid var(--border); border-radius: 8px; padding: 0 12px; font-size: 13px; color: var(--text); background: var(--white); outline: none; font-family: 'Montserrat', sans-serif; }
.form-select { width: 100%; height: 40px; border: 1.5px solid var(--border); border-radius: 8px; padding: 0 12px; font-size: 13px; color: var(--text); background: var(--white); cursor: pointer; outline: none; font-family: 'Montserrat', sans-serif; }
.form-textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; color: var(--text); background: var(--white); resize: vertical; min-height: 80px; outline: none; font-family: 'Montserrat', sans-serif; line-height: 1.5; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ── TOGGLE ── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle { width: 42px; height: 22px; border-radius: 11px; background: #CBD5E1; position: relative; cursor: pointer; border: none; flex-shrink: 0; transition: .2s; }
.toggle.on { background: var(--green); }
.toggle::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: white; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle.on::after { left: 23px; }
.toggle-label { font-size: 12px; font-weight: 600; color: var(--text); }

/* ── PERM GRID ── */
.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg); border-radius: 8px; border: 1px solid var(--border); }
.perm-label { font-size: 11px; font-weight: 600; color: var(--text); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.gap-12 { display: flex; flex-direction: column; gap: 12px; }
.gap-8 { display: flex; flex-direction: column; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── COMPLEMENT ITEM ── */
.comp-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--white); }
.comp-drag { color: var(--muted); cursor: grab; font-size: 14px; flex-shrink: 0; }
.comp-info { flex: 1; }
.comp-name { font-size: 12px; font-weight: 700; color: var(--text); }
.comp-desc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.comp-req { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.req-mandatory { background: var(--red-l); color: var(--red); }
.req-optional { background: #F3F4F6; color: var(--muted); }
