/* ===== ProCure — Main Stylesheet ===== */
:root {
  --primary:       #1b6ef5;
  --primary-dark:  #1257cc;
  --primary-light: #e8f1fe;
  --cyan:          #06b6d4;
  --cyan-light:    #e0f7fa;
  --orange:        #f97316;
  --orange-light:  #fff3e6;
  --sidebar-w:     262px;
  --topbar-h:      62px;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --bg:            #f1f5f9;
  --white:         #ffffff;
  --success:       #22c55e;
  --danger:        #ef4444;
  --warning:       #eab308;
  --radius:        12px;
  --shadow:        0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg); color: var(--text); margin: 0; font-size: 14px; }
a { text-decoration: none; color: inherit; }
.mono { font-family: 'DM Mono', monospace; }
code { font-family: 'DM Mono', monospace; background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 12px; color: var(--primary); }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Sidebar ───────────────────────────────────────────── */
#sidebar {
  position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-w);
  background: #0f172a; display: flex; flex-direction: column; z-index: 1000;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); flex-shrink: 0;
}
.brand-icon {
  width: 38px; height: 38px; background: var(--primary); border-radius: 10px;
  display: grid; place-items: center; color: #fff; font-size: 18px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(27,110,245,.4);
}
.brand-name { color: #fff; font-weight: 800; font-size: 15px; }
.brand-sub  { color: rgba(255,255,255,.35); font-size: 9.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; margin-top: 1px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 10px; }
.nav-section-label { color: rgba(255,255,255,.25); font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 6px 8px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: rgba(255,255,255,.55); font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: all .15s; margin-bottom: 1px; white-space: nowrap;
}
.nav-item i { font-size: 16px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.07); color: rgba(255,255,255,.9); }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(27,110,245,.35); }

