/* DIGIMIT Postal Inventory & Asset Management System Styling */
:root {
  /* Color Palette */
  --primary: #d71920;
  --primary-hover: #b8141a;
  --primary-light: #fff0f1;
  --primary-glow: rgba(215, 25, 32, 0.2);
  --accent-gold: #fed000;
  --accent-gold-dark: #d9aa00;

  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-alt: #f1f5f9;
  --bg-muted: #e2e8f0;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-white: #ffffff;

  --border-light: #e2e8f0;
  --border-focus: #d71920;

  --success: #10b981;
  --success-bg: #ecfdf5;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --info: #3b82f6;
  --info-bg: #eff6ff;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 20px 40px rgba(15, 23, 42, 0.16);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

body.theme-dark {
  --bg-main: #090d16;
  --bg-surface: #111827;
  --bg-card: #141e33;
  --bg-alt: #1e293b;
  --bg-muted: #334155;

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border-light: #24324d;
  --border-focus: #ff4d58;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.5);
}

/* Global Reset & Box Sizing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Top System Navigation Bar */
.top-nav {
  height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon {
  width: 100%;
  height: 100%;
}

.brand-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.5px;
  color: var(--primary);
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.brand-subtext {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-status-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--bg-alt);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-chip:hover {
  background-color: var(--bg-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.green {
  background-color: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-dot.amber {
  background-color: var(--warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.queue-count-badge {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
}

.license-chip {
  background: linear-gradient(135deg, rgba(254, 208, 0, 0.15), rgba(215, 25, 32, 0.08));
  border-color: rgba(254, 208, 0, 0.4);
  color: var(--text-main);
}

.trial-countdown {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Workspace Layout */
.workspace-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
}

/* Sidebar Toggle Button */
.btn-sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 5px;
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  transition: all 0.2s ease;
}

.btn-sidebar-toggle:hover {
  background: var(--bg-alt);
  color: var(--primary);
  border-color: var(--primary);
}

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 16px 12px;
  overflow-y: auto;
  transition: width 0.22s ease, padding 0.22s ease;
}

.sidebar.collapsed {
  width: 68px;
  padding: 16px 6px;
}

.sidebar.collapsed .nav-group-title,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-footer {
  display: none !important;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .nav-icon {
  font-size: 18px;
  margin: 0;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: 12px 10px 4px 10px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}

.nav-item:hover {
  background-color: var(--bg-alt);
  color: var(--text-main);
  transform: translateX(2px);
}

.nav-item.active {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-item.highlight-btn {
  background-color: rgba(215, 25, 32, 0.06);
  color: var(--primary);
  border: 1px solid rgba(215, 25, 32, 0.2);
}

.nav-item.highlight-btn:hover {
  background-color: rgba(215, 25, 32, 0.12);
}

.nav-item.highlight-btn.active {
  background-color: var(--primary);
  color: #ffffff;
}

.nav-icon {
  font-size: 15px;
  line-height: 1;
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.system-status-indicator {
  display: flex;
  gap: 6px;
}

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

/* Content Stage */
.content-stage {
  flex: 1;
  background-color: var(--bg-main);
  overflow-y: auto;
  padding: 24px 32px 48px 32px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-main);
}

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

.page-actions {
  display: flex;
  gap: 10px;
}

/* Alert Banner */
.alert-banner {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 1px solid #f87171;
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.banner-icon {
  font-size: 24px;
}

.banner-content strong {
  color: #991b1b;
  font-size: 14px;
}

.banner-content p {
  color: #7f1d1d;
  font-size: 12px;
  margin-top: 2px;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.card-blue::before { background: #3b82f6; }
.kpi-card.card-emerald::before { background: #10b981; }
.kpi-card.card-purple::before { background: #8b5cf6; }
.kpi-card.card-amber::before { background: #f59e0b; }

.kpi-icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  flex-shrink: 0;
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin: 2px 0;
}

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

/* Grids */
.grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}

/* Content Cards */
.content-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

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

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

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

.card-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-surface);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-stat {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.data-table th {
  background-color: var(--bg-alt);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
  background-color: var(--bg-alt);
}

.empty-state {
  text-align: center;
  padding: 36px !important;
  color: var(--text-muted);
  font-style: italic;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  outline: none;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary-sm {
  background-color: var(--primary);
  color: #ffffff;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
}

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

.btn-outline {
  background-color: transparent;
  border-color: var(--border-light);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-alt);
  border-color: var(--text-muted);
}

.btn-outline-sm {
  background-color: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.btn-outline-sm:hover {
  background-color: var(--bg-alt);
  color: var(--text-main);
}

.btn-text-sm {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.btn-text-sm:hover {
  text-decoration: underline;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 9999px;
  white-space: nowrap;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-neutral { background: var(--bg-alt); color: var(--text-secondary); }
.badge-outline { border: 1px solid var(--border-light); color: var(--text-muted); }

/* Forms */
.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.col-3 { flex: 3; }
.col-4 { flex: 4; }
.col-6 { flex: 6; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label-inline {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input-sm, .form-select-sm {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-main);
  outline: none;
}

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

.section-divider {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--primary);
  margin: 18px 0 12px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  z-index: 210;
  border: 1px solid var(--border-light);
  animation: modalScaleIn 0.2s ease-out;
}

.modal-lg { max-width: 820px; }
.modal-xl { max-width: 960px; }

@keyframes modalScaleIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.97); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.modal-close:hover {
  background-color: var(--bg-alt);
  color: var(--text-main);
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-alt);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* Serial Numbers Checkbox List */
.serial-checklist-box {
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  background: var(--bg-alt);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.serial-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
}

.serial-check-item:hover {
  border-color: var(--primary);
}

/* Official Letter Document Sheet (A4 Styling) */
.letter-document-sheet {
  background: #ffffff;
  color: #111827;
  padding: 48px 56px;
  font-family: 'Times New Roman', Times, serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 600px;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.05);
}

.letter-official-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.dept-badge {
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #d71920;
}

.office-title {
  font-size: 18px;
  margin-top: 4px;
}

.office-sub {
  font-size: 13px;
  color: #4b5563;
}

.letter-meta-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 8px;
}

.letter-table-container table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-family: var(--font-family);
  font-size: 12px;
}

.letter-table-container th, .letter-table-container td {
  border: 1px solid #374151;
  padding: 8px 10px;
  text-align: left;
}

.letter-table-container th {
  background-color: #f3f4f6;
  font-weight: 700;
}

.letter-instructions ol {
  padding-left: 20px;
  margin-top: 6px;
}

.letter-instructions li {
  margin-bottom: 4px;
}

.letter-sign-block {
  margin-top: 40px;
  font-family: var(--font-family);
}

/* History Sheet Card */
.history-card-sheet {
  padding: 24px;
  background: var(--bg-surface);
}

.asset-badge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.asset-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.spec-box {
  background: var(--bg-alt);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}

.spec-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.spec-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.timeline-list {
  position: relative;
  padding-left: 24px;
  margin-top: 14px;
}

.timeline-list::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border-light);
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
}

/* Reports */
.report-selector-bar {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
}

.report-tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.report-tab-btn:hover {
  background: var(--bg-alt);
  color: var(--text-main);
}

.report-tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* License Center */
.license-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.license-info-card {
  display: flex;
  flex-direction: column;
}

.license-plan-name {
  font-size: 20px;
  font-weight: 800;
  margin-top: 10px;
}

.license-meta-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.license-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
}

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

.meta-value {
  font-size: 13px;
  color: var(--text-main);
}

.pricing-plans-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.plan-pill {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--bg-alt);
}

.plan-pill.popular {
  border-color: var(--primary);
  background: rgba(215, 25, 32, 0.04);
}

.plan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.plan-title {
  font-weight: 700;
  font-size: 13px;
}

.plan-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-muted);
}

.plan-tag.tag-primary {
  background: var(--primary);
  color: white;
}

.plan-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Key result box */
.key-result-box {
  background: var(--bg-alt);
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.key-result-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.key-result-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin: 6px 0;
  letter-spacing: 1px;
}

.token-pills-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.token-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.token-pill code {
  font-family: var(--font-mono);
  color: var(--primary);
  font-weight: 700;
  background: var(--bg-surface);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.alert-box-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: #92400e;
}

.sync-summary-banner {
  display: flex;
  justify-content: space-between;
  background: var(--bg-alt);
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.ml-2 { margin-left: 8px; }
.p-0 { padding: 0 !important; }
.border-top { border-top: 1px solid var(--border-light); }
.max-w-md { max-width: 440px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-h-64 { max-height: 256px; }

/* Print Rules */
@media print {
  body * {
    visibility: hidden;
  }

  #letterPreviewModal, #letterPreviewModal * {
    visibility: visible;
  }

  #letterPreviewModal {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    background: white;
  }

  .modal-header, .modal-actions, .modal-close {
    display: none !important;
  }

  .letter-document-sheet {
    padding: 20mm !important;
    box-shadow: none !important;
  }
}

/* Responsive Sidebar for smaller laptops / tablets */
@media (max-width: 960px) {
  .sidebar {
    width: 68px;
    padding: 16px 6px;
  }
  .sidebar .nav-group-title,
  .sidebar .nav-label,
  .sidebar .sidebar-footer {
    display: none !important;
  }
  .sidebar .nav-item {
    justify-content: center;
    padding: 10px;
  }
  .sidebar.mobile-open {
    width: 250px;
    padding: 16px 12px;
    position: absolute;
    top: 64px;
    bottom: 0;
    left: 0;
    z-index: 999;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.mobile-open .nav-group-title,
  .sidebar.mobile-open .nav-label,
  .sidebar.mobile-open .sidebar-footer {
    display: block !important;
  }
  .sidebar.mobile-open .nav-item {
    justify-content: flex-start;
  }
}

/* Lookup Engine & Serial / Invoice Audit Styles */
.lookup-quick-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-mono, monospace);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.lookup-quick-chip:hover {
  background: rgba(215, 25, 32, 0.08);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.lookup-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

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

.lookup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.lookup-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lookup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px 24px;
  font-size: 13.5px;
}

.lookup-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.lookup-field-value {
  font-weight: 600;
  color: var(--text-main);
}

.lookup-timeline {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-light);
}

.lookup-timeline-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.lookup-timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
}

.lookup-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 5px;
  flex-shrink: 0;
}

