/* 
  AgroEstoque CSS Stylesheet
  Premium Dark Agricultural Theme - High Fidelity Revamp
*/

:root {
  /* Light Theme (Default, inspired by dashboard-exemplo) */
  --bg: #f0f4f1;
  --shell: #ffffff;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --surface-3: #f3f4f6;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #e6f7f0;
  --primary-text: #047857;
  --accent: #d97706;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-text: #991b1b;
  --warn: #f59e0b;
  --warn-light: #fffbeb;
  --warn-text: #78350f;
  --info: #3b82f6;
  --info-light: #eff6ff;
  --info-text: #1d4ed8;
  --shadow: 0 4px 20px -2px rgba(5, 150, 105, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Navigation Hover */
  --nav-hover-bg: #f3fdf9;
  --nav-hover-text: var(--primary);
}

/* ===== AGROESTOQUE COMPONENT ADAPTERS ===== */
button, input[type="submit"] {
  font-family: var(--font);
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
button:not(.secondary):not(.toggle-password-btn):not(.btn-outline):not(.btn-ghost):not(.danger):not(.btn-action):not(.modal-close),
input[type="submit"] {
  background: var(--primary);
  color: #ffffff;
  padding: 8px 18px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}
button:hover:not(.secondary):not(.btn-outline):not(.btn-ghost):not(.danger),
input[type="submit"]:hover {
  background: var(--primary-dark);
  color: #ffffff;
}
.btn-primary { background: var(--primary) !important; color: #ffffff !important; }
.btn-outline, .btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 8px 16px; min-height: 38px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-outline:hover, .btn-ghost:hover { background: var(--surface-2); border-color: var(--muted); }

/* Card & Panel */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.card-header h2, .card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.card-body { padding: 0; }

/* KPI Grid & Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.kpi-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1.1; letter-spacing: -0.5px; }
.kpi-sub { font-size: 12px; font-weight: 500; color: var(--muted); }

/* Forms & Inputs */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.form-control, input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  transition: var(--transition);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) auto; gap: 14px; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; }

/* Status Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; font-size: 11px; font-weight: 700; border-radius: 6px; text-transform: uppercase; }
.badge-pendente { background: rgba(255, 183, 77, 0.15); color: var(--accent); }
.badge-autorizado { background: rgba(56, 189, 248, 0.15); color: var(--info); }
.badge-baixado { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.badge-faturado { background: rgba(16, 185, 129, 0.15); color: var(--primary); }
.badge-expirado { background: rgba(107, 114, 128, 0.15); color: var(--muted); }
.badge-cancelado { background: var(--danger-light); color: var(--danger); }

[data-theme="dark"] {
  /* Dark Theme (Original Premium Dark UI style) */
  --bg: #111210;
  --shell: #161815;
  --surface: #1b1d1a;
  --surface-2: #262924;
  --surface-3: #131512;
  --text: #f3f5f2;
  --muted: #8b8f87;
  --line: #2a2e28;
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #162c24;
  --primary-text: #34d399;
  --accent: #ffb74d;
  --danger: #f87171;
  --danger-light: #2c1616;
  --danger-text: #fca5a5;
  --warn: #ffb74d;
  --warn-light: #2c2116;
  --warn-text: #fcd34d;
  --info: #38bdf8;
  --info-light: #0f2635;
  --info-text: #7dd3fc;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  
  /* Navigation Hover */
  --nav-hover-bg: rgba(255, 255, 255, 0.04);
  --nav-hover-text: #ffffff;
}

/* Base resets & Core styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-dark);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

h1 {
  font-size: 26px;
}

h2 {
  font-size: 18px;
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
}

p {
  color: var(--muted);
}

.muted {
  color: var(--muted) !important;
}

.text-sm {
  font-size: 13px;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.block {
  display: block;
}

.py-3 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.text-center {
  text-align: center;
}

/* Forms & Inputs */
input,
select,
textarea,
button {
  font-family: var(--font);
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--shell);
  color: var(--text);
  transition: var(--transition);
}