.sidebar-footer { flex-shrink: 0; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.07); }
.user-widget { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.user-name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.user-role { color: rgba(255,255,255,.38); font-size: 10.5px; }
.btn-logout { color: rgba(255,255,255,.3); font-size: 16px; margin-left: auto; transition: color .15s; }
.btn-logout:hover { color: #ef4444; }

#sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; }

/* ── Topbar ────────────────────────────────────────────── */
#topbar {
  position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--topbar-h);
  background: var(--white); border-bottom: 1px solid var(--border); z-index: 900;
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  box-shadow: 0 1px 0 var(--border);
}
.topbar-toggle { background: none; border: none; font-size: 22px; color: var(--text-muted); padding: 4px; cursor: pointer; display: none; }
.topbar-title { flex: 1; }
.topbar-title span { font-size: 17px; font-weight: 700; }
.topbar-title small { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: -1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-btn { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; font-size: 16px; color: var(--text-muted); transition: all .15s; position: relative; }
.topbar-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.notif-dot { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center; }
.topbar-user-btn { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px 4px 4px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s; }
.topbar-user-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.topbar-avatar { width: 28px; height: 28px; border-radius: 6px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; }

/* ── Notifications Dropdown ────────────────────────────── */
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px 8px; border-bottom: 1px solid var(--border); font-size: 14px; }
.notif-item { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); transition: background .15s; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--primary-light); }
.notif-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.notif-icon.type-info    { background: var(--primary-light); color: var(--primary); }
.notif-icon.type-success { background: #dcfce7; color: #16a34a; }
.notif-icon.type-warning { background: #fef9c3; color: #ca8a04; }
.notif-icon.type-danger  { background: #fee2e2; color: #dc2626; }
.notif-title { font-weight: 600; font-size: 13px; }
.notif-msg  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 11px; color: #94a3b8; margin-top: 3px; }
.notif-footer { text-align: center; padding: 10px; font-size: 13px; color: var(--primary); border-top: 1px solid var(--border); }

/* ── Main Content ──────────────────────────────────────── */
#main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Page Header ───────────────────────────────────────── */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header-left h1 { font-size: 21px; font-weight: 800; margin: 0; }
.page-header-left p  { color: var(--text-muted); font-size: 13px; margin: 3px 0 0; }
.page-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Cards ─────────────────────────────────────────────── */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--white); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 14px 18px; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.card-header .card-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 700; }
.card-body { padding: 18px; }
.card-footer { background: var(--bg); border-top: 1px solid var(--border); padding: 12px 18px; border-radius: 0 0 var(--radius) var(--radius); }

/* ── Stat Cards ─────────────────────────────────────────── */
.stat-card { border-radius: var(--radius); padding: 18px 20px; position: relative; overflow: hidden; border: 1px solid transparent; }
.stat-card.primary    { background: var(--primary); color: #fff; }
.stat-card.cyan       { background: var(--cyan); color: #fff; }
.stat-card.orange     { background: var(--orange); color: #fff; }
.stat-card.green      { background: #22c55e; color: #fff; }
.stat-card.light-blue { background: var(--primary-light); color: var(--primary); border-color: #c7d9fd; }
.stat-card.light-cyan { background: var(--cyan-light); color: #0e7490; border-color: #b3e8ef; }
.stat-card.light-orange{background: var(--orange-light); color: #c2410c; border-color: #fbd0b5; }
.stat-card.light-green{ background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.stat-label { font-size: 12px; font-weight: 600; opacity: .75; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.stat-icon  { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 42px; opacity: .12; pointer-events: none; }
.stat-sub   { font-size: 11.5px; font-weight: 500; margin-top: 8px; opacity: .7; }
.stat-trend { font-size: 12px; margin-top: 6px; font-weight: 600; }
.stat-trend.up   { color: #4ade80; }
.stat-trend.down { color: #f87171; }

/* ── Tables ─────────────────────────────────────────────── */
.table-modern thead th {
  background: #f8fafc; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted); border-bottom: 2px solid var(--border);
  padding: 10px 14px; white-space: nowrap;
}
.table-modern tbody td { vertical-align: middle; padding: 10px 14px; font-size: 13.5px; border-bottom: 1px solid #f1f5f9; }
.table-modern tbody tr:last-child td { border-bottom: none; }
.table-modern tbody tr:hover td { background: #fafbff; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }

/* ── Badges ─────────────────────────────────────────────── */
.badge-status { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .03em; display: inline-block; }
.badge-draft      { background: #f1f5f9; color: #64748b; }
.badge-pending    { background: #fef9c3; color: #854d0e; }
.badge-approved, .badge-complete, .badge-received, .badge-completed, .badge-confirmed, .badge-accepted { background: #dcfce7; color: #166534; }
.badge-rejected, .badge-cancelled, .badge-blacklisted, .badge-failed { background: #fee2e2; color: #991b1b; }
.badge-active     { background: #dcfce7; color: #166534; }
.badge-inactive   { background: #f1f5f9; color: #64748b; }
.badge-sent, .badge-processing { background: #e0f2fe; color: #0c4a6e; }
.badge-partially_received { background: #fef3c7; color: #92400e; }
.badge-discrepancy, .badge-evaluated { background: #fff7ed; color: #9a3412; }
.badge-low    { background: #f0fdf4; color: #15803d; }
.badge-medium { background: #eff6ff; color: #1d4ed8; }
.badge-high   { background: #fef9c3; color: #92400e; }
.badge-urgent { background: #fee2e2; color: #b91c1c; }
.badge-converted { background: #f5f3ff; color: #6d28d9; }
.badge-admin  { background: #f5f3ff; color: #7c3aed; }
.badge-manager { background: var(--cyan-light); color: #0e7490; }
.badge-finance { background: #dcfce7; color: #166534; }
.badge-requester { background: var(--primary-light); color: var(--primary); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-cyan  { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.btn-cyan:hover { background: #0891b2; border-color: #0891b2; color: #fff; }
.btn-orange{ background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-orange:hover { background: #ea6c00; color: #fff; }

/* ── Forms ──────────────────────────────────────────────── */
.form-control, .form-select { border-color: var(--border); font-size: 13.5px; border-radius: 8px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,110,245,.12); }
.form-label { font-weight: 600; font-size: 13px; color: var(--text); margin-bottom: 5px; }
.form-text  { font-size: 11.5px; color: var(--text-muted); }
.input-group-text { background: var(--bg); border-color: var(--border); font-size: 13px; }

/* ── Tabs ───────────────────────────────────────────────── */
.nav-tabs .nav-link { color: var(--text-muted); font-weight: 600; font-size: 13.5px; border: none; border-bottom: 2px solid transparent; padding: 10px 16px; }
.nav-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }
.nav-tabs .nav-link:hover { color: var(--text); }

/* ── Filter Bar ─────────────────────────────────────────── */
.filter-bar { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; }
.filter-bar .form-control, .filter-bar .form-select { height: 34px; font-size: 13px; }

/* ── Stars ──────────────────────────────────────────────── */
.stars { color: #fbbf24; letter-spacing: 1px; }

/* ── Timeline ───────────────────────────────────────────── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content:''; position:absolute; left:8px; top:6px; bottom:0; width:2px; background:var(--border); }
.timeline-item { position:relative; margin-bottom:18px; }
.timeline-dot { position:absolute; left:-24px; width:16px; height:16px; border-radius:50%; background:var(--primary); border:3px solid var(--white); box-shadow:0 0 0 2px var(--primary); top:2px; }
.timeline-dot.approved { background:var(--success); box-shadow:0 0 0 2px var(--success); }
.timeline-dot.rejected { background:var(--danger); box-shadow:0 0 0 2px var(--danger); }
.timeline-dot.submitted { background:var(--warning); box-shadow:0 0 0 2px var(--warning); }
.timeline-content { background:var(--white); border:1px solid var(--border); border-radius:10px; padding:10px 14px; }

/* ── Section headers ────────────────────────────────────── */
.section-head { background: var(--primary-light); color: var(--primary); border-left: 3px solid var(--primary); padding: 10px 16px; border-radius: 0 8px 8px 0; font-weight: 700; font-size: 13px; margin-bottom: 16px; }
.section-head.cyan   { background: var(--cyan-light); color: #0e7490; border-color: var(--cyan); }
.section-head.orange { background: var(--orange-light); color: #c2410c; border-color: var(--orange); }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align:center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 52px; opacity: .2; display: block; margin-bottom: 14px; }
.empty-state h5 { font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 13.5px; }

/* ── Alert / Flash ───────────────────────────────────────── */
.alert { border-radius: var(--radius); font-size: 13.5px; }

/* ── Login Page ──────────────────────────────────────────── */
.login-page { min-height: 100vh; background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f1e3a 100%); display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.login-page::before { content:''; position:absolute; width:600px; height:600px; background:radial-gradient(circle, rgba(27,110,245,.15) 0%, transparent 70%); top:-100px; left:-100px; }
.login-page::after  { content:''; position:absolute; width:400px; height:400px; background:radial-gradient(circle, rgba(6,182,212,.1) 0%, transparent 70%); bottom:-50px; right:-50px; }
.login-card { background: rgba(255,255,255,.03); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.1); border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 420px; position: relative; z-index: 1; }
.login-logo { width: 52px; height: 52px; background: var(--primary); border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 22px; margin: 0 auto 16px; box-shadow: 0 8px 24px rgba(27,110,245,.4); }
.login-title { color: #fff; font-size: 24px; font-weight: 800; text-align: center; }
.login-sub   { color: rgba(255,255,255,.45); font-size: 13.5px; text-align: center; margin-top: 4px; margin-bottom: 28px; }
.login-card .form-label { color: rgba(255,255,255,.75); }
.login-card .form-control { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15); color: #fff; border-radius: 10px; padding: 10px 14px; }
.login-card .form-control::placeholder { color: rgba(255,255,255,.3); }
.login-card .form-control:focus { background: rgba(255,255,255,.1); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,110,245,.25); color: #fff; }
.login-card .btn-primary { padding: 12px; font-weight: 700; border-radius: 10px; font-size: 15px; }
.login-demo { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 12px 16px; margin-top: 20px; }
.login-demo-title { color: rgba(255,255,255,.5); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.login-demo-item { display: flex; justify-content: space-between; color: rgba(255,255,255,.55); font-size: 12px; margin-bottom: 4px; }
.login-demo-item code { background: rgba(255,255,255,.1); color: rgba(255,255,255,.8); font-size: 11px; }

/* ── Page animations ─────────────────────────────────────── */
.fade-in { animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }

/* ── Print ───────────────────────────────────────────────── */
@media print {
  #sidebar, #topbar, .no-print { display: none !important; }
  #main { margin: 0 !important; padding: 0 !important; }
}

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 991px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #sidebar.open + #sidebar-overlay { display: block; }
  #topbar { left: 0; }
  #main   { margin-left: 0; padding: 16px; }
  .topbar-toggle { display: block; }
}
