:root {
  --primary: #2196f3;
  --primary-dark: #1976d2;
  --primary-light: #e3f2fd;
  --accent: #ff9800;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --sidebar-width: 260px;
}

/* Themes */
body.theme-mint { --primary: #00bfa5; --primary-dark: #00897b; --primary-light: #e0f2f1; }
body.theme-amber { --primary: #ff9800; --primary-dark: #f57c00; --primary-light: #fff3e0; }
body.theme-violet { --primary: #7c4dff; --primary-dark: #651fff; --primary-light: #ede7f6; }
body.theme-breeze { --primary: #0284c7; --primary-dark: #0369a1; --primary-light: #e0f2fe; }
body.theme-dark {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --text-dark: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: #334155;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-dark);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background-color: var(--primary);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.brand-text h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
}

.badge {
  font-size: 10px;
  font-weight: 700;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--bg-main);
  color: var(--primary);
}

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  color: white;
}

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

.sync-status-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background-color: var(--bg-main);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-indicator.connected {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

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

.status-title { font-size: 12px; font-weight: 700; }
.status-desc { font-size: 10px; color: var(--text-muted); }

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-header {
  height: 70px;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  width: 360px;
}

.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  color: var(--text-dark);
}

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

.store-sync-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 20px;
}

/* Screens */
.screen-content {
  display: none;
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

.screen-content.active { display: block; }

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title-row h1 { font-size: 24px; font-weight: 800; }
.page-title-row p { font-size: 13px; color: var(--text-muted); }

.btn-group { display: flex; gap: 10px; }

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-card.primary .metric-icon { background: var(--primary-light); color: var(--primary); }
.metric-card.success .metric-icon { background: var(--success-bg); color: var(--success); }
.metric-card.warning .metric-icon { background: var(--warning-bg); color: var(--warning); }
.metric-card.info .metric-icon { background: #e0f2fe; color: #0284c7; }
.metric-card.danger .metric-icon { background: #fee2e2; color: #ef4444; }

.metric-data .label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.metric-data h2 { font-size: 22px; font-weight: 800; }

/* Hide scrollbar for stat cards container across all browsers */
.stat-cards-scroll-container,
#dashboard-stat-cards-container {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.stat-cards-scroll-container::-webkit-scrollbar,
#dashboard-stat-cards-container::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

/* Cards & Tables */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

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

.table-responsive { overflow-x: auto; }

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

.data-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-main);
  white-space: nowrap !important;
}

.data-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  white-space: nowrap !important;
}

/* Status Badges */
.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.status-pill.paid { background-color: var(--success-bg); color: var(--success); }
.status-pill.unpaid { background-color: var(--danger-bg); color: var(--danger); }
.status-pill.warning { background-color: var(--warning-bg); color: var(--warning); }
.status-pill.quote { background-color: var(--warning-bg); color: var(--warning); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); }
.btn-secondary { background-color: var(--bg-main); border: 1px solid var(--border-color); color: var(--text-dark); }
.btn-danger { background-color: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { background: none; border: none; cursor: pointer; color: var(--text-muted); }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background-color: var(--bg-card);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  background-color: var(--bg-card);
  color: var(--text-dark);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

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

.item-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

/* Printer Status Pill in Header */
.printer-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s ease;
}

.printer-status-pill:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.printer-status-pill .material-icons-round {
  font-size: 18px;
  color: var(--primary);
}

.printer-badge-active {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  margin-left: 4px;
}

/* Print Area & Responsive Paper Styling */
.print-area { display: none; }

/* Thermal Receipt & A4 Preview Card Styles */
.a4-invoice-sheet {
  font-family: 'Plus Jakarta Sans', Arial, sans-serif;
  padding: 36px;
  max-width: 800px;
  margin: 0 auto;
  color: #0d1b2a;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  border-radius: 8px;
  position: relative;
  box-sizing: border-box;
}

.thermal-receipt-80 {
  font-family: 'Courier New', Courier, monospace;
  width: 78mm;
  margin: 0 auto;
  padding: 12px;
  background: #ffffff;
  color: #000000;
  font-size: 12px;
  line-height: 1.35;
  border: 1px dashed #cccccc;
}

