/* Torba Asset Management - Complete Design System */

:root {
  --primary: #185fa5;
  --primary-hover: #145391;
  --primary-light: #e6f1fb;
  --success: #3b6d11;
  --success-light: #eaf3de;
  --warning: #854f0b;
  --warning-light: #faeeda;
  --danger: #a32d2d;
  --danger-light: #fcebeb;
  --purple: #534ab7;
  --purple-light: #eeedfe;
  --teal: #0f6e56;
  --teal-light: #e1f5ee;
  --pink: #993556;
  --pink-light: #fbeaf0;
  --coral: #993c1d;
  --coral-light: #faece7;
  --border: #e5e5e3;
  --bg: #f7f7f5;
  --bg-white: #ffffff;
  --text-dark: #1a1a1a;
  --text-muted: #888888;
  --text-secondary: #444444;
  --sidebar-width: 220px;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

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

/* ━━━━━━━━━━━━━━━━━ SIDEBAR ━━━━━━━━━━━━━━━━━ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  padding: 0;
}

.sidebar-logo {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .brand {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.sidebar-logo .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.sidebar-logo .version-tag {
  font-size: 10px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
  margin-top: 6px;
}

/* Keep existing sidebar structure compatibility */
.sidebar-brand-title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-dark);
  margin: 0 0 4px 0;
}

.sidebar-brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0 0 10px 0;
}

.sidebar-badge {
  display: inline-block;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #bbb;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 16px 16px 4px;
}

.sidebar-nav-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 16px 16px 4px;
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
  padding: 7px 16px;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.nav-link:hover {
  background: #f5f5f3;
  color: var(--text-dark);
  text-decoration: none;
}

.nav-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
  background: var(--primary-light);
}

.sidebar-nav-link {
  display: block;
  font-size: 13px;
  color: #555;
  padding: 7px 16px;
  margin: 0;
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.sidebar-nav-link:hover {
  background-color: #f5f5f3;
  color: var(--text-dark);
}

.sidebar-nav-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 600;
}

.sidebar-nav-group {
  padding: 0;
  margin: 20px 0 0 0;
}

/* ━━━━━━━━━━━━━━━━━ MAIN CONTENT ━━━━━━━━━━━━━━━━━ */
.main-content {
  margin-left: var(--sidebar-width);
  padding: 40px 48px;
  min-height: 100vh;
  max-width: calc(1200px + var(--sidebar-width));
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ━━━━━━━━━━━━━━━━━ BUTTONS ━━━━━━━━━━━━━━━━━ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--text-dark);
  border: 1px solid rgba(0,0,0,0.18);
}

.btn-secondary:hover {
  background: #f5f5f3;
  color: var(--text-dark);
}

.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #f09595;
}

.btn-danger:hover {
  background: var(--danger-light);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-danger-outline {
  background-color: white;
  border: 1px solid #f09595;
  color: var(--danger);
}

.btn-danger-outline:hover {
  background-color: var(--danger-light);
}

/* ━━━━━━━━━━━━━━━━━ STATS CARDS ━━━━━━━━━━━━━━━━━ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stats-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.stats-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stats-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
}

.stats-value.danger {
  color: var(--danger);
}

.stats-value.success {
  color: var(--success);
}

.stats-value.warning {
  color: var(--warning);
}

.stats-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Compatibility with old class names */
.stats-card-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.stats-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
}
.stats-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ━━━━━━━━━━━━━━━━━ FILTER BAR ━━━━━━━━━━━━━━━━━ */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.filter-label {
  font-size: 9px;
  font-weight: 700;
  color: #bbb;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.filter-input, .filter-select {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-dark);
  outline: none;
  transition: border 0.15s;
}

.filter-input:focus, .filter-select:focus {
  border-color: var(--primary);
}

.filter-search {
  width: 220px;
}

/* ━━━━━━━━━━━━━━━━━ TABLE ━━━━━━━━━━━━━━━━━ */
.data-table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  background: #fafaf8;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f5f5f3;
  vertical-align: middle;
  font-size: 13px;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: #fafaf8;
  cursor: pointer;
}

/* Compatibility with old table classes */
.asset-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.asset-table thead {
  background-color: #fafaf8;
}

.asset-table th {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  letter-spacing: 0.5px;
}

.asset-table td {
  font-size: 11px;
  padding: 9px 10px;
  border-bottom: 1px solid #f0f0f0;
}

.asset-table tbody tr:hover {
  background-color: #fafaf8;
  cursor: pointer;
}

.asset-table tbody tr:last-child td {
  border-bottom: none;
}

.asset-avatar {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 8px;
}

