/* assets/style.css */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e2e0d8;
  --text: #1a1a18;
  --muted: #6b6a66;
  --radius: 8px;
  --radius-lg: 12px;
  --amber-bg: #FAEEDA; --amber: #633806; --amber-border: #BA7517;
  --red-bg: #FCEBEB;   --red: #791F1F;   --red-border: #A32D2D;
  --green-bg: #EAF3DE; --green: #27500A; --green-border: #3B6D11;
  --blue-bg: #E6F1FB;  --blue: #0C447C;  --blue-border: #185FA5;
  --purple-bg: #EEEDFE;--purple: #3C3489;
  --teal-bg: #E1F5EE;  --teal: #085041;
}

body { font-family: -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }

/* Navbar */
.navbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 2rem; display: flex; align-items: center; gap: 1.5rem; height: 56px; position: sticky; top: 0; z-index: 100; }
.nav-brand { font-weight: 600; font-size: 16px; color: var(--text); text-decoration: none; flex-shrink: 0; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-link { padding: 6px 12px; border-radius: var(--radius); font-size: 14px; color: var(--muted); text-decoration: none; }
.nav-link:hover, .nav-link.active { background: var(--bg); color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.nav-user { font-size: 13px; color: var(--muted); }
.nav-notif { position: relative; font-size: 18px; text-decoration: none; }
.notif-badge { position: absolute; top: -6px; right: -8px; background: var(--red-border); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 10px; font-weight: 600; }

/* Main layout */
.main-wrap { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-title { font-size: 22px; font-weight: 600; margin-bottom: 1.5rem; }
.footer { text-align: center; padding: 1.5rem; font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 3rem; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.card.urgent { border-left: 4px solid var(--amber-border); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }
.card.delayed { border-left: 4px solid var(--red-border); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; }

/* Metric grid */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 1.5rem; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.metric-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.metric-value { font-size: 28px; font-weight: 600; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.b-pending    { background: var(--blue-bg);   color: var(--blue); }
.b-approved   { background: var(--green-bg);  color: var(--green); }
.b-ordered    { background: var(--green-bg);  color: var(--green-border); }
.b-in_transit { background: var(--purple-bg); color: var(--purple); }
.b-delivered  { background: var(--green-bg);  color: #173404; }
.b-delayed    { background: var(--red-bg);    color: var(--red); }
.b-urgent     { background: var(--amber-bg);  color: var(--amber); }
.b-Workshop   { background: var(--teal-bg);   color: var(--teal); }
.b-Admin      { background: var(--purple-bg); color: var(--purple); }
.b-Finance    { background: var(--blue-bg);   color: var(--blue); }
.b-Other      { background: #F1EFE8;          color: #444; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; background: var(--surface); color: var(--text); transition: background .15s; }
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--text); color: var(--surface); border-color: transparent; }
.btn-primary:hover { opacity: .87; background: var(--text); }
.btn-danger { color: var(--red); border-color: var(--red-border); }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 1rem; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 1rem; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.alert-danger  { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border); }
.alert-warning { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.alert-info    { background: var(--blue-bg);  color: var(--blue);  border: 1px solid var(--blue-border); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; background: var(--surface); color: var(--text); }
.form-control:focus { outline: none; border-color: #888; box-shadow: 0 0 0 3px rgba(0,0,0,.06); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.required { color: var(--red); }

/* Toggle (urgent) */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.toggle-wrap.on { background: var(--amber-bg); border-color: var(--amber-border); }
.toggle-wrap .toggle-label { font-size: 14px; font-weight: 500; }
.toggle-wrap.on .toggle-label { color: var(--amber); }
.toggle-wrap .toggle-sub { font-size: 12px; color: var(--muted); }
.toggle-switch { width: 44px; height: 24px; border-radius: 12px; background: var(--border); position: relative; flex-shrink: 0; transition: background .2s; }
.toggle-switch.on { background: var(--amber-border); }
.toggle-switch::after { content: ''; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle-switch.on::after { transform: translateX(20px); }

/* Status progress bar */
.status-steps { display: flex; gap: 4px; margin-top: 10px; }
.step { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.step.done { background: var(--green-border); }
.step.active { background: var(--blue-border); }
.step.delayed { background: var(--red-border); }

/* Request list item */
.req-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.req-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.req-meta  { font-size: 13px; color: var(--muted); }
.req-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.req-delay { background: var(--red-bg); color: var(--red); font-size: 13px; padding: 8px 12px; border-radius: var(--radius); margin-top: 8px; }
.req-note  { background: var(--bg); color: var(--muted); font-size: 13px; padding: 8px 12px; border-radius: var(--radius); margin-top: 6px; }
.req-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; gap: 8px; }
.req-time { font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }

/* Filters */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 1.25rem; align-items: center; }
.filter-bar select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; background: var(--surface); color: var(--text); }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem 2.5rem; width: 100%; max-width: 400px; }
.login-title { font-size: 20px; font-weight: 600; margin-bottom: 0.25rem; }
.login-sub { font-size: 14px; color: var(--muted); margin-bottom: 1.5rem; }

/* Section header */
.sec-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.sec-title { font-size: 17px; font-weight: 600; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 2rem; color: var(--muted); font-size: 15px; }
.empty-state .icon { font-size: 40px; display: block; margin-bottom: .75rem; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }

/* Tabs */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; gap: 0; }
.tab { padding: 8px 16px; font-size: 14px; font-weight: 500; border: none; background: none; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; text-decoration: none; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }

@media (max-width: 640px) {
  .navbar { padding: 0 1rem; gap: 1rem; }
  .nav-links { display: none; }
  .main-wrap { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: 1fr 1fr; }
}