.thermal-receipt-58 {
  font-family: 'Courier New', Courier, monospace;
  width: 54mm;
  margin: 0 auto;
  padding: 8px;
  background: #ffffff;
  color: #000000;
  font-size: 11px;
  line-height: 1.25;
  border: 1px dashed #cccccc;
}

.receipt-center { text-align: center; }
.receipt-right { text-align: right; }
.receipt-left { text-align: left; }
.receipt-divider-single { border-top: 1px dashed #000; margin: 8px 0; }
.receipt-divider-double { border-top: 2px solid #000; margin: 8px 0; }
.receipt-table { width: 100%; border-collapse: collapse; font-size: inherit; }
.receipt-table th, .receipt-table td { padding: 3px 0; vertical-align: top; }

@media print {
  @page {
    margin: 0;
  }
  
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  body * {
    visibility: hidden !important;
  }

  #print-area, #print-area * {
    visibility: visible !important;
  }

  #print-area {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
  }

  /* Specific Paper Size Rules when printing */
  .print-page-a4 {
    width: 210mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    padding: 10mm !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
  }

  .print-page-80mm {
    width: 80mm !important;
    padding: 2mm !important;
    margin: 0 auto !important;
    font-size: 12px !important;
    border: none !important;
  }

  .print-page-58mm {
    width: 58mm !important;
    padding: 1mm !important;
    margin: 0 auto !important;
    font-size: 10px !important;
    border: none !important;
  }
}

/* Table Slider Controls & Expandable Details */
.table-slider-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-main);
  padding: 2px 6px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 4px;
  transition: background-color 0.2s ease;
}

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

.invoice-main-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.invoice-main-row:hover {
  background-color: var(--border-color) !important;
}

body.theme-dark .invoice-main-row:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.expanded-detail-row td {
  padding: 0 !important;
  background-color: var(--bg-main) !important;
  border-bottom: 2px solid var(--primary-light) !important;
  white-space: normal !important;
}

.expanded-detail-card {
  padding: 18px 22px;
  background: var(--bg-card);
  margin: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  position: sticky;
  left: 16px;
  max-width: calc(100vw - var(--sidebar-width) - 80px);
  box-sizing: border-box;
  overflow-x: auto;
}

.expanded-detail-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.expanded-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dark);
}

.expanded-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.nested-items-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 12px;
}

.nested-items-table th {
  background-color: var(--bg-main);
  padding: 10px 12px;
  color: var(--text-dark);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
  box-sizing: border-box;
  white-space: nowrap !important;
}

.nested-items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  vertical-align: middle;
  box-sizing: border-box;
  white-space: nowrap !important;
}

.expanded-detail-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 8px;
}

/* Itemized Card Grid Layout for Expanded Invoice Rows */
.item-grid-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.item-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 16px;
  gap: 16px;
  transition: border-color 0.15s ease;
}

.item-card-row:hover {
  border-color: var(--primary);
}

.item-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-num {
  font-weight: 800;
  color: var(--text-muted);
  font-size: 13px;
  width: 24px;
}

.item-desc {
  flex: 2;
  min-width: 160px;
}

.item-price {
  flex: 1;
  min-width: 100px;
  text-align: right;
}

.item-qty {
  flex: 1;
  min-width: 100px;
  text-align: center;
}

.item-total {
  flex: 1;
  min-width: 110px;
  text-align: right;
}

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

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

/* Vendors & Suppliers Styling */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.vendor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}

.vendor-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(33, 150, 243, 0.08);
}

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

.vendor-card-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vendor-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.vendor-details-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.vendor-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-dark);
}

.vendor-detail-row .material-icons-round {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 2px;
}

.vendor-detail-label {
  font-weight: 700;
  color: var(--text-muted);
  min-width: 65px;
}