option {
  background-color: var(--shell);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

input::placeholder,
textarea::placeholder {
  color: #555951;
}

textarea {
  resize: vertical;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

/* Shell & Navigation */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--bg);
}

/* -----------------------------------------------
   Base states for mobile-only elements
   (hidden by default; media queries activate them)
   ----------------------------------------------- */

/* Sidebar backdrop: always positioned fixed, toggled by .active */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  cursor: pointer;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Bottom nav: hidden until mobile breakpoint */
.mobile-bottom-nav {
  display: none;
}

/* Top bar: hidden until mobile breakpoint */
.mobile-top-bar {
  display: none;
}

/* Desktop: ensure sidebar-drawer class doesn't apply drawer behavior */
@media (min-width: 961px) {
  .mobile-top-bar,
  .mobile-bottom-nav,
  .sidebar-backdrop {
    display: none !important;
  }

  .sidebar-drawer {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    width: auto !important;
    height: 100vh !important;
    transition: none !important;
    box-shadow: none !important;
  }
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--shell);
  border-right: 1px solid var(--line);
  padding: 16px 0;
  z-index: 100;
}

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

.brand-mark {
  background: linear-gradient(135deg, var(--primary), #10b981);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.brand-icon {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
}

.brand-text strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

/* Sidebar Links */
.nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px 16px;
  overflow-y: auto;
}

.nav-title {
  margin: 14px 16px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
}

.nav a svg {
  width: 20px;
  height: 20px;
  opacity: 0.8;
  transition: var(--transition);
}

.nav a.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.nav a.active svg {
  opacity: 1;
  stroke: #ffffff;
}

.nav a:hover:not(.active) {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-text);
}

.nav a:hover:not(.active) svg {
  opacity: 1;
  stroke: var(--nav-hover-text);
}

/* Sidebar User Footer */
.user-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  transition: var(--transition);
}

.user-card:hover {
  background: rgba(255, 255, 255, 0.02);
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--primary-light);
  color: var(--primary-text);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.user-meta strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.user-meta small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.logout-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.logout-btn:hover {
  color: var(--danger);
}

/* Header & Tab Bar Layout */
.content-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 32px 32px 16px;
  background: transparent;
  border-bottom: none;
}

.app-header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.app-header p {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

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

/* Sub Navigation Tab Pills */
.sub-nav-bar {
  display: flex;
  gap: 8px;
  padding: 0 32px 24px;
  background: transparent;
  border-bottom: none;
  overflow-x: auto;
}

.sub-nav-tab {
  padding: 6px 16px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  transition: var(--transition);
}

.sub-nav-tab.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.sub-nav-tab:hover:not(.active) {
  border-color: var(--muted);
  color: var(--text);
}

/* Page Layout wrapper */
.page {
  width: min(1200px, calc(100% - 40px));
  margin: 24px auto 60px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

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

.panel-header-wrap h2 {
  margin: 0;
}

.narrow {
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Buttons */
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.button:hover {
  background: var(--primary-dark);
  color: #ffffff;
}

.button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.button.secondary:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--muted);
}

.button.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.button.danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.button.full {
  width: 100%;
}

/* Filters panel on Dashboard */
.filters-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.filters-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 14px;
  align-items: flex-end;
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-field input,
.filter-field select {
  padding: 8px 12px;
}

.filters-grid button {
  height: 38px;
}

/* Metrics Grid System */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.metric:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

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

.metric-icon.green {
  background: var(--primary-light);
  color: var(--primary);
}

.metric-icon.orange {
  background: var(--warn-light);
  color: var(--warn-text);
}

.metric-icon.blue {
  background: var(--info-light);
  color: var(--info-text);
}

.metric-icon.red {
  background: var(--danger-light);
  color: var(--danger-text);
}

.metric-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.metric-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.metric-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* Custom Badges */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 8px;
  width: fit-content;
}

.badge.ok {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
}

.badge.warn {
  background: rgba(255, 183, 77, 0.15);
  color: var(--accent);
}

