@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700&family=Inter&family=Playfair+Display&display=swap');

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}
h1 { font-size: 48px; line-height: 1.2; }
h2 { font-size: 35px; line-height: 1.2; }
h3 { font-size: 30px; line-height: 1.2; }
h4 { font-size: 23px; line-height: 1.5; }
h5 { font-size: 20px; line-height: 1.5; }
h6 { font-size: 17px; line-height: 1.5; }

p {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.875;
  font-weight: 400;
}

blockquote {
  font-family: 'Playfair Display', serif;
  font-size: 19px;
  line-height: 1.52;
  font-weight: 400;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

body {
  font-family: 'Outfit', sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  font-size: 14px;
  line-height: 1.6;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f0f2f5; border-radius: 10px; }
::-webkit-scrollbar-thumb { background: #214991; border-radius: 10px; border: 2px solid #f0f2f5; }
::-webkit-scrollbar-thumb:hover { background: #1a3a7a; }
* { scrollbar-width: thin; scrollbar-color: #214991 #f0f2f5; }

/* === Button Primary === */
.button-primary {
  color: #214991;
  letter-spacing: .07em;
  text-transform: uppercase;
  background-color: #ffc801;
  border-radius: 5px;
  padding: 21px 31px;
  font-size: 13px;
  font-weight: 600;
  line-height: 15px;
  text-decoration: none;
  transition: all .2s;
  display: inline-block;
}
.button-primary.button-type-two {
  color: #fff;
  background-color: #44c1d7;
  align-self: center;
}

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 18px; border: 1px solid transparent;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: all 0.2s;
  text-align: center; white-space: nowrap; letter-spacing: 0.3px;
}
.btn:hover { text-decoration: none; }
.btn-primary   { background:#ecf9fb; color:#214991; border-color:#b2e8f0; }
.btn-primary:hover   { background:#214991; color:#fff; }
.btn-success   { background:#e8f5e9; color:#2e7d32; border-color:#c8e6c9; }
.btn-success:hover   { background:#2e7d32; color:#fff; }
.btn-danger    { background:#fce4ec; color:#c62828; border-color:#f8bbd0; }
.btn-danger:hover    { background:#c62828; color:#fff; }
.btn-warning   { background:#fff8e1; color:#b38600; border-color:#ffe082; }
.btn-warning:hover   { background:#ffc801; color:#fff; }
.btn-secondary { background:#f5f5f5; color:#6a7893; border-color:#e0e0e0; }
.btn-secondary:hover { background:#6a7893; color:#fff; }
.btn-ghost     { background:transparent; color:#666; border:1px solid #ddd; }
.btn-ghost:hover     { background:#f5f5f5; }
.btn-white     { background:white; color:#214991; font-weight:700; border:none; padding:8px 18px; border-radius:6px; font-size:13px; cursor:pointer; transition:background .2s; text-decoration:none; }
.btn-white:hover     { background:#ecf9fb; }
.btn-sm  { padding:5px 12px; font-size:12px; border-radius:6px; }
.btn-lg  { padding:12px 28px; font-size:15px; }
.btn-block { display:block; width:100%; justify-content:center; }
.btn-outline { background:transparent; border:1px solid rgba(255,255,255,.5); color:#fff; }
.btn-outline:hover { background:rgba(255,255,255,.1); }

/* === Alerts === */
.alert { padding:12px 16px; border-radius:6px; margin-bottom:16px; font-size:14px; }
.alert-success { background:#e8f5e9; color:#2e7d32; border-left:4px solid #2e7d32; }
.alert-danger  { background:#ffebee; color:#c62828; border-left:4px solid #c62828; }
.alert-warning { background:#fff8e1; color:#b38600; border-left:4px solid #ffc801; }
.alert-info    { background:#ecf9fb; color:#214991; border-left:4px solid #44c1d7; }

/* === Badges === */
.badge { display:inline-block; padding:2px 8px; border-radius:4px; font-size:11px; font-weight:700; }
.badge-success   { background:#e8f5e9; color:#2e7d32; }
.badge-warning   { background:#fff8e1; color:#b38600; }
.badge-danger    { background:#ffebee; color:#c62828; }
.badge-primary   { background:#ecf9fb; color:#214991; }
.badge-secondary { background:#eef0f5; color:#6a7893; }
.badge-info      { background:#ecf9fb; color:#44c1d7; }
.badge-pending   { background:#fff8e1; color:#b38600; }
.badge-approved  { background:#e8f5e9; color:#2e7d32; }
.badge-rejected  { background:#ffebee; color:#c62828; }
.badge-transferred { background:#ecf9fb; color:#214991; }

/* === Public pages === */
.public-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #214991 0%, #44c1d7 100%);
  padding: 24px 16px 48px;
}
.public-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 32px 28px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.public-card-header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 2px solid #ecf9fb;
}
.public-card-header .pub-icon { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.public-card-header h1 { font-size: 22px; color: #214991; font-weight: 700; }
.public-card-header p  { font-size: 13px; color: #6a7893; margin-top: 4px; }
.public-links { text-align:center; margin-top:16px; }
.public-links a { color:rgba(255,255,255,.8); font-size:13px; text-decoration:none; margin:0 10px; }
.public-links a:hover { color:#fff; text-decoration:underline; }

/* Success screen */
.success-screen { text-align:center; padding:24px 0; }
.success-screen .success-icon { font-size:3rem; display:block; margin-bottom:12px; }
.success-screen h2 { font-size:20px; color:#2e7d32; font-weight:700; margin-bottom:8px; }
.success-screen p  { font-size:14px; color:#666; margin-bottom:20px; }

/* === Login === */
.login-card { background:#fff; border-radius:12px; box-shadow:0 8px 32px rgba(0,0,0,0.18); padding:36px 32px; width:100%; max-width:400px; margin:0 auto; }
.login-card-header { text-align:center; margin-bottom:28px; }
.login-card-header .login-icon { font-size:2.4rem; }
.login-card-header h1 { font-size:22px; color:#214991; margin-top:8px; font-weight:700; }
.login-card-header p  { font-size:13px; color:#6a7893; margin-top:4px; }
.password-wrapper { position:relative; display:flex; align-items:center; }
.password-wrapper input { width:100%; padding-right:42px; }
.password-toggle { position:absolute; right:10px; background:none; border:none; cursor:pointer; color:#6a7893; padding:0; display:flex; align-items:center; }
.password-toggle:hover { color:#214991; }

/* === NAVBAR === */
.navbar {
  background: #214991; color: white;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: sticky; top: 0; z-index: 100;
}
.nav-brand { display:flex; align-items:center; gap:8px; }
.nav-title  { font-size:16px; font-weight:700; color:white; }
.nav-hamburger { display:none; background:none; border:none; color:white; font-size:20px; cursor:pointer; padding:0 8px 0 0; }
.nav-actions { display:flex; gap:.6rem; align-items:center; }

/* === APP LAYOUT === */
.app-layout { display:flex; min-height:calc(100vh - 56px); }

/* === SIDEBAR === */
.sidebar {
  width: 230px; flex-shrink: 0;
  background: white; border-right: 1px solid #ecf9fb;
  position: sticky; top: 56px; height: calc(100vh - 56px);
  overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar-head { display:none; }
.sidebar-inner { padding:16px 0 8px; flex:1; overflow-y:auto; }
.sidebar-footer { flex-shrink:0; padding:0 0 12px; }
.sidebar-user { display:flex; align-items:center; gap:7px; padding:10px 16px 8px; flex-wrap:wrap; }
.sidebar-user-name { font-size:13px; font-weight:600; color:#1a1a2e; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-role-badge { font-size:10px; font-weight:700; color:white; padding:2px 8px; border-radius:20px; letter-spacing:.03em; text-transform:uppercase; flex-shrink:0; }
.sidebar-action-btn { display:flex; align-items:center; gap:8px; width:calc(100% - 24px); margin:3px 12px 0; padding:7px 12px; border-radius:6px; font-size:13px; font-weight:500; text-decoration:none; color:#444; background:#ecf9fb; border:none; cursor:pointer; transition:background .15s; text-align:left; box-sizing:border-box; }
.sidebar-action-btn:hover { background:#d0f0f7; color:#214991; text-decoration:none; }
.sidebar-action-btn.active { background:#d0f0f7; color:#214991; font-weight:700; }
.sidebar-action-signout { color:#b91c1c; }
.sidebar-action-signout:hover { background:#fff5f5; color:#b91c1c; }
.sidebar-section-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:#aaa; padding:0 16px 6px; margin-top:8px; }
.sidebar-divider { border-top:1px solid #f0f0f0; margin:10px 0 14px; }
.sidebar-item { display:flex; align-items:center; gap:9px; padding:8px 16px; text-decoration:none; color:#444; font-size:13px; font-weight:500; border-left:3px solid transparent; transition:background .15s,color .15s; }
.sidebar-item:hover { background:#ecf9fb; color:#214991; text-decoration:none; }
.sidebar-item.active { background:#d0f0f7; color:#214991; font-weight:700; border-left-color:#214991; }
.sidebar-icon  { font-size:15px; flex-shrink:0; }
.sidebar-label { flex:1; }
.sidebar-count { font-size:11px; font-weight:700; background:#ecf9fb; color:#214991; padding:1px 7px; border-radius:20px; min-width:22px; text-align:center; }
.sidebar-item.active .sidebar-count { background:#214991; color:white; }
.sidebar-backdrop { position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:199; opacity:0; pointer-events:none; transition:opacity .3s; }
.sidebar-backdrop.show { opacity:1; pointer-events:auto; }

/* === MAIN CONTENT === */
.main-content { flex:1; min-width:0; padding:20px 20px 32px; overflow-x:hidden; }

/* === PAGE HEADER === */
.page-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; flex-wrap:wrap; gap:10px; }
.page-header h1 { font-size:20px; font-weight:700; color:#214991; }
.page-header-meta { font-size:12px; color:#999; margin-top:2px; }

/* === STATS GRID === */
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:14px; margin-bottom:24px; }
.stat-card { --c:#6a7893; background:var(--c); border-radius:8px; padding:16px 18px; color:white; position:relative; overflow:hidden; }
.stat-card::after { content:""; position:absolute; inset:0; background:linear-gradient(135deg,rgba(255,255,255,.14),transparent 60%); pointer-events:none; }
.stat-card.stat-blue   { --c:#214991; }
.stat-card.stat-green  { --c:#2e7d32; }
.stat-card.stat-orange { --c:#ffc801; }
.stat-card.stat-red    { --c:#c62828; }
.stat-card.stat-teal   { --c:#44c1d7; }
.stat-card.stat-grey   { --c:#6a7893; }
.stat-value { font-size:26px; font-weight:700; line-height:1; }
.stat-label { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.5px; opacity:.85; margin-top:4px; }

/* === FILTERS === */
.filters { margin-bottom:14px; }
.filter-form { display:flex; gap:8px; flex-wrap:wrap; }
.filter-input, .filter-select {
  padding:7px 10px; border:1px solid #ddd; border-radius:6px;
  font-size:13px; background:white; outline:none; transition:border .2s; font-family:inherit;
}
.filter-input:focus, .filter-select:focus { border-color:#214991; }
.filter-input { flex:1; min-width:180px; }

/* === TABLE CARD === */
.admin-card { background:white; border-radius:10px; box-shadow:0 1px 4px rgba(0,0,0,.08); overflow:hidden; }
.table-responsive { overflow-x:auto; }
.table { width:100%; border-collapse:collapse; }
.table th { background:#ecf9fb; color:#555; font-size:12px; font-weight:600; text-transform:uppercase; letter-spacing:.4px; padding:10px 14px; border-bottom:2px solid #d0f0f7; text-align:left; white-space:nowrap; }
.table td { padding:10px 14px; border-bottom:1px solid #f0f0f0; vertical-align:middle; }
.table tr:hover td { background:#f5fdff; }
.table tr:last-child td { border-bottom:none; }
.empty-cell { text-align:center; padding:40px; color:#999; }
.muted { color:#6a7893; font-size:13px; }
.actions { display:flex; gap:6px; font-size:15px; align-items:center; }
.actions a, .actions button { text-decoration:none; cursor:pointer; transition:transform .1s; background:none; border:none; font-size:inherit; padding:0; }
.actions a:hover, .actions button:hover { transform:scale(1.2); }

/* Checkbox column */
.cb-col { width:36px; text-align:center; }

/* === STATUS === */
.status { display:inline-block; padding:2px 10px; border-radius:20px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.3px; }
.status-pending     { background:#fff8e1; color:#b38600; }
.status-approved    { background:#e8f5e9; color:#2e7d32; }
.status-rejected    { background:#ffebee; color:#c62828; }
.status-transferred { background:#ecf9fb; color:#214991; }
.status-returned    { background:#f3e5f5; color:#6a1b9a; }
.status-good   { background:#e8f5e9; color:#2e7d32; }
.status-repair { background:#fff8e1; color:#b38600; }
.status-scrap  { background:#ffebee; color:#c62828; }

/* === FORMS === */
.form-grid   { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
.form-group  { display:flex; flex-direction:column; gap:4px; }
.form-group.full { grid-column:1/-1; }
.form-group label { font-size:12px; font-weight:600; color:#555; text-transform:uppercase; letter-spacing:.3px; }
.form-group input,
.form-group select,
.form-group textarea { padding:8px 12px; border:1px solid #ddd; border-radius:6px; font-size:13px; font-family:inherit; outline:none; transition:border .2s; background:white; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color:#214991; box-shadow:0 0 0 2px rgba(33,73,145,.08); }
.form-section { margin-bottom:24px; }
.form-section-title { font-size:13px; font-weight:700; color:#214991; text-transform:uppercase; letter-spacing:.5px; padding-bottom:8px; border-bottom:2px solid #ecf9fb; margin-bottom:16px; }
.form-actions { display:flex; gap:12px; margin-top:20px; flex-wrap:wrap; }
.form-group-login { margin-bottom:16px; }
.form-group-login label { display:block; font-size:13px; font-weight:600; color:#6a7893; margin-bottom:5px; }
.form-group-login input { width:100%; padding:9px 12px; border:1px solid #cfd8dc; border-radius:6px; font-size:14px; font-family:inherit; outline:none; transition:border-color .2s; }
.form-group-login input:focus { border-color:#214991; box-shadow:0 0 0 2px rgba(33,73,145,.1); }

/* === Items table in submission form === */
.items-table { width:100%; border-collapse:collapse; margin-top:4px; font-size:13px; }
.items-table th { background:#ecf9fb; color:#444; font-size:11px; font-weight:700; text-transform:uppercase; padding:8px 10px; border:1px solid #d0f0f7; text-align:left; }
.items-table td { border:1px solid #e8e8e8; padding:5px 8px; vertical-align:middle; }
.items-table .qty-input { width:70px; padding:4px 6px; border:1px solid #ddd; border-radius:4px; font-size:13px; text-align:center; }
.items-table .qty-input:focus { border-color:#214991; outline:none; }
.items-table .col-sl { width:36px; text-align:center; color:#999; font-weight:600; }
.items-table .col-qty { width:80px; text-align:center; }
.items-table .col-remove { width:36px; text-align:center; }
.items-table .remove-btn { background:none; border:none; color:#c62828; cursor:pointer; font-size:16px; line-height:1; padding:0; }

/* === PAGINATION === */
.pagination-bar { display:flex; justify-content:space-between; align-items:center; padding:12px 16px; background:#fff; border-radius:10px; box-shadow:0 1px 4px rgba(0,0,0,.08); margin-top:12px; flex-wrap:wrap; gap:8px; }
.page-info { font-size:13px; color:#6a7893; }
.page-links { display:flex; gap:4px; flex-wrap:wrap; }
.page-btn { display:inline-flex; align-items:center; justify-content:center; min-width:36px; height:36px; padding:0 10px; border-radius:6px; border:1px solid #e0e0e0; background:white; color:#6a7893; text-decoration:none; font-size:13px; font-weight:500; transition:all .2s; cursor:pointer; }
.page-btn:hover { background:#ecf9fb; color:#214991; }
.page-btn.active { background:#214991; color:white; border-color:#214991; cursor:default; }
.page-btn.disabled { color:#bdbdbd; cursor:default; pointer-events:none; }
.page-ellipsis { padding:0 4px; color:#6a7893; font-size:14px; }

/* === MODAL === */
#modalOverlay {
  display: none; position:fixed; inset:0; background:rgba(0,0,0,.5);
  z-index:1000; align-items:center; justify-content:center; padding:16px;
}
#modalBox {
  background:white; border-radius:12px; width:100%; max-width:680px;
  max-height:90vh; display:flex; flex-direction:column;
  box-shadow:0 20px 60px rgba(0,0,0,.3);
}
#modalHeader { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid #ecf9fb; flex-shrink:0; }
#modalTitle  { font-size:16px; font-weight:700; color:#214991; }
#modalCloseBtn { background:none; border:none; font-size:22px; cursor:pointer; color:#666; line-height:1; padding:0 4px; }
#modalCloseBtn:hover { color:#c62828; }
#modalBody   { padding:20px; overflow-y:auto; flex:1; }
#modalFooter { padding:12px 20px; border-top:1px solid #f0f0f0; display:flex; justify-content:flex-end; gap:8px; flex-shrink:0; background:#fafafa; border-radius:0 0 12px 12px; }
#modalFooter:empty { display:none; }
.modal-loading { text-align:center; padding:40px; color:#999; }

/* Detail view inside modal */
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:0; }
.detail-field { padding:10px 14px; border-bottom:1px solid #f0f0f0; }
.detail-field:last-child { border-bottom:none; }
.detail-field label { font-size:11px; font-weight:600; color:#888; text-transform:uppercase; letter-spacing:.3px; display:block; margin-bottom:2px; }
.detail-field span  { font-size:14px; color:#1a1a2e; }
.detail-field.full  { grid-column:1/-1; }
.detail-header { background:#214991; color:white; padding:16px 20px; border-radius:8px; margin-bottom:16px; }
.detail-header h2 { font-size:16px; font-weight:700; }
.detail-header .sub { font-size:12px; opacity:.8; margin-top:2px; }

/* === INVENTORY LABELS === */
.label-grid { display:flex; flex-wrap:wrap; gap:12px; padding:16px; }
.inv-label {
  width: 200px; min-height: 90px;
  border-radius: 8px; padding: 10px 12px;
  color: white; position: relative; cursor:pointer;
  border: 2px solid transparent; transition: transform .15s, box-shadow .15s;
  display: flex; flex-direction: column; justify-content: space-between;
  user-select: none;
}
.inv-label:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(0,0,0,.2); }
.inv-label.selected { border-color:rgba(255,255,255,.9); box-shadow:0 0 0 3px rgba(0,0,0,.25); }
.inv-label-id   { font-size:13px; font-weight:800; letter-spacing:.5px; opacity:.9; }
.inv-label-name { font-size:14px; font-weight:700; margin-top:2px; line-height:1.3; }
.inv-label-loc  { font-size:10px; opacity:.8; margin-top:4px; }
.inv-label-qty  { font-size:11px; font-weight:600; opacity:.9; }
.inv-label-cat  { font-size:10px; text-transform:uppercase; letter-spacing:.5px; opacity:.7; }
.label-cb { position:absolute; top:6px; right:6px; width:16px; height:16px; accent-color:white; cursor:pointer; }

/* === PRINT === */
@media print {
  body > *:not(#printArea) { display:none !important; }
  #printArea { display:block !important; }
  .no-print { display:none !important; }

  .print-labels-page { padding:0; }
  .print-label-row { display:flex; flex-wrap:wrap; gap:8px; }
  .print-label {
    width:90mm; min-height:40mm; page-break-inside:avoid;
    border-radius:6px; padding:8px 10px; color:white;
    display:flex; flex-direction:column; justify-content:space-between;
    -webkit-print-color-adjust:exact; print-color-adjust:exact;
  }
  .print-label-id   { font-size:11pt; font-weight:800; }
  .print-label-name { font-size:13pt; font-weight:700; margin-top:2px; }
  .print-label-loc  { font-size:8pt; opacity:.9; margin-top:4px; }
}

/* === MOBILE === */
@media (max-width: 768px) {
  .nav-hamburger { display:block; }
  .sidebar {
    position: fixed; top:0; left:-230px; height:100vh;
    z-index:200; transition:left .3s; box-shadow:4px 0 20px rgba(0,0,0,.15);
  }
  .sidebar.open { left:0; }
  .sidebar-head { display:flex !important; }
  .form-grid, .form-grid-3, .detail-grid { grid-template-columns:1fr; }
  .stats-grid { grid-template-columns:repeat(2,1fr); }
  .table th:nth-child(n+4), .table td:nth-child(n+4) { display:none; }
  .page-header { flex-direction:column; align-items:flex-start; }
  .public-card { padding:24px 16px; }
  .inv-label { width:calc(50% - 6px); }
  #modalBox { max-width:100%; border-radius:8px; }
}
@media (max-width:480px) {
  .stats-grid { grid-template-columns:1fr; }
  .inv-label { width:100%; }
}
