/* ============================================================
   SIGNOVA — Global Stylesheet
   Stack: Vanilla CSS + Custom Properties
   ============================================================ */

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

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --navy:    #0B1D3A;
  --navy-2:  #0f2548;
  --navy-3:  #152f57;
  --blue:    #2563EB;
  --blue-lt: #3b82f6;
  --blue-dim:#1d4ed8;
  --green:   #10B981;
  --cream:   #F7F6F2;
  --white:   #ffffff;
  --gray-1:  #F1F0EC;
  --gray-2:  #E2E0D9;
  --gray-3:  #9CA3AF;
  --gray-4:  #6B7280;
  --gray-5:  #374151;
  --text:    #1a1f2e;
  --radius:  10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow:    0 4px 20px rgba(0,0,0,.09);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.13);
  --font-display: 'Syne', sans-serif;
  --font-body:    'Inter', sans-serif;
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); color: var(--text); background: var(--white); line-height: 1.6; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── TYPOGRAPHY ─────────────────────────────────────────── */
.display-1 { font-family: var(--font-display); font-size: clamp(2.4rem,5.5vw,4rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.display-2 { font-family: var(--font-display); font-size: clamp(1.8rem,4vw,3rem); font-weight: 700; line-height: 1.15; letter-spacing: -.015em; }
.heading-1  { font-family: var(--font-display); font-size: clamp(1.4rem,3vw,2rem); font-weight: 700; line-height: 1.25; }
.heading-2  { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.body-lg    { font-size: 1.05rem; line-height: 1.7; color: var(--gray-4); }
.body       { font-size: .9rem; line-height: 1.65; }
.label      { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.mono       { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: .85rem; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.container  { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 780px; margin: 0 auto; padding: 0 1.5rem; }
.section    { padding: 6rem 0; }
.section-sm { padding: 3.5rem 0; }
.grid-2     { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3     { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.grid-4     { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; }
.flex       { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1      { gap: .5rem; }
.gap-2      { gap: 1rem; }
.gap-3      { gap: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-center { text-align: center; }
.text-white  { color: var(--white); }

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.5rem; border-radius: var(--radius); font-weight: 600; font-size: .9rem; transition: all var(--transition); white-space: nowrap; }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dim); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,.3); }
.btn-white { background: var(--white); color: var(--navy); }
.btn-white:hover { background: var(--cream); transform: translateY(-1px); }
.btn-outline { border: 1.5px solid currentColor; color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: var(--white); }
.btn-ghost { color: var(--gray-4); }
.btn-ghost:hover { color: var(--text); }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: .4rem 1rem; font-size: .8rem; }
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: #0da271; transform: translateY(-1px); }

/* ─── FORM ELEMENTS ──────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.25rem; }
.form-label { font-size: .82rem; font-weight: 500; color: var(--gray-5); }
.form-input { padding: .65rem .9rem; border: 1.5px solid var(--gray-2); border-radius: var(--radius); font-size: .9rem; color: var(--text); background: var(--white); transition: border-color var(--transition), box-shadow var(--transition); }
.form-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.form-input::placeholder { color: var(--gray-3); }
.form-hint  { font-size: .75rem; color: var(--gray-3); }
.form-error { font-size: .75rem; color: #ef4444; }

/* ─── CARDS ──────────────────────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--gray-2); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); transition: all var(--transition); }

/* ─── BADGES ─────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .75rem; border-radius: 20px; font-size: .72rem; font-weight: 600; }
.badge-blue  { background: rgba(37,99,235,.1); color: var(--blue); }
.badge-green { background: rgba(16,185,129,.1); color: var(--green); }
.badge-gray  { background: var(--gray-1); color: var(--gray-5); }
.badge-navy  { background: var(--navy); color: var(--white); }

/* ─── STATUS DOTS ────────────────────────────────────────── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green  { background: var(--green); }
.dot-blue   { background: var(--blue); }
.dot-orange { background: #f59e0b; }
.dot-gray   { background: var(--gray-3); }

/* ─── NAVBAR ─────────────────────────────────────────────── */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 999; padding: 1rem 0; transition: background var(--transition), box-shadow var(--transition); }
.nav.scrolled { background: rgba(11,29,58,.97); backdrop-filter: blur(12px); box-shadow: 0 2px 20px rgba(0,0,0,.2); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.nav-logo  { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; color: var(--white); letter-spacing: -.02em; }
.nav-logo span { color: var(--blue-lt); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-link  { font-size: .88rem; color: rgba(255,255,255,.75); font-weight: 500; transition: color var(--transition); }
.nav-link:hover { color: var(--white); }
.nav-cta   { display: flex; align-items: center; gap: .75rem; }

/* ─── SIDEBAR (app) ──────────────────────────────────────── */
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 240px; background: var(--navy); display: flex; flex-direction: column; padding: 1.5rem 0; z-index: 100; }
.sidebar-logo { padding: 0 1.5rem 1.5rem; font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; color: var(--white); border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo span { color: var(--blue-lt); }
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-section { padding: .75rem 1.5rem .25rem; font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.3); }
.sidebar-link { display: flex; align-items: center; gap: .75rem; padding: .6rem 1.5rem; font-size: .875rem; color: rgba(255,255,255,.65); transition: all var(--transition); position: relative; }
.sidebar-link:hover { color: var(--white); background: rgba(255,255,255,.06); }
.sidebar-link.active { color: var(--white); background: rgba(37,99,235,.2); }
.sidebar-link.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue-lt); border-radius: 0 2px 2px 0; }
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-bottom { padding: 1rem 1.5rem; border-top: 1px solid rgba(255,255,255,.08); }

/* ─── APP LAYOUT ─────────────────────────────────────────── */
.app-wrapper { margin-left: 240px; min-height: 100vh; background: var(--cream); }
.app-header  { background: var(--white); border-bottom: 1px solid var(--gray-2); padding: 1rem 2rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.app-title   { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }
.app-content { padding: 2rem; }

/* ─── TABLE ──────────────────────────────────────────────── */
.table-wrap { background: var(--white); border-radius: var(--radius-lg); border: 1px solid var(--gray-2); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: .75rem 1.25rem; background: var(--gray-1); font-size: .75rem; font-weight: 600; text-align: left; color: var(--gray-4); letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--gray-2); }
.table td { padding: .9rem 1.25rem; border-bottom: 1px solid var(--gray-1); font-size: .875rem; color: var(--gray-5); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--cream); }

/* ─── TOAST ──────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; }
.toast { padding: .75rem 1.25rem; border-radius: var(--radius); font-size: .875rem; font-weight: 500; color: var(--white); display: flex; align-items: center; gap: .5rem; box-shadow: var(--shadow-lg); animation: slideIn .2s ease; }
.toast-success { background: var(--green); }
.toast-error   { background: #ef4444; }
.toast-info    { background: var(--blue); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeUp  { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse   { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ─── MODAL ──────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.modal { background: var(--white); border-radius: var(--radius-lg); padding: 2rem; max-width: 480px; width: 90%; box-shadow: var(--shadow-lg); animation: fadeUp .2s ease; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title  { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform var(--transition); }
  .sidebar.open { transform: translateX(0); }
  .app-wrapper { margin-left: 0; }
  .nav-links { display: none; }
}

/* ─── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-3); }