.badge.off {
  background: rgba(139, 143, 135, 0.15);
  color: var(--muted);
}

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

.badge.info {
  background: rgba(56, 189, 248, 0.15);
  color: var(--info);
}

/* Table design system */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

td {
  font-size: 14px;
}

.clickable-row {
  cursor: pointer;
  transition: var(--transition);
}

.clickable-row:hover {
  background: var(--surface-2);
}

.code-col {
  font-weight: 700;
  color: var(--muted);
}

.number-col {
  font-size: 15px;
}

.product-name-link {
  color: var(--text);
  font-weight: 700;
}

/* Modern HTML charts styling */
.charts-section {
  margin-bottom: 24px;
}

.chart-panel {
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

.chart-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.chart-title-wrap h2 {
  margin: 0;
}

/* HTML progress bars (Produtos mais consumidos) */
.progress-bar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.progress-bar-item {
  display: grid;
  grid-template-columns: 100px 1fr 60px;
  gap: 16px;
  align-items: center;
}

.progress-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-bar-track {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1s ease-in-out;
}

/* Gradient ranks matching premium HSL tailored greens */
.progress-bar-fill.color-idx-1 {
  background: linear-gradient(90deg, #0f766e, #10b981);
}

.progress-bar-fill.color-idx-2 {
  background: linear-gradient(90deg, #115e59, #059669);
}

.progress-bar-fill.color-idx-3 {
  background: linear-gradient(90deg, #0d9488, #34d399);
}

.progress-bar-fill.color-idx-4 {
  background: linear-gradient(90deg, #14b8a6, #6ee7b7);
}

.progress-bar-fill.color-idx-5 {
  background: linear-gradient(90deg, #2dd4bf, #a7f3d0);
}

.progress-bar-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.progress-bar-value small {
  color: var(--muted);
  font-size: 11px;
  margin-left: 2px;
}

/* Pure CSS vertical column chart (Saídas por dia) */
.bar-chart-vertical {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 170px;
  padding: 10px 10px 0;
  border-bottom: 1px solid var(--line);
  flex: 1;
}

.bar-chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
}

.bar-chart-bar-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 140px;
  width: 100%;
  padding-bottom: 2px;
}

.bar-chart-bar {
  width: 24px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s;
  position: relative;
  cursor: pointer;
}

.bar-chart-bar:hover {
  background: var(--primary-dark);
}

/* Tooltip inside bar */
.bar-val-label {
  display: none;
}

.bar-chart-bar:hover .bar-val-label {
  display: block;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -6px);
  background: var(--surface-3);
  border: 1px solid var(--primary);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow);
  z-index: 10;
}

/* Elegant little arrow for the tooltip */
.bar-chart-bar:hover .bar-val-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px;
  border-style: solid;
  border-color: var(--primary) transparent transparent transparent;
}

.bar-chart-label-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
  line-height: 1.1;
}

.bar-chart-label-wrap .day-num {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.bar-chart-label-wrap .day-name {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
}

.bar-chart-column .bar-chart-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.bar-chart-column .bar-chart-label strong {
  color: #ffffff;
}

/* Dynamic line chart evolution area */
#lineChart {
  display: block;
  margin-top: 15px;
}

/* Dashboard Split Grid (Main table & Feed) */
.split-dashboard {
  display: grid;
  grid-template-columns: 1.8fr 1.2fr;
  gap: 20px;
}

.feed-panel {
  display: flex;
  flex-direction: column;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

/* Breathtaking styled activity feed card list */
.feed-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  transition: var(--transition);
}

.feed-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

.feed-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.feed-item.exit .feed-icon-wrap {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.feed-item.adjustment .feed-icon-wrap {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary);
}

.feed-content {
  flex: 1;
  min-width: 0;
}

.feed-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.feed-row-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 1px;
}

