/* ============================================================
   INSCAPERS ISMS — Design Tokens & Shared Components
   Derived from UI/UX Pro Max "Minimal Swiss / Education" system
   ============================================================ */

:root {
    --color-primary: #0F172A;      /* navy - headings, sidebar active */
    --color-primary-soft: #1E293B;
    --color-accent: #10B981;       /* emerald - primary stat/CTA */
    --color-accent-dark: #059669;
    --color-blue: #3B82F6;
    --color-orange: #F59E0B;
    --color-red: #EF4444;
    --color-purple: #8B5CF6;
    --color-bg: #F1F5F9;
    --color-card: #FFFFFF;
    --color-border: #E2E8F0;
    --color-muted: #64748B;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
}

html, body {
    background: var(--color-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--color-primary);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    width: 264px;
    background: #FFFFFF;
    border-right: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    transition: transform .2s ease;
}
.app-sidebar::-webkit-scrollbar { width: 6px; }
.app-sidebar::-webkit-scrollbar-thumb { background: #E2E8F0; border-radius: 8px; }

.app-main { flex: 1; min-width: 0; }

.app-topbar {
    background: #FFFFFF;
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 30;
}

/* ---------- Sidebar nav ---------- */
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: #334155;
    font-size: 14.5px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: #F1F5F9; }
.nav-item.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-card);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Cards ---------- */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.kpi-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
}

.progress-track { height: 6px; border-radius: 999px; background: #EEF2F6; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge-green { background: #DCFCE7; color: #15803D; }
.badge-orange { background: #FEF3C7; color: #B45309; }
.badge-blue { background: #DBEAFE; color: #1D4ED8; }
.badge-red { background: #FEE2E2; color: #B91C1C; }
.badge-slate { background: #F1F5F9; color: #475569; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14px; border-radius: var(--radius-sm); padding: 10px 18px; transition: all .15s ease; cursor: pointer; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: #1E293B; }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: var(--color-accent-dark); }
.btn-outline { background: #fff; color: var(--color-primary); border: 1px solid var(--color-border); }
.btn-outline:hover { background: #F8FAFC; }

/* ---------- Forms ---------- */
.form-input, .form-select, .form-textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14.5px;
    background: #fff;
    color: var(--color-primary);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .15);
}
.form-label { display:block; font-size: 13.5px; font-weight: 600; color: #334155; margin-bottom: 6px; }

/* ---------- Table ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-weight: 600; color: var(--color-muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 16px; border-bottom: 1px solid var(--color-border); }
.data-table td { padding: 14px 16px; border-bottom: 1px solid #F1F5F9; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FAFBFC; }

/* ---------- Avatar ---------- */
.avatar { border-radius: 999px; object-fit: cover; flex-shrink: 0; }
.avatar-fallback { border-radius: 999px; display:flex; align-items:center; justify-content:center; font-weight: 700; color: #fff; flex-shrink: 0; }

/* ---------- Scroll for mobile sidebar ---------- */
@media (max-width: 1024px) {
    .app-sidebar { position: fixed; left: 0; z-index: 50; transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 40; }
    .sidebar-overlay.open { display: block; }
}

/* ---------- Print (for reports/certificates) ---------- */
@media print {
    .no-print { display: none !important; }
}
