/* Admin SPA — sidebar layout matching AI Studio */
.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }
.admin-top {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 10px 20px; display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 38px; height: 38px; background: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; }
.brand .logo img { width: 32px; height: 32px; object-fit: contain; }
.brand h1 { font-size: 14px; font-weight: 800; }
.brand h1 span { color: var(--primary); font-weight: 600; }
.brand p { font-size: 10px; color: var(--muted); letter-spacing: .3px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 20px; background: var(--primary-light); color: var(--primary); }
.pill.live { background: #E8F5EE; color: #15803D; }
.pill.warn { background: #FEF3C7; color: #92400E; }
.search { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; font-family: inherit; min-width: 220px; }
.search.sm { min-width: 160px; padding: 6px 10px; }
.admin-body { display: flex; flex: 1; min-height: 0; }
.sidebar { width: 240px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border); padding: 16px 12px; display: flex; flex-direction: column; }
.side-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .5px; padding: 0 10px 8px; }
.side-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 11px 12px; border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; margin-bottom: 4px; }
.side-btn:hover { background: var(--primary-light); }
.side-btn.active { background: var(--primary); color: #fff; }
.side-btn .badge { margin-left: auto; background: #FEF3C7; color: #92400E; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; }
.side-btn.active .badge { background: rgba(255,255,255,.25); color: #fff; }
.side-foot { margin-top: auto; padding: 12px 10px 0; font-size: 11px; border-top: 1px solid var(--border); }
.side-foot .muted { color: var(--muted); margin-top: 4px; }
.side-foot .iso { color: var(--primary); font-weight: 700; margin-top: 4px; }
.admin-main { flex: 1; padding: 20px 24px 60px; min-width: 0; }
.view { display: none; }
.view.active { display: block; }
.mod-tag { font-size: 12px; font-weight: 700; color: var(--warn); letter-spacing: .3px; margin-bottom: 4px; }
.view-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.view-head h2 { font-size: 22px; font-weight: 800; }
.view-head .pill, .view-head .btn { margin-left: auto; }
.officer-bar { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.officer-bar input { border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; font-family: inherit; font-size: 14px; min-width: 240px; margin-left: 8px; }
/* Kelulusan cards */
.kel-list { display: flex; flex-direction: column; gap: 12px; }
.kel-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.kel-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.kel-id { font-size: 12px; font-weight: 700; background: #F3F4F6; padding: 3px 10px; border-radius: 6px; }
.kel-title { font-weight: 700; font-size: 15px; }
.kel-date { margin-left: auto; font-size: 13px; color: var(--muted); }
.kel-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; font-size: 13px; }
.kel-grid .lbl { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.kel-grid .big { font-size: 16px; font-weight: 800; }
.kel-grid .rm { color: var(--primary); font-weight: 800; }
.kel-actions { display: flex; gap: 8px; margin-top: 12px; }
/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat .t { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 800; margin: 2px 0; }
.stat .v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat .s { font-size: 12px; color: var(--muted); }
.stat .s.ok { color: #15803D; font-weight: 600; }
/* Urus setia columns */
.us-cols { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { font-size: 15px; }
.clock { text-align: right; font-size: 11px; color: var(--muted); }
.clock b { font-size: 18px; color: var(--text); }
/* Timeline */
.tl-item { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.tl-item:hover { border-color: var(--primary); }
.tl-time { text-align: center; min-width: 64px; }
.tl-time b { display: block; font-size: 15px; }
.tl-time span { font-size: 10px; color: var(--muted); font-weight: 700; }
.tl-body { flex: 1; }
.tl-body h4 { font-size: 14px; }
.tl-body p { font-size: 12px; color: var(--muted); }
.tl-status { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; align-self: flex-start; }
.st-selesai { background: #DCFCE7; color: #15803D; }
.st-disaji { background: #DBEAFE; color: #1D4ED8; }
.st-persediaan { background: #FEF3C7; color: #92400E; }
.st-dijadualkan { background: #F3F4F6; color: #4B5563; }
.st-pending { background: #FEF3C7; color: #92400E; }
.st-approved { background: #DCFCE7; color: #15803D; }
.st-rejected { background: #FEE2E2; color: #B91C1C; }
/* Ticket */
.ticket-card { background: linear-gradient(180deg, #0F5132 0%, #0B3D26 130px, #fff 130px); color: #fff; }
.ticket-head { font-weight: 800; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.ticket-logo { width: 24px; height: 24px; object-fit: contain; background: #fff; border-radius: 6px; }
.rasmi { background: #25D366; font-size: 10px; padding: 2px 8px; border-radius: 6px; margin-left: auto; }
.ticket-card .muted.sm { color: rgba(255,255,255,.75); font-size: 11px; }
.doc-label { font-size: 10px; letter-spacing: 1px; opacity: .8; margin-top: 10px; }
.ticket-card h3 { font-size: 17px; margin-bottom: 10px; }
#ticketBody { background: #fff; color: var(--text); border-radius: 8px; padding: 12px; font-size: 13px; min-height: 120px; }
#ticketBody .row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px dashed var(--border); }
#ticketBody .row:last-child { border: 0; }
/* Tables */
.filters { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; align-items: center; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 16px; padding: 6px 14px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11px; color: var(--muted); letter-spacing: .3px; padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:hover td { background: #FAFAFA; }
/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal.hidden { display: none; }
.modal-box { background: #fff; border-radius: 14px; padding: 24px; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-box.wide { max-width: 720px; }
.modal-x { position: absolute; top: 12px; right: 12px; border: 0; background: #F3F4F6; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 14px; }
.qc-row { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.qc-btn { border: 2px solid var(--border); background: #fff; border-radius: 10px; padding: 8px 14px; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.qc-btn.on { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
select.inline { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-family: inherit; font-size: 13px; }
@media (max-width: 900px) {
  /* Burger button */
  .burger { display: flex !important; }
  /* Sidebar becomes slide-in drawer */
  .admin-body { position: relative; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 260px; z-index: 150;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: none;
    padding-top: 20px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.2); }
  .side-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 140;
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .side-backdrop.show { opacity: 1; pointer-events: auto; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .us-cols { grid-template-columns: 1fr; }
  .kel-grid { grid-template-columns: 1fr; }
  .admin-top { padding: 8px 12px; gap: 8px; }
  .brand h1 { font-size: 12px; }
  .brand p { display: none; }
  .search { min-width: 0; width: 100%; }
  .top-right { width: 100%; }
  .pill.live { font-size: 11px; }
}
/* Burger hidden on desktop */
.burger {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; font-size: 20px; cursor: pointer; flex-shrink: 0;
}
@media print {
  .sidebar, .admin-top, .view-head .btn, .filters, .officer-bar { display: none !important; }
  .view { display: none; } #view-urusetia { display: block; }
}
/* Login overlay */
.login-overlay { position: fixed; inset: 0; background: linear-gradient(135deg, #0B3D26, #0F5132); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.login-overlay.hidden { display: none; }
.login-box { background: #fff; border-radius: 16px; padding: 32px 28px; max-width: 360px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-logo img { max-width: 220px; width: 100%; height: auto; border-radius: 8px; }
.login-box h2 { font-size: 22px; margin: 8px 0 2px; }
.login-box label { display: block; text-align: left; font-size: 13px; font-weight: 700; margin-top: 14px; }
.login-input { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: 15px; margin-top: 6px; }
.login-btn { width: 100%; margin-top: 18px; padding: 12px; font-size: 15px; }
.login-err { color: var(--danger); font-size: 13px; font-weight: 600; margin-top: 10px; }
.login-err.hidden { display: none; }
.back-link { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--primary); text-decoration: none; font-weight: 600; }
