:root {
  --bg: #0c0d10;
  --surface: #141519;
  --surface2: #1a1b21;
  --border: #2a2b35;
  --text: #e4e4ef;
  --muted: #8888a0;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --green: #22c55e;
  --green-bg: rgba(34,197,94,0.1);
  --yellow: #eab308;
  --yellow-bg: rgba(234,179,8,0.1);
  --red: #ef4444;
  --red-bg: rgba(239,68,68,0.1);
  --orange: #f97316;
  --orange-bg: rgba(249,115,22,0.1);
  --purple: #a855f7;
  --purple-bg: rgba(168,85,247,0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Inter',-apple-system,sans-serif; background:var(--bg); color:var(--text); line-height:1.5; min-height:100vh; }
a { color:var(--accent); text-decoration:none; }
input,select,textarea,button { font-family:inherit; font-size:inherit; }

/* Layout */
.app { display:flex; min-height:100vh; }
.sidebar { width:260px; background:var(--surface); border-right:1px solid var(--border); padding:20px 0; display:flex; flex-direction:column; position:fixed; top:0; left:0; bottom:0; z-index:50; }
.sidebar-logo { padding:0 20px 24px; font-size:20px; font-weight:800; letter-spacing:-0.5px; border-bottom:1px solid var(--border); margin-bottom:16px; }
.sidebar-logo span { color:var(--accent); }
.sidebar-nav { flex:1; }
.sidebar-nav a { display:flex; align-items:center; gap:10px; padding:10px 20px; color:var(--muted); font-size:14px; font-weight:500; transition:all .15s; }
.sidebar-nav a:hover { color:var(--text); background:var(--surface2); }
.sidebar-nav a.active { color:var(--accent); background:rgba(59,130,246,0.08); border-right:2px solid var(--accent); }
.sidebar-user { padding:16px 20px; border-top:1px solid var(--border); }
.sidebar-user .user-name { font-size:14px; font-weight:600; }
.sidebar-user .user-role { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; }
.sidebar-user .user-org { font-size:12px; color:var(--muted); }
.main { flex:1; margin-left:260px; padding:32px; }

/* Login */
.login-page { display:flex; align-items:center; justify-content:center; min-height:100vh; }
.login-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:40px; width:400px; max-width:90vw; }
.login-card h1 { font-size:24px; font-weight:800; margin-bottom:4px; }
.login-card .sub { color:var(--muted); font-size:14px; margin-bottom:32px; }
.login-card .demo-hint { background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius); padding:12px; margin-bottom:24px; font-size:13px; color:var(--muted); }
.login-card .demo-hint code { color:var(--accent); background:rgba(59,130,246,0.1); padding:1px 6px; border-radius:4px; }

/* Forms */
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13px; font-weight:600; color:var(--muted); margin-bottom:6px; text-transform:uppercase; letter-spacing:.03em; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-row-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="date"],select,textarea {
  width:100%; padding:10px 14px; background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius); color:var(--text); font-size:14px; transition:border .15s;
}
input:focus,select:focus,textarea:focus { outline:none; border-color:var(--accent); }
textarea { min-height:100px; resize:vertical; }
select { cursor:pointer; }

/* Buttons */
.btn { display:inline-flex; align-items:center; gap:8px; padding:10px 20px; border-radius:var(--radius); font-weight:600; font-size:14px; cursor:pointer; border:none; transition:all .15s; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-hover); }
.btn-success { background:var(--green); color:#fff; }
.btn-danger { background:var(--red); color:#fff; }
.btn-warning { background:var(--orange); color:#fff; }
.btn-ghost { background:transparent; color:var(--muted); border:1px solid var(--border); }
.btn-ghost:hover { border-color:var(--muted); color:var(--text); }
.btn-sm { padding:6px 14px; font-size:13px; }
.btn-group { display:flex; gap:8px; }

/* Page header */
.page-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:28px; }
.page-header h1 { font-size:24px; font-weight:800; letter-spacing:-0.5px; }

/* Cards */
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:24px; }
.card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.card-header h3 { font-size:16px; font-weight:700; }

/* Stats */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:28px; }
.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:20px; }
.stat-card .stat-label { font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; font-weight:600; }
.stat-card .stat-value { font-size:32px; font-weight:800; margin-top:4px; }
.stat-card .stat-sub { font-size:13px; color:var(--muted); margin-top:2px; }

