* { font-family: 'Inter', system-ui, sans-serif; }
html, body { scroll-behavior: smooth; }
body { background: #f3f4f8; color: #2c3e50; overflow-x: hidden; }

/* SIDEBAR */
.sidebar { background: linear-gradient(180deg, #2c3e50 0%, #1f2d3d 100%); min-height: 100vh; position: sticky; top: 0; overflow-y: auto; max-height: 100vh; }
.sidebar-scroll { max-height: calc(100vh - 88px); overflow-y: auto; }
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 6px; }
.nav-group { font-size: 10px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .08em; padding: 14px 14px 6px; }
.nav-item { display:flex; align-items:center; gap:12px; padding:9px 14px; border-radius:10px; color:#cbd5e1; font-size:13px; font-weight:500; cursor:pointer; transition: all .2s ease; position: relative; }
.nav-item:hover { background: rgba(255,255,255,.06); color:#fff; transform: translateX(2px); }
.nav-item.active { background: linear-gradient(135deg, rgba(102,126,234,.28), rgba(118,75,162,.28)); color:#fff; box-shadow: inset 3px 0 0 #667eea; }
.nav-item.active::after { content:''; position:absolute; right:14px; width:6px; height:6px; border-radius:50%; background:#a78bfa; box-shadow:0 0 8px #a78bfa; }
.nav-item svg { width:17px; height:17px; flex-shrink: 0; }

/* BRAND */
.brand-gradient { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.brand-text { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* CARDS */
.card { background:#fff; border-radius:14px; box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04); transition: all .25s ease; }
.card-hover { cursor: pointer; }
.card-hover:hover { box-shadow: 0 14px 40px rgba(102,126,234,.18); transform: translateY(-3px); border-color: #c7d2fe; }

/* CHIPS */
.chip { display:inline-flex; align-items:center; gap:6px; padding:3px 10px; border-radius:999px; font-size:11px; font-weight:600; white-space: nowrap; }
.chip-green { background:#dcfce7; color:#15803d; }
.chip-red { background:#fee2e2; color:#b91c1c; }
.chip-yellow { background:#fef3c7; color:#92400e; }
.chip-blue { background:#dbeafe; color:#1d4ed8; }
.chip-purple { background:#ede9fe; color:#6d28d9; }
.chip-slate { background:#e2e8f0; color:#475569; }

/* ICONS */
.kpi-icon { width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.kpi-icon-lg { width:56px; height:56px; border-radius:14px; }

/* PROGRESS */
.progress-bar { height:6px; background:#eef2f7; border-radius:999px; overflow:hidden; }
.progress-bar > div { height:100%; background: linear-gradient(90deg, #667eea, #764ba2); border-radius:999px; transition: width 1.2s cubic-bezier(.22,.61,.36,1); }
.progress-bar.success > div { background: linear-gradient(90deg, #22c55e, #16a34a); }
.progress-bar.warning > div { background: linear-gradient(90deg, #f59e0b, #d97706); }
.progress-bar.danger > div { background: linear-gradient(90deg, #ef4444, #b91c1c); }

/* FORM */
.input { width:100%; padding:9px 12px; border:1px solid #e2e8f0; border-radius:8px; font-size:13px; outline:none; transition: all .15s; background:#fff; color:#1e293b; }
.input:focus { border-color:#667eea; box-shadow: 0 0 0 3px rgba(102,126,234,.15); }
.label { font-size:11px; font-weight:600; color:#475569; margin-bottom:5px; display:block; text-transform:uppercase; letter-spacing:.04em; }

/* BUTTONS */
.btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); color:#fff; padding:9px 18px; border-radius:8px; font-weight:600; font-size:13px; box-shadow:0 4px 12px rgba(102,126,234,.3); cursor:pointer; border:none; display:inline-flex; align-items:center; transition: all .2s; }
.btn-primary:hover { box-shadow:0 8px 22px rgba(102,126,234,.5); transform: translateY(-1px); }
.btn-ghost { background:#fff; color:#475569; border:1px solid #e2e8f0; padding:9px 16px; border-radius:8px; font-weight:600; font-size:13px; cursor:pointer; display:inline-flex; align-items:center; transition: all .15s; }
.btn-ghost:hover { background:#f8fafc; border-color: #cbd5e1; }
.btn-danger { background:#dc2626; color:#fff; padding:9px 18px; border-radius:8px; font-weight:600; font-size:13px; cursor:pointer; border:none; }
.btn-success { background:#16a34a; color:#fff; padding:9px 18px; border-radius:8px; font-weight:600; font-size:13px; cursor:pointer; border:none; }

/* LAYOUT */
.row { display:flex; align-items:center; }
.divider-soft { border-top:1px solid #eef2f7; }

/* TABLES */
table.simple { width:100%; font-size:13px; }
table.simple th { text-align:left; padding:10px 14px; color:#64748b; font-weight:600; font-size:11px; text-transform:uppercase; letter-spacing:.04em; background:#f8fafc; }
table.simple td { padding:12px 14px; border-top:1px solid #eef2f7; }
table.simple tr { transition: background .15s; }
table.simple tr:hover td { background:#fafbff; }

/* CHECKLIST */
.checklist-item { padding:14px; border:1px solid #eef2f7; border-radius:10px; margin-bottom:10px; transition: all .2s; }
.checklist-item:hover { border-color:#c7d2fe; }
.checklist-item.conforme { border-color:#bbf7d0; background:#f0fdf4; }
.checklist-item.nconforme { border-color:#fecaca; background:#fff1f1; }
.check-pill { padding:5px 10px; border-radius:8px; font-size:11px; font-weight:600; cursor:pointer; border:1px solid transparent; transition: all .15s; }
.check-pill.c { background:#dcfce7; color:#166534; }
.check-pill.nc { background:#fee2e2; color:#991b1b; }
.check-pill.na { background:#e2e8f0; color:#475569; }
.check-pill.off { background:#fff; border:1px solid #e2e8f0; color:#94a3b8; }

/* DEVICE (mobile mockup) */
.device { width:280px; height:570px; background:#1a1a1a; border-radius:36px; padding:14px; box-shadow: 0 24px 70px rgba(0,0,0,.3); flex-shrink:0; position: relative; }
.device::before { content:''; position:absolute; top:14px; left:50%; transform:translateX(-50%); width:90px; height:20px; background:#1a1a1a; border-radius:0 0 14px 14px; z-index:2; }
.device-screen { width:100%; height:100%; background:#fff; border-radius:24px; overflow:hidden; position:relative; display:flex; flex-direction:column; }
.scrollable { overflow-y:auto; }
.scrollable::-webkit-scrollbar { width:6px; }
.scrollable::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:6px; }

/* PULSE / DOTS */
.pulse-dot { width:8px; height:8px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.6);} 70%{box-shadow:0 0 0 10px rgba(34,197,94,0);} 100%{box-shadow:0 0 0 0 rgba(34,197,94,0);} }

.badge-dot { position:absolute; top:-4px; right:-4px; background:#ef4444; color:#fff; font-size:9px; font-weight:700; padding:2px 5px; border-radius:999px; box-shadow:0 0 0 2px #fff; animation: bounce-soft 1.5s infinite; }
@keyframes bounce-soft { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-2px);} }

/* SIGNATURE */
.signature-area { border:2px dashed #cbd5e1; border-radius:10px; height:60px; display:flex; align-items:center; justify-content:center; color:#94a3b8; font-size:12px; background:#fafbff; transition: all .2s; }
.signature-area.signed { border-style:solid; border-color:#a78bfa; background:linear-gradient(135deg, #faf5ff, #f0f5ff); color:#6d28d9; font-family:'Brush Script MT', cursive; font-size:22px; animation: signed-in .5s ease-out; }
@keyframes signed-in { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* AUDIT TIMELINE */
.audit-step { display:flex; gap:12px; padding:10px 0; position:relative; }
.audit-step:not(:last-child)::before { content:''; position:absolute; left:4px; top:24px; bottom:-4px; width:2px; background:#e2e8f0; }
.audit-dot { width:10px; height:10px; border-radius:50%; background:#667eea; margin-top:5px; flex-shrink:0; box-shadow:0 0 0 4px rgba(102,126,234,.18); position:relative; z-index:1; }

/* STAT MINI */
.stat-mini { display:flex; flex-direction:column; gap:2px; }
.stat-mini .v { font-size:22px; font-weight:700; color:#1e293b; }
.stat-mini .l { font-size:11px; color:#64748b; text-transform:uppercase; font-weight:600; letter-spacing:.04em; }

/* PAGE ANIMATIONS */
.page-enter { animation: pageIn .45s cubic-bezier(.22,.61,.36,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.stagger > * { animation: fadeUp .5s both; }
.stagger > *:nth-child(1){animation-delay:.05s;} .stagger > *:nth-child(2){animation-delay:.1s;}
.stagger > *:nth-child(3){animation-delay:.15s;} .stagger > *:nth-child(4){animation-delay:.2s;}
.stagger > *:nth-child(5){animation-delay:.25s;} .stagger > *:nth-child(6){animation-delay:.3s;}
.stagger > *:nth-child(7){animation-delay:.35s;} .stagger > *:nth-child(8){animation-delay:.4s;}
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* LOGIN */
.login-bg { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background-size: 200% 200%; animation: bgshift 8s ease infinite; transition: all .4s; }
@keyframes bgshift { 0%,100%{background-position:0% 50%;} 50%{background-position:100% 50%;} }
.login-card { background: #fff; border-radius: 16px; padding: 28px 30px; width: 100%; max-width: 360px; box-shadow: 0 30px 80px rgba(0,0,0,.25); animation: loginIn .6s cubic-bezier(.22,.61,.36,1); }
@keyframes loginIn { from { opacity: 0; transform: translateY(20px) scale(.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* COUNT-UP HINT */
.count-up { display: inline-block; }

/* SHIMMER for skeleton */
.shimmer { background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%); background-size: 1000px 100%; animation: shimmer 2s infinite linear; }
@keyframes shimmer { 0% { background-position: -500px 0; } 100% { background-position: 500px 0; } }

/* MAP STYLE */
.map-box { background: linear-gradient(135deg, #e0e7ff 0%, #f3e8ff 100%); border-radius: 14px; height: 480px; position: relative; overflow: hidden; }
.map-box::before { content:''; position:absolute; inset:0; background-image: radial-gradient(circle at 30% 20%, rgba(102,126,234,.08), transparent 40%), radial-gradient(circle at 80% 70%, rgba(118,75,162,.08), transparent 40%); }
.map-pin { position: absolute; width: 36px; height: 36px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display:flex; align-items:center; justify-content:center; box-shadow: 0 6px 16px rgba(0,0,0,.2); cursor:pointer; transition: all .2s; }
.map-pin:hover { transform: rotate(-45deg) scale(1.15); }
.map-pin > div { transform: rotate(45deg); color: #fff; font-weight: 700; font-size: 11px; }

/* PERMISSION MATRIX */
.perm-cell { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.perm-cell.allow { background: #dcfce7; color: #15803d; }
.perm-cell.read { background: #dbeafe; color: #1d4ed8; }
.perm-cell.deny { background: #f1f5f9; color: #cbd5e1; }

/* PDF SHEET */
.pdf-sheet { background: #fff; box-shadow: 0 12px 40px rgba(0,0,0,.12); border-radius: 4px; padding: 40px; aspect-ratio: 1 / 1.41; max-width: 600px; margin: 0 auto; position: relative; overflow: hidden; }
.pdf-watermark { position: absolute; bottom: 30px; right: 30px; opacity: .08; font-size: 80px; font-weight: 900; color: #667eea; transform: rotate(-15deg); }