.feed-title {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-title strong {
  color: #ffffff;
}

.feed-subtitle {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-time {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.feed-value {
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

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

.feed-value.adjustment {
  color: var(--primary);
}

/* Alert Boxes & Flash */
.alert {
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

.alert.sucesso {
  background: var(--primary-light);
  color: var(--primary-text);
}

.alert.erro {
  background: var(--danger-light);
  color: var(--danger-text);
}

/* Product details premium visual structure */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 30px;
  align-items: start;
}

.card-status-title {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.mobile-card-container {
  max-width: 420px;
  width: 100%;
  justify-self: center;
}

/* High Fidelity representation of the Mobile Screen */
.premium-mobile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.back-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.back-link:hover {
  color: var(--primary);
}

.header-tab {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
}

.header-tab.active {
  color: var(--text);
}

.header-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mobile-card-body {
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-code-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.product-name-heading {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-top: -6px;
  letter-spacing: -0.02em;
}

.mobile-balance-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
}

.balance-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.balance-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.balance-number {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.balance-unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.mobile-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0;
}

.mobile-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  height: 42px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

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

.mobile-btn.primary:hover {
  background: var(--primary-dark);
}

.mobile-btn.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.mobile-btn.secondary:hover {
  background: var(--surface-2);
}

.mobile-history-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.mobile-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 2px;
}

.mobile-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.item-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.item-title {
  font-size: 13px;
  color: var(--text);
}

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

.item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

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

.item-value {
  font-size: 13px;
  font-weight: 700;
}

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

.item-value.adjustment {
  color: var(--primary);
}

/* Info banner inside exits form */
.product-info-alert-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary-text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
}

.alert-banner-icon {
  flex-shrink: 0;
}

.readonly-input {
  background: var(--surface-2) !important;
  color: var(--muted) !important;
  border-color: var(--line) !important;
  cursor: not-allowed;
  opacity: 0.8;
}

/* Card 3: OS Details Card */
.os-split-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.os-code-eyebrow {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.os-title-heading {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-top: -2px;
}

.os-date-sub {
  font-size: 12px;
  color: var(--muted);
}

.os-qr-wrapper {
  width: 78px;
  height: 78px;
  background: #ffffff;
  padding: 3px;
  border-radius: 8px;
}

.os-qr-wrapper img {
  width: 100%;
  height: 100%;
}

.divider-line {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.os-items-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.os-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.os-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.os-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.os-item-left {
  display: flex;
  flex-direction: column;
}

.os-item-name {
  font-size: 13px;
  color: var(--text);
}

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

.os-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.os-item-value-pill {
  font-size: 13px;
  color: var(--text);
}

.os-item-obs {
  font-size: 10px;
  color: var(--muted);
  font-style: italic;
}

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

.os-footer-left {
  display: flex;
  gap: 8px;
  align-items: center;
}

.os-summary-text {
  font-size: 12px;
  color: var(--text);
}

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

.os-print-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition);
}

.os-print-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--primary);
}

/* Label & Print Display Module (Desktop Right) */
.qr-label-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.qr-label-header h3 {
  font-size: 15px;
}

.qr-display-card {
  width: 220px;
  background: #ffffff;
  border: 1px solid #111;
  padding: 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 10px auto;
}

.qr-display-card img {
  width: 180px;
  height: 180px;
}

.qr-code-text {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: #111111;
}

.qr-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================
   RESPONSIVE MOBILE OVERRIDES
   ========================================== */

/* ---- Tablet (960px) ---- */
@media (max-width: 960px) {
  /* Hide desktop sidebar completely, show mobile top bar */
  .sidebar {
    display: none;
  }

  /* Show mobile top bar and bottom nav */
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--shell);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 150;
  }

  .mobile-top-bar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mobile-top-bar-logo {
    max-height: 34px;
    width: auto;
    object-fit: contain;
  }

  .mobile-top-bar-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }

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

  .mobile-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    text-decoration: none;
  }

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

  .mobile-icon-btn.primary-action {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
  }

  .mobile-icon-btn.primary-action:hover {
    background: var(--primary-dark);
  }

  .mobile-icon-btn svg {
    width: 18px;
    height: 18px;
  }

  /* Sidebar becomes a slide-in drawer */
  .sidebar-backdrop {
    display: block;
  }

  /* Sidebar drawer override */
  .sidebar-drawer {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--shell);
    border-right: 1px solid var(--line);
    z-index: 200;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: grid !important;
    grid-template-rows: auto 1fr auto;
    overflow-y: auto;
  }

  .sidebar-drawer.open {
    left: 0;
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.25);
  }

  /* Hide old horizontal nav in sidebar */
  .nav {
    flex-direction: column;
    overflow-x: visible;
    padding: 16px 12px;
    gap: 4px;
  }

  .nav-title {
    display: block;
  }

  .user-card {
    display: grid;
  }

  .nav a {
    white-space: normal;
    padding: 12px 16px;
    border-radius: 12px;
  }

  /* Hide desktop app-header */
  .app-header {
    display: none;
  }

  /* Sub-nav pill bar stays, but more compact */
  .sub-nav-bar {
    padding: 10px 16px;
    gap: 6px;
  }

  .sub-nav-tab {
    font-size: 12px;
    padding: 5px 12px;
    white-space: nowrap;
  }

  /* Adjust page content */
  .app-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .content-shell {
    padding-bottom: 80px; /* space for bottom nav */
  }

  .page {
    width: calc(100% - 24px);
    margin: 16px auto 40px;
  }

  /* Layout grids stack vertically */
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .charts-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .split-dashboard {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Header actions keep spacing */
  .header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 64px;
    background: var(--shell);
    border-top: 1px solid var(--line);
    z-index: 150;
    padding: 0 4px;
    align-items: stretch;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  }

  .mobile-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 12px;
    margin: 6px 2px;
    transition: var(--transition);
    letter-spacing: 0.01em;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav-item svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: var(--transition);
  }

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

  .mobile-bottom-nav-item:hover:not(.active),
  .mobile-bottom-nav-item:active:not(.active) {
    color: var(--text);
    background: var(--surface-2);
  }

  .mobile-bottom-nav-item.cta {
    background: var(--primary);
    color: #ffffff;
    border-radius: 14px;
    margin: 8px 4px;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
  }

  .mobile-bottom-nav-item.cta:hover {
    background: var(--primary-dark);
  }

  .mobile-bottom-nav-item.cta svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
  }
}