/* Table */
.table-wrapper { overflow-x:auto; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th { text-align:left; padding:12px 16px; font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); font-weight:600; border-bottom:1px solid var(--border); background:var(--surface2); }
td { padding:12px 16px; border-bottom:1px solid var(--border); }
tr:hover td { background:rgba(255,255,255,0.02); }
tr { cursor:pointer; transition:background .1s; }

/* Badges */
.badge { display:inline-block; padding:3px 10px; border-radius:100px; font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; }
.badge-draft { background:var(--surface2); color:var(--muted); }
.badge-submitted { background:var(--purple-bg); color:var(--purple); }
.badge-under_review { background:rgba(59,130,246,0.1); color:var(--accent); }
.badge-info_requested { background:var(--yellow-bg); color:var(--yellow); }
.badge-approved { background:var(--green-bg); color:var(--green); }
.badge-rejected { background:var(--red-bg); color:var(--red); }
.badge-low { background:var(--green-bg); color:var(--green); }
.badge-medium { background:var(--yellow-bg); color:var(--yellow); }
.badge-high { background:var(--orange-bg); color:var(--orange); }
.badge-critical { background:var(--red-bg); color:var(--red); }

/* Report detail */
.report-grid { display:grid; grid-template-columns:1fr 360px; gap:24px; }
.report-section { margin-bottom:24px; }
.report-section h3 { font-size:14px; font-weight:700; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:12px; }
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.detail-item .detail-label { font-size:12px; color:var(--muted); margin-bottom:2px; }
.detail-item .detail-value { font-size:14px; font-weight:500; }

/* Timeline */
.timeline { position:relative; padding-left:24px; }
.timeline::before { content:''; position:absolute; left:7px; top:4px; bottom:4px; width:2px; background:var(--border); }
.timeline-item { position:relative; padding-bottom:20px; }
.timeline-item::before { content:''; position:absolute; left:-20px; top:4px; width:12px; height:12px; border-radius:50%; background:var(--surface2); border:2px solid var(--border); }
.timeline-item.status-submitted::before { border-color:var(--purple); background:var(--purple-bg); }
.timeline-item.status-under_review::before { border-color:var(--accent); background:rgba(59,130,246,0.1); }
.timeline-item.status-info_requested::before { border-color:var(--yellow); background:var(--yellow-bg); }
.timeline-item.status-approved::before { border-color:var(--green); background:var(--green-bg); }
.timeline-item.status-rejected::before { border-color:var(--red); background:var(--red-bg); }
.timeline-meta { font-size:12px; color:var(--muted); }
.timeline-text { font-size:14px; margin-top:2px; }

/* Comments */
.comment { padding:16px; background:var(--surface2); border-radius:var(--radius); margin-bottom:12px; }
.comment-header { display:flex; justify-content:space-between; margin-bottom:6px; }
.comment-author { font-size:13px; font-weight:600; }
.comment-role { font-size:11px; color:var(--muted); text-transform:uppercase; background:var(--surface); padding:2px 8px; border-radius:4px; }
.comment-time { font-size:12px; color:var(--muted); }
.comment-text { font-size:14px; line-height:1.6; }
.comment-form { display:flex; gap:8px; margin-top:12px; }
.comment-form textarea { min-height:60px; flex:1; }

/* Filters */
.filters { display:flex; gap:12px; margin-bottom:20px; flex-wrap:wrap; }
.filters select, .filters input { width:auto; min-width:140px; padding:8px 12px; font-size:13px; }

/* Responsive */
@media(max-width:900px) {
  .sidebar { display:none; }
  .main { margin-left:0; }
  .report-grid { grid-template-columns:1fr; }
  .form-row,.form-row-3 { grid-template-columns:1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width:8px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:4px; }

/* Animations */
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.fade-in { animation:fadeIn .3s ease; }

/* Notification toast */
.toast { position:fixed; top:20px; right:20px; background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius); padding:14px 20px; font-size:14px; z-index:1000; animation:fadeIn .2s ease; }
.toast.success { border-color:var(--green); }
.toast.error { border-color:var(--red); }