.vendor-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.purchase-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.purchase-items-table th {
  background-color: var(--bg-main);
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.purchase-items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.live-summary-box {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.live-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.live-summary-row.total {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-dark);
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

/* Analytics Screen & Chart Enhancements */
#analytics-stat-cards-container {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
#analytics-stat-cards-container::-webkit-scrollbar {
  display: none !important;
}

.chart-bar-group {
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.chart-bar-group:hover rect {
  opacity: 1 !important;
  filter: brightness(1.12);
}
.chart-bar-amount,
.chart-bar-group text.chart-bar-amount {
  fill: #ffffff !important;
  color: #ffffff !important;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

#donut-paid-vs-due-svg circle,
#donut-rev-vs-exp-svg circle {
  transition: stroke-dasharray 0.6s cubic-bezier(0.4, 0, 0.2, 1), stroke-width 0.2s ease;
}
#donut-paid-vs-due-svg circle:hover,
#donut-rev-vs-exp-svg circle:hover {
  stroke-width: 14;
}

#tax-quarter-selectors button,
#tax-rate-selectors button {
  transition: all 0.2s ease;
}

/* ==========================================================================
   Screen Size & Device Restriction Pop-Up Modal (Desktop/Laptop Widescreen Only)
   ========================================================================== */

.screen-restriction-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999999;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  box-sizing: border-box;
  animation: fadeInModal 0.25s ease-out;
}

/* Force modal to appear continuously on all smaller screen devices (Mobile phones, tablets, iPads <= 1024px) */
@media (max-width: 1024px) {
  .screen-restriction-overlay {
    display: flex !important;
  }
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.screen-restriction-card {
  background: var(--bg-card, #1e293b);
  border: 1px solid var(--border-color, #334155);
  border-radius: 28px;
  max-width: 520px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: var(--text-dark, #f8fafc);
  margin: auto;
  position: relative;
  box-sizing: border-box;
}

.restriction-icon-wrapper {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.restriction-icon-halo {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.35) 0%, rgba(239, 68, 68, 0) 70%);
  animation: pulseHalo 2s infinite ease-in-out;
}

@keyframes pulseHalo {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.35); opacity: 0.3; }
}

.restriction-icon-inner {
  position: relative;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(185, 28, 28, 0.3));
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ef4444;
}

.restriction-main-icon {
  font-size: 32px;
}

.restriction-sub-icon {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 20px;
  background: #ef4444;
  color: #ffffff;
  border-radius: 50%;
  padding: 1px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.restriction-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.screen-restriction-card h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 10px 0;
  color: var(--text-dark, #ffffff);
}

.restriction-description {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted, #94a3b8);
  margin: 0 0 22px 0;
}

.restriction-device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  text-align: left;
}

.device-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--bg-main, rgba(15, 23, 42, 0.6));
  border: 1px solid var(--border-color, #334155);
}

.device-item.blocked {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.05);
}

.device-item.allowed {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.06);
}

.device-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.device-item.blocked .device-icon-box {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.device-item.allowed .device-icon-box {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.device-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.device-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark, #ffffff);
}

.device-status {
  font-size: 11px;
  font-weight: 500;
}

.device-item.blocked .device-status {
  color: #ef4444;
}

.device-item.allowed .device-status {
  color: #10b981;
}

.device-item .status-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.device-item.blocked .status-icon {
  color: #ef4444;
}

.device-item.allowed .status-icon {
  color: #10b981;
}

.restriction-live-detector {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid var(--border-color, #334155);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 11.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-detector-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.live-detector-metrics {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  color: var(--text-dark, #ffffff);
  font-family: monospace;
}

.live-detector-metrics .divider {
  color: var(--border-color, #475569);
}

.restriction-help-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(33, 150, 243, 0.1);
  border: 1px dashed rgba(33, 150, 243, 0.4);
  color: #60a5fa;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.4;
}

.restriction-help-box .material-icons-round {
  font-size: 18px;
  flex-shrink: 0;
}

/* Dashboard Visual Analytics Section */
.dashboard-visual-analytics .card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-visual-analytics .card:hover {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1200px) {
  .dashboard-visual-analytics .chart-row {
    grid-template-columns: 1fr !important;
  }
}

/* Button Loading & Spinning Animation */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spin-icon {
  display: inline-block !important;
  animation: spin 0.8s linear infinite !important;
  transform-origin: center center;
}