/* ---- Small Mobile (480px) ---- */
@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .metric {
    padding: 16px;
    gap: 8px;
  }

  .metric-value {
    font-size: 24px;
  }

  .progress-bar-item {
    grid-template-columns: 72px 1fr 48px;
    gap: 8px;
  }

  .panel {
    padding: 16px;
  }

  .mobile-card-body {
    padding: 20px 16px;
  }

  .balance-number {
    font-size: 36px;
  }

  /* Confirm modal safe width on tiny screens */
  .confirm-modal {
    min-width: unset;
    width: calc(100vw - 32px);
    max-width: 100%;
    padding: 24px 20px;
    margin: 16px;
    border-radius: 16px;
  }

  .sub-nav-bar {
    padding: 8px 12px;
  }

  .sub-nav-tab {
    font-size: 11px;
    padding: 5px 10px;
  }

  /* Mobile top bar smaller padding */
  .mobile-top-bar {
    padding: 10px 12px;
  }

  .mobile-top-bar-title {
    max-width: 110px;
  }

  .mobile-icon-btn {
    width: 38px;
    height: 38px;
  }

  /* Bottom nav label text */
  .mobile-bottom-nav-item {
    font-size: 9px;
  }
}

/* Very small screens (360px) */
@media (max-width: 360px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .mobile-top-bar-title {
    display: none;
  }
}

/* Printing styling */
/* Printable Delivery Slip Preview */
.delivery-slip-preview-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-top: 24px;
  width: 100%;
}

.delivery-slip-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

/* Delivery Slip styling for high fidelity paper form representation */
.delivery-slip {
  background: #ffffff !important;
  color: #000000 !important;
  font-family: 'Outfit', 'Helvetica Neue', Arial, sans-serif;
  border: 2px solid #000000 !important;
  padding: 16px !important;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
}