.asset-name {
  font-weight: 600;
  font-size: 13px;
}

.asset-id {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10px;
  color: var(--text-muted);
}

.location-fixed-text {
  font-style: italic;
  color: var(--text-muted);
  font-size: 12px;
}

/* ━━━━━━━━━━━━━━━━━ BADGES ━━━━━━━━━━━━━━━━━ */
.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge-it-laptop, .badge-it-screen-tablet,
.badge-it-peripheral-bundled, .badge-it-peripheral-pool {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-vehicle {
  background: var(--purple-light);
  color: var(--purple);
}

.badge-pos-terminal {
  background: var(--coral-light);
  color: var(--coral);
}

.badge-card-machine {
  background: var(--teal-light);
  color: var(--teal);
}

.badge-aggregator-tablet {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-kitchen-equipment {
  background: var(--success-light);
  color: var(--success);
}

.badge-mobile {
  background: var(--pink-light);
  color: var(--pink);
}

.badge-printer-scanner {
  background: #f0f0ee;
  color: #555;
}

.badge-furniture-individual,
.badge-furniture-bulk {
  background: #f0f0ee;
  color: #555;
}

.badge-status-active {
  background: var(--success-light);
  color: var(--success);
}

.badge-status-unassigned {
  background: #e8e8e6;
  color: #5f5e5a;
}

.badge-status-under-maintenance {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-status-transferred {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-status-retired {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-age-new {
  background: var(--success-light);
  color: var(--success);
}

.badge-age-refurbished {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-age-used {
  background: #e8e8e6;
  color: #5f5e5a;
}

.badge-age-own {
  background: var(--purple-light);
  color: var(--purple);
}

.badge-open {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-resolved {
  background: var(--success-light);
  color: var(--success);
}

.badge-superadmin {
  background: var(--purple-light);
  color: var(--purple);
}

.badge-ops-manager {
  background: var(--primary-light);
  color: var(--primary);
}

.badge-staff {
  background: #e8e8e6;
  color: #5f5e5a;
}

/* Compatibility with old badge names */
.badge-category {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

.badge-it {
  background-color: var(--primary-light);
  color: var(--primary);
}

.badge-vehicle {
  background-color: var(--purple-light);
  color: var(--purple);
}

.badge-pos {
  background-color: var(--coral-light);
  color: var(--coral);
}

.badge-card-machine {
  background-color: var(--teal-light);
  color: var(--teal);
}

.badge-aggregator {
  background-color: var(--warning-light);
  color: var(--warning);
}

.badge-kitchen {
  background-color: var(--success-light);
  color: var(--success);
}

.badge-mobile {
  background-color: var(--pink-light);
  color: var(--pink);
}

.badge-furniture {
  background-color: #f0f0f0;
  color: #555;
}

/* ━━━━━━━━━━━━━━━━━ STATUS DOT ━━━━━━━━━━━━━━━━━ */
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
  flex-shrink: 0;
}

.dot-active {
  background: #639922;
}

.dot-unassigned {
  background: #b4b2a9;
}

.dot-under-maintenance {
  background: #378add;
}

.dot-transferred {
  background: #ef9f27;
}

.dot-retired {
  background: #e24b4a;
}

/* ━━━━━━━━━━━━━━━━━ CONDITION BARS ━━━━━━━━━━━━━━━━━ */
.condition-bars {
  display: flex;
  align-items: center;
  gap: 2px;
}

.condition-bar {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #e8e8e6;
}

.condition-bar.filled-excellent,
.condition-bar.filled-good {
  background: #639922;
}

.condition-bar.filled-fair {
  background: #ef9f27;
}

.condition-bar.filled-poor {
  background: #e24b4a;
}

.condition-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 5px;
}

/* ━━━━━━━━━━━━━━━━━ ALERT BANNERS ━━━━━━━━━━━━━━━━━ */
.alert-banner {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.alert-banner-amber {
  background: var(--warning-light);
  border-left: 3px solid #ef9f27;
  color: var(--warning);
}

.alert-banner-red {
  background: var(--danger-light);
  border-left: 3px solid #e24b4a;
  color: var(--danger);
}

.alert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.alert-dot-amber {
  background: #ef9f27;
}

.alert-dot-red {
  background: #e24b4a;
}

/* Compatibility */
.alert-banner.amber {
  background-color: var(--warning-light);
  border-left: 3px solid var(--warning);
  color: var(--warning);
}

.alert-banner.red {
  background-color: var(--danger-light);
  border-left: 3px solid var(--danger);
  color: var(--danger);
}

/* ━━━━━━━━━━━━━━━━━ DETAIL PAGE LAYOUT ━━━━━━━━━━━━━━━━━ */
.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb-text {
  font-size: 12px;
  color: var(--text-muted);
}

.breadcrumb-text span {
  color: var(--text-dark);
  font-weight: 600;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
  align-items: start;
}

.detail-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.detail-card-header {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0ee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dark);
}

.detail-card-body {
  padding: 14px 16px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-item.span-2 {
  grid-column: span 2;
}

.info-item.span-3 {
  grid-column: span 3;
}

.info-label {
  font-size: 9px;
  font-weight: 700;
  color: #aaa;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.info-value {
  font-size: 12px;
  color: var(--text-dark);
}

.info-value.large {
  font-size: 16px;
  font-weight: 700;
}

.info-value.mono {
  font-family: 'SF Mono', monospace;
}

.info-value.success {
  color: var(--success);
  font-weight: 600;
}

.info-value.warning {
  color: var(--warning);
  font-weight: 600;
}

.info-value.danger {
  color: var(--danger);
  font-weight: 600;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid #f5f5f3;
  gap: 8px;
}

.info-row:last-child {
  border-bottom: none;
}

/* ━━━━━━━━━━━━━━━━━ DETAIL SIDEBAR CARDS ━━━━━━━━━━━━━━━━━ */
.sidebar-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.sidebar-card-title {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0ee;
}

.custodian-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.custodian-name {
  font-size: 13px;
  font-weight: 600;
}

.custodian-since {
  font-size: 11px;
  color: var(--text-muted);
}

.location-fixed-box {
  background: var(--bg);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.financials-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
}

.financials-label {
  color: var(--text-muted);
}

.financials-value {
  font-weight: 600;
}

.financials-divider {
  border: none;
  border-top: 1px solid #f0f0ee;
  margin: 6px 0;
}

.qr-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qr-box {
  width: 128px;
  height: 128px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafaf8;
  flex-shrink: 0;
  overflow: hidden;
}

.qr-box img {
  width: 120px;
  height: 120px;
  display: block;
}

/* ━━━━━━━━━━━━━━━━━ TABS ━━━━━━━━━━━━━━━━━ */
.detail-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  background: #fafaf8;
  padding: 0 16px;
}

.detail-tab {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #999;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.detail-tab:hover {
  color: var(--text-dark);
}

.detail-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-count {
  font-size: 9px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
}

.tab-count.danger {
  background: var(--danger-light);
  color: var(--danger);
}

.tab-content {
  padding: 0;
}

.history-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f5f5f3;
}

.history-item:last-child {
  border-bottom: none;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
}

.history-dot-blue {
  background: var(--primary);
}

.history-dot-gray {
  background: #ccc;
}

.history-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.history-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.history-date {
  font-size: 10px;
  color: #bbb;
  margin-top: 2px;
}

/* ━━━━━━━━━━━━━━━━━ ISSUE CARDS ━━━━━━━━━━━━━━━━━ */
.issue-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.issue-card.open {
  border-left: 3px solid #e24b4a;
}

.issue-card.resolved {
  border-left: 3px solid #639922;
  opacity: 0.85;
}

.issue-asset-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.issue-location {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.issue-description {
  font-size: 12px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 6px;
}

.issue-meta {
  font-size: 11px;
  color: #aaa;
}

.issue-meta b {
  color: var(--text-dark);
}

.issue-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.resolution-note {
  background: var(--success-light);
  border-radius: 5px;
  padding: 6px 10px;
  font-size: 11px;
  color: var(--success);
  margin-top: 6px;
}

/* ━━━━━━━━━━━━━━━━━ FORMS ━━━━━━━━━━━━━━━━━ */
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 720px;
  box-shadow: var(--shadow-sm);
}

.form-card-item-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 4px;
}

.form-card-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
}

.form-card-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.recent-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0ee;
}

.recent-item-row:last-child {
  border-bottom: none;
}

.recent-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.recent-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.assigned-shelf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.assigned-shelf-address {
  font-size: 14px;
  font-weight: 700;
  font-family: 'SF Mono', monospace;
  color: var(--text-dark);
}

.assigned-shelf-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.form-label {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
  display: block;
}

.form-control, .form-select, input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="datetime-local"], textarea, select {
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-dark);
  width: 100%;
  outline: none;
  transition: border 0.15s;
  background: #fff;
  font-family: inherit;
}

