/* ═══════════════════════════════════════════════════
   IT Management System — site.css
═══════════════════════════════════════════════════ */
:root {
  --sidebar-w: 255px;
  --sidebar-bg: #0f1b2d;
  --sidebar-hover: #1a2d47;
  --sidebar-active: #1e5799;
  --sidebar-text: #8fa8c8;
  --sidebar-text-bright: #cfe2ff;
  --topbar-h: 58px;
  --accent: #2d6a9f;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; background: #eef1f6; color: #1e2a3a; }

/* ── Sidebar ─────────────────────────────────────── */
#sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 1050;
  transition: width .25s ease;
  overflow: hidden;
}
#sidebar.collapsed { width: 62px; }

.sidebar-header { padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand i { font-size: 20px; color: #5ba4f5; flex-shrink: 0; }
#sidebar.collapsed .brand span { display: none; }

.sidebar-menu { list-style: none; margin: 8px 0; padding: 0; flex: 1; overflow-y: auto; overflow-x: hidden; }
.sidebar-menu a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  color: var(--sidebar-text); text-decoration: none;
  font-size: 13.5px; white-space: nowrap;
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.sidebar-menu a i { width: 20px; text-align: center; flex-shrink: 0; font-size: 14px; }
.sidebar-menu a:hover { background: var(--sidebar-hover); color: var(--sidebar-text-bright); }
.sidebar-menu li.active > a { background: var(--sidebar-active); color: #fff; border-left-color: #5ba4f5; }
.menu-header {
  padding: 14px 18px 4px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,.25); font-weight: 600; white-space: nowrap;
}
#sidebar.collapsed .menu-header,
#sidebar.collapsed .sidebar-menu span { display: none; }

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
  color: var(--sidebar-text); flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user i { color: var(--sidebar-text); flex-shrink: 0; }
.user-info { min-width: 0; }
.user-name  { font-size: 13px; font-weight: 600; color: #cfe2ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 11px; color: var(--sidebar-text); white-space: nowrap; }
#sidebar.collapsed .user-info { display: none; }

/* ── Content ─────────────────────────────────────── */
.wrapper { display: flex; }
#content { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .25s; }
#content.sidebar-collapsed { margin-left: 62px; }

/* ── Topbar ──────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: #fff; border-bottom: 1px solid #e8ecf0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: sticky; top: 0; z-index: 900;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-date { font-size: 12.5px; color: #6c757d; }

/* ── Page body ───────────────────────────────────── */
.page-body { padding: 22px 26px; flex: 1; }

/* ── Page header ─────────────────────────────────── */
.page-header {
  background: #fff; border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 20px;
  display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  box-shadow: var(--shadow);
}
.page-title  { font-size: 19px; font-weight: 700; color: #0f1b2d; margin: 0; }
.page-subtitle { font-size: 12.5px; color: #6c757d; margin: 3px 0 0; }

/* ── Stat cards ──────────────────────────────────── */
.stat-card {
  border-radius: var(--radius); padding: 20px 18px;
  color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.stat-icon { position: absolute; right: 14px; bottom: 10px; font-size: 46px; opacity: .18; }
.stat-num   { font-size: 30px; font-weight: 800; line-height: 1; }
.stat-lbl   { font-size: 12px; opacity: .85; margin-top: 4px; }

.bg-navy   { background: linear-gradient(135deg,#0f1b2d,#1e5799); }
.bg-teal   { background: linear-gradient(135deg,#0e5447,#1abc9c); }
.bg-amber  { background: linear-gradient(135deg,#7d4a00,#f39c12); }
.bg-crimson{ background: linear-gradient(135deg,#6e0e16,#e74c3c); }
.bg-violet { background: linear-gradient(135deg,#3b1f6e,#8e44ad); }
.bg-slate  { background: linear-gradient(135deg,#2c3e50,#4a6fa5); }

/* ── Cards ───────────────────────────────────────── */
.card { border: none; border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { background: #fff; border-bottom: 2px solid #f0f2f5; font-weight: 600; font-size: 14px; padding: 14px 18px; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-header i { margin-right: 8px; }

/* ── Tables ──────────────────────────────────────── */
.table { margin: 0; font-size: 13.5px; }
.table th { background: #f8f9fc; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: #6c757d; border-top: none; white-space: nowrap; }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #f3f7ff; }

/* ── Badges / Pills ──────────────────────────────── */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
/* Status */
.pill-pending   { background:#fff3cd; color:#856404; }
.pill-review    { background:#cce5ff; color:#004085; }
.pill-approved, .pill-completed { background:#d4edda; color:#155724; }
.pill-rejected, .pill-failed    { background:#f8d7da; color:#721c24; }
.pill-open      { background:#e2e3e5; color:#383d41; }
.pill-inprogress{ background:#d1ecf1; color:#0c5460; }
.pill-purchased { background:#d4edda; color:#0a4f38; }
/* Priority */
.pill-critical  { background:#6f1e1e; color:#fff; }
.pill-high      { background:#f8d7da; color:#721c24; }
.pill-medium    { background:#fff3cd; color:#856404; }
.pill-low       { background:#d4edda; color:#155724; }

/* ── Alert panel ─────────────────────────────────── */
.alert-panel {
  border-radius: var(--radius); padding: 14px 18px;
  background: #fff5f5; border-left: 5px solid #e74c3c;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.alert-panel .alert-title { font-weight: 700; color: #c0392b; font-size: 14px; }

/* ── Workflow timeline ────────────────────────────── */
.workflow { display: flex; flex-direction: column; gap: 0; }
.wf-step  { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px dashed #e9ecef; }
.wf-step:last-child { border-bottom: none; }
.wf-dot {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.wf-body { flex: 1; min-width: 0; }
.wf-label { font-size: 12px; font-weight: 600; color: #6c757d; text-transform: uppercase; letter-spacing: .4px; }
.wf-value { font-size: 13.5px; }

/* ── Forms ───────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 6px; border: 1.5px solid #d8dde4;
  font-size: 13.5px; transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: #2d6a9f; box-shadow: 0 0 0 3px rgba(45,106,159,.12);
}
.form-label { font-size: 13px; font-weight: 600; color: #495057; margin-bottom: 5px; }

/* ── Buttons ─────────────────────────────────────── */
.btn { border-radius: 6px; font-size: 13px; font-weight: 500; }
.btn-primary   { background: #2d6a9f; border-color: #2d6a9f; }
.btn-primary:hover { background: #1e4f7a; border-color: #1e4f7a; }

/* ── Login page ──────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f1b2d 0%, #1e5799 60%, #2d6a9f 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-box {
  background: #fff; border-radius: 12px; padding: 42px 40px;
  width: 100%; max-width: 410px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo i { font-size: 44px; color: #2d6a9f; }
.login-logo h2 { font-size: 21px; font-weight: 800; color: #0f1b2d; margin: 10px 0 4px; }
.login-logo p  { font-size: 12.5px; color: #6c757d; margin: 0; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 767px) {
  #sidebar { width: 62px; }
  #sidebar .brand span, #sidebar .menu-header, #sidebar .sidebar-menu span, #sidebar .user-info { display: none; }
  #content { margin-left: 62px; }
  .page-body { padding: 14px; }
  .stat-num { font-size: 24px; }
}

/* ── Global Search ────────────────────────────────── */
.global-search { position: relative; }
.search-dropdown {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: #fff; border: 1px solid #dee2e6; border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 9999;
    max-height: 360px; overflow-y: auto;
}
.search-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px; text-decoration: none; color: #1e2a3a;
    border-bottom: 1px solid #f0f2f5; transition: background .12s;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #f3f7ff; }
.search-icon { width: 28px; height: 28px; border-radius: 6px; background: #e8ecf5; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #2d6a9f; flex-shrink: 0; margin-top: 2px; }
.search-body { display: flex; flex-direction: column; min-width: 0; }
.search-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-meta  { font-size: 11px; color: #6c757d; margin-top: 2px; }

/* ── Topbar flex fix for search ───────────────────── */
.topbar { display: flex; align-items: center; gap: 10px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

/* ── File Upload Zone ────────────────────────────── */
.upload-zone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
    background: #fafbfc;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: #2d6a9f;
    background: #f0f7ff;
}
.upload-zone.drag-over { background: #e8f2ff; }
.upload-input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.upload-zone .img-thumbnail { border-radius: 6px; }

/* ── Attachment preview card ─────────────────────── */
.attachment-card {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; background: #f8f9fc;
    border: 1px solid #e2e6ea; border-radius: 8px;
}
.attachment-icon { font-size: 22px; color: #2d6a9f; flex-shrink: 0; }
.attachment-name { font-size: 13px; font-weight: 500; word-break: break-all; }
.attachment-meta { font-size: 11px; color: #6c757d; }

/* ── Inventory Column Filters ────────────────────────── */
.col-filter-row td {
    padding: 4px 6px !important;
    background: #f0f4f8;
    border-bottom: 2px solid #c9d8ea !important;
}
.col-filter-input {
    width: 100%;
    padding: 3px 6px;
    font-size: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    color: #333;
    height: 26px;
    box-sizing: border-box;
}
.col-filter-input:focus {
    outline: none;
    border-color: #2d6a9f;
    box-shadow: 0 0 0 2px rgba(45,106,159,.15);
}
.col-filter-select {
    width: 100%;
    padding: 2px 4px;
    font-size: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    height: 26px;
    box-sizing: border-box;
}
.col-filter-select:focus {
    outline: none;
    border-color: #2d6a9f;
}
.col-filter-input::placeholder { color: #adb5bd; font-style: italic; }

/* Highlight column when that filter is active */
.col-filter-input[value]:not([value=""]),
.col-filter-select option:checked:not([value=""]) {
    background: #e8f3ff;
    border-color: #2d6a9f;
}
.inventory-grid thead tr:first-child th {
    white-space: nowrap;
    font-size: 11.5px;
    letter-spacing: .03em;
}