.delivery-slip * {
  box-sizing: border-box;
  color: #000000 !important;
}

.slip-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 2px solid #000000 !important;
  align-items: center;
  padding-bottom: 8px;
}

.slip-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diana-logo-svg {
  display: block;
}

.slip-title {
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.01em;
}

.slip-meta-grid {
  display: flex;
  flex-direction: column;
  border-bottom: 2px solid #000000 !important;
}

.slip-meta-row {
  display: flex;
  border-bottom: 1px solid #000000 !important;
}

.slip-meta-row:last-child {
  border-bottom: none !important;
}

.slip-meta-row.highlight-row {
  border-top: 1px solid #000000 !important;
  background: #f3f4f6 !important;
}

.slip-meta-cell {
  padding: 6px 10px !important;
  font-size: 12px;
  border-right: 1px solid #000000 !important;
  display: flex;
  align-items: center;
}

.slip-meta-cell:last-child {
  border-right: none !important;
}

.slip-meta-cell.col-4 {
  width: 33.33%;
}

.slip-meta-cell.col-6 {
  width: 50%;
}

.slip-meta-cell.col-8 {
  width: 66.66%;
}

.slip-meta-cell.col-12 {
  width: 100%;
}

.slip-meta-cell strong {
  font-weight: 700;
  margin-right: 4px;
}

.slip-meta-cell.text-right {
  justify-content: flex-end;
}

.slip-meta-cell.text-center {
  justify-content: center;
}

.slip-items-table {
  width: 100%;
  border-collapse: collapse !important;
  margin-top: 0 !important;
  border-bottom: 2px solid #000000 !important;
}

.slip-items-table th,
.slip-items-table td {
  border: 1px solid #000000 !important;
  padding: 5px 8px !important;
  font-size: 11px !important;
  color: #000000 !important;
  background: transparent !important;
}

.slip-items-table th {
  font-weight: 800 !important;
  text-align: left !important;
  background: #f3f4f6 !important;
}

.slip-items-table tr.empty-row td {
  height: 24px !important;
}

.slip-footer {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slip-obs {
  border: 1px solid #000000 !important;
  padding: 6px 10px !important;
  min-height: 52px;
  font-size: 11px;
}

.slip-obs-text {
  color: #000000 !important;
  margin-top: 2px;
  font-size: 11px;
}

.slip-dates-grid {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 0 4px;
}

.slip-date-box {
  display: flex;
  gap: 6px;
  align-items: center;
}

.slip-date-box .label {
  font-weight: 700;
}

.slip-signatures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
  margin-top: 14px;
}

.slip-sig-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.slip-sig-box .sig-title {
  font-size: 11px;
  font-weight: 700;
  align-self: flex-start;
}

.slip-sig-box .sig-name {
  font-size: 11px;
  margin-top: 20px;
  font-weight: 600;
  min-height: 16px;
}

.slip-sig-box .sig-line {
  width: 100%;
  border-top: 1px solid #000000 !important;
  margin-top: 2px;
}

/* Printing styles revamp */
@media print {
  @page {
    margin: 0;
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  .sidebar,
  .app-header,
  .sub-nav-bar,
  .no-print,
  .filters-panel,
  .header-actions,
  .desktop-details-pane,
  .card-status-title,
  .mobile-card-container,
  .alert,
  .mobile-bottom-nav,
  .mobile-top-bar,
  .sidebar-backdrop,
  header,
  aside {
    display: none !important;
  }

  .app-shell,
  .content-shell,
  .page {
    display: block !important;
    background: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
    box-shadow: none !important;
  }

  .delivery-slip-preview-container {
    display: block !important;
    margin: 0 !important;
    padding: 10mm !important;
    border: none !important;
    box-shadow: none !important;
    background: #ffffff !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .delivery-slip {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    border: 2px solid #000000 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    page-break-inside: avoid;
    page-break-after: avoid;
    page-break-before: avoid;
  }
}

/* Glassmorphic Centered Login Page Styles */
.login-body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background: #090a08;
  position: relative;
  overflow: hidden;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Beautiful Sugarcane Blur Background */
.login-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/img/login-bg.png');
  background-size: cover;
  background-position: center;
  filter: blur(5px) brightness(0.52);
  transform: scale(1.06);
  z-index: 0;
  pointer-events: none;
}