.form-control:focus, .form-select:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="number"]:focus, input[type="date"]:focus, input[type="datetime-local"]:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(24,95,165,0.08);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.form-group {
  margin-bottom: 16px;
}

/* ━━━━━━━━━━━━━━━━━ LOGIN PAGE ━━━━━━━━━━━━━━━━━ */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 44px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-tag {
  font-size: 10px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
  margin-top: 8px;
}

/* ━━━━━━━━━━━━━━━━━ LOCATION CARDS ━━━━━━━━━━━━━━━━━ */
.locations-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.location-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s;
}

.location-card:hover {
  box-shadow: var(--shadow);
}

.location-name {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.location-detail {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #555;
  margin-bottom: 5px;
}

.location-icon {
  font-size: 13px;
}

.location-asset-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f5f5f3;
  text-align: right;
}

/* ━━━━━━━━━━━━━━━━━ FLASH MESSAGES ━━━━━━━━━━━━━━━━━ */
.flash-message {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash-success {
  background: var(--success-light);
  color: var(--success);
  border-left: 3px solid #639922;
}

.flash-error {
  background: var(--danger-light);
  color: var(--danger);
  border-left: 3px solid #e24b4a;
}

.alert {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid;
}

.alert-success {
  background: var(--success-light);
  border-left-color: var(--success);
  color: var(--success);
}

.alert-error, .alert-danger {
  background: var(--danger-light);
  border-left-color: var(--danger);
  color: var(--danger);
}

.alert-warning {
  background: var(--warning-light);
  border-left-color: var(--warning);
  color: var(--warning);
}

.alert-info {
  background: var(--primary-light);
  border-left-color: var(--primary);
  color: var(--primary);
}

/* ━━━━━━━━━━━━━━━━━ MOBILE SCAN PAGE ━━━━━━━━━━━━━━━━━ */
.scan-page {
  min-height: 100vh;
  background: var(--bg);
}

.scan-header {
  background: var(--primary);
  padding: 20px 20px 24px;
  color: #fff;
}

.scan-brand {
  font-size: 11px;
  opacity: 0.75;
  margin-bottom: 10px;
}

.scan-asset-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.scan-asset-id {
  font-family: 'SF Mono', monospace;
  font-size: 11px;
  opacity: 0.65;
}

.scan-body {
  padding: 16px;
  max-width: 480px;
  margin: 0 auto;
}

.scan-alert-box {
  background: var(--danger-light);
  border-radius: var(--radius);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.scan-alert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e24b4a;
  flex-shrink: 0;
}

.scan-alert-text {
  font-size: 12px;
  color: var(--danger);
  font-weight: 600;
}

.scan-alert-sub {
  font-size: 10px;
  color: var(--danger);
  opacity: 0.8;
}

.scan-status-row {
  background: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.scan-info-rows {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}

.scan-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px solid #f5f5f3;
  font-size: 12px;
}

.scan-info-row:last-child {
  border-bottom: none;
}

.scan-info-label {
  color: var(--text-muted);
}

.scan-info-value {
  font-weight: 600;
}

.scan-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #aaa;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.scan-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-dark);
  transition: box-shadow 0.15s;
}

