/* ==========================================================================
   Apexis platform — shared design system  (shared/theme.css)
   --------------------------------------------------------------------------
   ONE STRUCTURE, MANY COLOURS.
   - Everything here is FIXED across every app: layout, components, type, neutrals.
   - The ONLY thing an app overrides is the --accent-* palette, in its own app.css:

         :root { --accent-dark:#1e1b4b; --accent-mid:#3730a3; --accent:#4f46e5; --accent-light:#6366f1; }

   Extracted and generalised from the original course-price-manager.html (whose
   brand green is the default accent below).
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Fraunces:wght@700;800;900&display=swap");

:root {
  /* ── Accent palette — OVERRIDE THESE PER APP (defaults to Apexis green) ── */
  --accent-dark:  #0f2b1d;
  --accent-mid:   #1a4a35;
  --accent:       #1a6b4a;
  --accent-light: #22856a;

  /* ── Semantic colours (fixed across apps) ── */
  --blue: #2563eb; --blue-light: #3b82f6;
  --red: #e53e3e; --amber: #b45309; --amber-light: #f59e0b;
  --success: #2e7d32;

  /* ── Neutrals & text (fixed) ── */
  --text-primary: #1a2332; --text-secondary: #475569;
  --text-muted: #94a3b8; --text-faint: #64748b;
  --bg: #f4f6f8; --white: #ffffff;
  --border: #e8ecf1; --border-light: #dde3ed;

  /* ── Shape, type, elevation (fixed) ── */
  --radius: 10px; --radius-lg: 14px; --radius-xl: 16px;
  --font-body: 'DM Sans', sans-serif;
  --font-display: 'Fraunces', serif;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 25px 60px rgba(0,0,0,0.18);

  --maxw: 1200px;
}

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text-primary); min-height: 100vh; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c1c9d4; border-radius: 3px; }

/* ── Header (accent gradient) ── */
.header { background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-mid) 40%, var(--accent) 100%); padding: 28px 32px 20px; color: #fff; }
.header-inner { max-width: var(--maxw); margin: 0 auto; }
.header-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 16px; }
.header h1 { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.header p { margin-top: 4px; font-size: 14px; color: rgba(255,255,255,0.65); }
.header-stats { display: flex; gap: 16px; align-items: center; }
.header-stat { text-align: right; }
.header-stat-label { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.08em; }
.header-stat-value { font-size: 22px; font-weight: 800; }
.header-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.2); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; }
.tab-btn { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 10px 10px 0 0; border: none; cursor: pointer; font-size: 14px; font-weight: 600; font-family: var(--font-body); transition: all 0.2s; }
.tab-btn.active { background: var(--bg); color: var(--text-primary); }
.tab-btn:not(.active) { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7); }
.tab-btn:not(.active):hover { background: rgba(255,255,255,0.14); }

/* ── Content shell ── */
.content { max-width: var(--maxw); margin: 0 auto; padding: 24px 32px 48px; }

/* ── Inputs ── */
.input, .select, .textarea {
  width: 100%; padding: 10px 14px; border-radius: var(--radius); border: 1.5px solid var(--border-light);
  font-size: 14px; font-family: var(--font-body); color: var(--text-primary); outline: none;
  transition: border-color 0.2s; background: var(--white);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.select { appearance: none; background: var(--white) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 14px center no-repeat; padding-right: 36px; }
.textarea { min-height: 80px; resize: vertical; }

/* ── Buttons ── */
.btn { padding: 10px 22px; border-radius: var(--radius); border: none; cursor: pointer; font-size: 14px; font-weight: 700; font-family: var(--font-body); display: inline-flex; align-items: center; gap: 6px; transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.btn-secondary { background: #f1f5f9; color: var(--text-secondary); box-shadow: none; border: 1.5px solid var(--border-light); }
.btn-danger { background: #fef2f2; border: 1px solid #fecaca; color: var(--red); }
.btn-icon { background: #f1f5f9; border: 1px solid var(--border-light); color: var(--text-secondary); padding: 6px 8px; border-radius: 8px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-xs { padding: 6px 8px; font-size: 12px; border-radius: 8px; }

/* ── Field ── */
.field { margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.field-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Badges & status ── */
.badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.badge-info { background: #eff6ff; color: var(--blue); border: 1px solid #bfdbfe; }
.badge-warn { background: #fef3c7; color: var(--amber); border: 1px solid #fde68a; }
.status-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 10px; border-radius: 20px; display: inline-block; }
.status-active { background: #e8f5e9; color: var(--success); border: 1px solid #a5d6a7; }
.status-pending { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.status-archived { background: #eceff1; color: #546e7a; border: 1px solid #b0bec5; }

/* ── Card (generic) ── */
.card { background: var(--white); border-radius: var(--radius-lg); border: 1.5px solid var(--border); overflow: hidden; transition: box-shadow 0.2s; margin-bottom: 10px; }
.card.raised { box-shadow: var(--shadow-md); }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; }
.card-body { padding: 16px 20px; }

.stat-card { background: var(--white); border-radius: var(--radius); padding: 12px 14px; border: 1px solid var(--border-light); }
.stat-card-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.stat-card-value { font-size: 18px; font-weight: 700; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: rgba(15,23,42,0.55); backdrop-filter: blur(6px); }
.modal { background: var(--white); border-radius: var(--radius-xl); max-width: 94vw; max-height: 90vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-sm { width: 520px; } .modal-lg { width: 720px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; }

/* ── Toggle ── */
.toggle { width: 48px; height: 26px; border-radius: 13px; border: none; cursor: pointer; position: relative; transition: background 0.2s; flex-shrink: 0; }
.toggle-knob { width: 20px; height: 20px; border-radius: 50%; background: #fff; position: absolute; top: 3px; transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle.on { background: var(--accent); } .toggle.on .toggle-knob { left: 25px; }
.toggle.off { background: #cbd5e1; } .toggle.off .toggle-knob { left: 3px; }

/* ── Toolbar & search ── */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.toolbar-left { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-input { padding-left: 38px; width: 240px; }

/* ── Grid helpers ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2-sm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