/* Elegant radial dark gradient cover to draw attention to the center card */
.login-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, rgba(9, 10, 8, 0.3) 0%, rgba(9, 10, 8, 0.85) 100%);
  z-index: 1;
  pointer-events: none;
}

/* Subtle glowing design orbs for a dynamic modern flair */
.login-glow-orb-1 {
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0) 70%);
  top: -10%;
  left: 10%;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 2;
  pointer-events: none;
}

.login-glow-orb-2 {
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.12) 0%, rgba(5, 150, 105, 0) 70%);
  bottom: -10%;
  right: 10%;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 2;
  pointer-events: none;
}

.login-box {
  width: calc(100% - 32px);
  max-width: 410px;
  background: rgba(18, 20, 17, 0.65);
  border: 1px solid rgba(16, 185, 129, 0.15);
  /* Sleek corporate green highlight border */
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow:
    0 4px 30px rgba(0, 0, 0, 0.4),
    0 30px 60px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
  /* Inner lighting highlight border */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 3;
  position: relative;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.login-box:hover {
  border-color: rgba(16, 185, 129, 0.3);
}

/* Diana Logo Styling */
.login-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.login-diana-logo {
  max-height: 46px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.login-box h1 {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 0%, #34d399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-box p {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 28px;
  line-height: 1.4;
  font-weight: 500;
}

.login-box label {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 7px;
  color: #a7f3d0;
  /* Muted Emerald label */
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
  position: relative;
}

.login-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 12px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 14px;
  transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}

.login-box input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  background: rgba(0, 0, 0, 0.6);
}

/* Password Visibility Component */
.password-field-wrapper {
  position: relative;
  width: 100%;
}

.password-field-wrapper input {
  padding-right: 48px;
}

.toggle-password-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  transition: color 0.2s, background-color 0.2s;
  border-radius: 50%;
}

.toggle-password-btn:hover {
  color: #10b981;
  background: rgba(255, 255, 255, 0.05);
}

.toggle-password-btn .eye-icon {
  width: 18px;
  height: 18px;
}

.toggle-password-btn.showing {
  color: #10b981;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--shell);
  border: 1px solid var(--line);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.theme-toggle-btn:hover {
  background: var(--surface-2);
  transform: scale(1.05);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* Icons toggle based on theme */
html:not([data-theme="dark"]) .theme-toggle-btn .sun-icon {
  display: none;
}
html[data-theme="dark"] .theme-toggle-btn .moon-icon {
  display: none;
}

/* Success badge (for entries) */
.badge.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

/* Entry feed item type */
.feed-item.entry .feed-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.feed-item.entry .feed-value {
  color: #10b981;
}

/* ==========================================
   PREMIUM CONFIRMATION MODAL
   ========================================== */
.confirm-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.confirm-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.confirm-modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  min-width: 360px;
  max-width: 440px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  transform: scale(0.92) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-modal-overlay.active .confirm-modal {
  transform: scale(1) translateY(0);
}

.confirm-modal-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  background: var(--danger-light);
  color: var(--danger);
}

.confirm-modal-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.confirm-modal h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.confirm-modal p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.confirm-modal-actions .button {
  min-height: 38px;
  padding: 0 20px;
  font-size: 13px;
  border-radius: 10px;
}

/* Premium table layout */
.premium-table-container {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin: 0 auto;
}

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

.premium-table th,
.premium-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 13px;
}

.premium-table th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.premium-table tbody tr {
  transition: var(--transition);
}

.premium-table tbody tr:hover {
  background: var(--surface-2);
}