.scan-action-btn:hover {
  box-shadow: var(--shadow);
  color: var(--text-dark);
}

.scan-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}

.scan-action-icon.red {
  background: var(--danger-light);
}

.scan-action-icon.blue {
  background: var(--primary-light);
}

.scan-action-icon.purple {
  background: var(--purple-light);
}

.scan-action-title {
  font-size: 13px;
  font-weight: 600;
}

.scan-action-sub {
  font-size: 10px;
  color: var(--text-muted);
}

.scan-action-arrow {
  margin-left: auto;
  color: #ccc;
  font-size: 16px;
}

/* ━━━━━━━━━━━━━━━━━ EMPTY STATES ━━━━━━━━━━━━━━━━━ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state-text {
  font-size: 14px;
  font-weight: 500;
}

.empty-state-sub {
  font-size: 12px;
  margin-top: 4px;
}

/* ━━━━━━━━━━━━━━━━━ NOTIFICATIONS ━━━━━━━━━━━━━━━━━ */
.notif-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 9px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
}

.badge-amber {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-red {
  background: var(--danger-light);
  color: var(--danger);
}

/* ━━━━━━━━━━━━━━━━━ RESPONSIVE ━━━━━━━━━━━━━━━━━ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    padding: 20px 16px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .locations-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ━━━━━━━━━━━━━━━━━ PUBLIC LOGIN LAYOUT ━━━━━━━━━━━━━━━━━ */
.public-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

/* ━━━━━━━━━━━━━━━━━ WMS SPECIFIC ━━━━━━━━━━━━━━━━━ */
.shelf-address {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  background: #f0f0ee;
  color: #555;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

.stock-level-low {
  background: var(--danger-light) !important;
}

.stock-level-ok {
  background: var(--success-light) !important;
}

.badge-movement-in {
  background: var(--success-light);
  color: var(--success);
}

.badge-movement-out {
  background: var(--danger-light);
  color: var(--danger);
}

.badge-movement-transfer {
  background: var(--warning-light);
  color: var(--warning);
}

.badge-movement-adjustment {
  background: var(--primary-light);
  color: var(--primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 16px;
}

.dashboard-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.dashboard-section h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.qr-print-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  padding: 20px;
}

.qr-code-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.qr-code-label {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  font-family: 'SF Mono', monospace;
}

.qr-code-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: #f5f5f3;
  border: 1px dashed var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.qr-code-image {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.qr-code-image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-code-warehouse {
  font-size: 10px;
  color: var(--text-muted);
}

.module-selector-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 20px;
}

.module-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 32px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
}

.module-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.module-card-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.module-card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.module-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.form-container {
  max-width: 600px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.detail-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.detail-section h3 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.detail-section dl {
  margin: 0;
}

.detail-section dt {
  font-size: 10px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-top: 8px;
  margin-bottom: 3px;
}

.detail-section dd {
  font-size: 12px;
  color: var(--text-dark);
  margin: 0;
}

.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead {
  background: #f5f5f3;
  border-bottom: 1px solid var(--border);
}

.table th {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.table td {
  padding: 10px 12px;
  font-size: 12px;
  border-bottom: 1px solid #f5f5f3;
}

.table tbody tr:hover {
  background: #fafaf8;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.pagination {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  justify-content: center;
}

.pagination li {
  display: inline;
}

.pagination a, .pagination li.active {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
  color: var(--primary);
  border: 1px solid var(--border);
}

.pagination li.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* =============================================
   WMS — Shelf Visual Map Grid
   ============================================= */

.shelf-row-wrap {
  margin-bottom: 32px;
}

.shelf-row-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.shelf-grid-container {
  overflow-x: auto;
}

.shelf-grid-header,
.shelf-grid-row {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 4px;
}

.shelf-grid-header {
  margin-bottom: 6px;
}

.shelf-level-label-spacer {
  width: 32px;
  flex-shrink: 0;
}

.shelf-col-header {
  width: 52px;
  flex-shrink: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.shelf-level-label {
  width: 32px;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  padding-right: 6px;
}

.shelf-cell {
  width: 52px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
}

.shelf-cell:hover {
  opacity: 0.8;
}

.shelf-cell.occ {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.shelf-cell.low {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.shelf-cell.empty {
  background: #f3f4f6;
  color: #9ca3af;
  border: 1px dashed #d1d5db;
  cursor: default;
}

.shelf-cell.empty a {
  pointer-events: none;
}

.shelf-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.shelf-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.shelf-legend-dot,
.shelf-cell-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  display: inline-block;
}

.shelf-legend-dot.occ, .shelf-cell-dot.occ   { background: #d1fae5; border: 1px solid #6ee7b7; }
.shelf-legend-dot.low, .shelf-cell-dot.low   { background: #fef3c7; border: 1px solid #fcd34d; }
.shelf-legend-dot.empty, .shelf-cell-dot.empty { background: #f3f4f6; border: 1px dashed #d1d5db; }

.shelf-row-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  padding-right: 8px;
  white-space: nowrap;
}

/* =============================================
   WMS — Shelf Detail: Low-stock row
   ============================================= */

.row-low-stock td {
  background: #fffbeb !important;
}

.row-low-stock:hover td {
  background: #fef3c7 !important;
}

/* =============================================
   WMS — Receive Wizard Steps
   ============================================= */

.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  gap: 8px;
}

.wizard-step {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: #f3f4f6;
  text-align: center;
  border: 1px solid var(--border);
}

.wizard-step.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}

.wizard-step.done {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

.wizard-arrow {
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
}

/* =============================================
   WMS — Mobile Scan Page
   ============================================= */

.mobile-scan-header {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.mobile-scan-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.mobile-scan-header p {
  margin: 0;
  opacity: 0.8;
  font-size: 13px;
}

.mobile-scan-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.mobile-scan-actions .btn {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  border-radius: 8px;
}

.mobile-inline-form {
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.mobile-inline-form h5 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 14px;
}

/* =============================================
   WMS — Alert Badge / Dashboard Banner
   ============================================= */

.wms-alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  margin-bottom: 20px;
  color: #92400e;
  font-size: 14px;
}

.wms-alert-banner .wms-alert-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.wms-alert-banner a {
  color: #92400e;
  font-weight: 600;
}
