@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* aria-label placeholder label */
/* ==========================================================
   THEME VARIABLES (LIGHT MODE DEFAULT - SWISS TECH)
========================================================== */
:root {
  --orange: #FF6A00;
  --orange-light: #FF8533;
  --orange-hover: #E65F00;
  
  /* Semantic Colors - LIGHT MODE */
  --bg-main: #F4F6F9;          
  --bg-surface: #FFFFFF;       
  --bg-surface-hover: #ECEFF3; 
  
  --border: #DDE2EC;           
  --border-focus: rgba(255, 106, 0, 0.7);
  
  --text-main: #1E293B;        
  --text-muted: #64748B;       
  --text-inverse: #FFFFFF;     

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.06);
  --shadow-sidebar: 1px 0 8px rgba(0,0,0,0.02);

  --radius-sm: 8px;   /* buttons, inputs, badges */
  --radius-md: 12px;  /* cards, intermediate containers */
  --radius-lg: 20px;  /* modal container, large cards */
  
  /* Sidebar Width */
  --sidebar-width: 260px;
}

/* ==========================================================
   DARK MODE OVERRIDES (OBSIDIAN DARK)
========================================================== */
html[data-theme="dark"] {
  /* Semantic Colors - DARK MODE */
  --bg-main: #07090E;          
  --bg-surface: #0E111A;       
  --bg-surface-hover: #161A26; 
  
  --border: rgba(255, 255, 255, 0.08);           
  --border-focus: rgba(255, 106, 0, 0.8);
  
  --text-main: #F8FAFC;        
  --text-muted: #8A99AD;       
  --text-inverse: #FFFFFF;     

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.45);
  --shadow-sidebar: 1px 0 10px rgba(0,0,0,0.25);
}

/* ===== Reset / Base ===== */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 0;
  color: var(--text-main);
}

a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; height: auto; }

/* ==========================================================
   APP LAYOUT (SIDEBAR + MAIN CONTENT)
========================================================== */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease, background 0.3s ease, border 0.3s ease;
}

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

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.brand-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}
.brand-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}



.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-link svg {
  width: 18px; height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}
.sidebar-link span {
  transition: opacity 0.2s ease;
}
.sidebar-link:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
}
.sidebar-link.active {
  background: rgba(255, 106, 0, 0.1);
  color: var(--orange);
}
.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  white-space: nowrap;
}
.sidebar-footer .btn {
  overflow: hidden;
  white-space: nowrap;
}
.sidebar-footer .btn span {
  transition: opacity 0.2s ease;
}

/* --- TOPBAR (DESKTOP) --- */
.topbar {
  display: flex;
  height: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar-left {
  display: flex;
  align-items: center;
}

.topbar-workspace {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-switch-btn, .logout-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-switch-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--orange);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #dc2626;
  transform: translateY(-1px);
}

.theme-switch-btn:active, .logout-btn:active {
  transform: translateY(0);
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 2px;
}

/* User Profile Block */
.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  user-select: none;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.25;
}

.user-role {
  font-weight: 500;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* --- MOBILE ONLY USER PROFILE FOOTER --- */
.mobile-only-footer {
  display: none; /* Default hidden on desktop */
  flex-direction: column;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  gap: 12px;
}

.mobile-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.theme-switch-mobile-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.theme-switch-mobile-btn:hover {
  background: var(--bg-surface-hover);
}

.logout-mobile-btn {
  color: #dc2626;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.logout-mobile-btn:hover {
  background: rgba(239, 68, 68, 0.08);
}


/* Mobile Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
  backdrop-filter: blur(4px);
}

/* --- MAIN CONTENT --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topbar Mobile Only */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.menu-toggle {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.menu-toggle:hover {
  background: var(--bg-surface-hover);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
  width: 100%;
}

/* ==========================================================
   UI COMPONENTS
========================================================== */

/* ===== Nav Tabs (Internal Navigation) ===== */
.nav-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.nav-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 4px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  position: relative;
  transition: color 0.2s ease;
  cursor: pointer;
  background: transparent;
  border: none;
}
.nav-tab:hover {
  color: var(--text-main);
}
.nav-tab.active {
  color: var(--orange);
}
.nav-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--orange);
  border-radius: 2px 2px 0 0;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex; 
  align-items: center; 
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(255, 106, 0, 0.2);
  background: rgba(255, 106, 0, 0.1);
  border-radius: 999px;
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-success {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}
html[data-theme="dark"] .badge-success { color: #4ade80; }

.badge-warning {
  border-color: rgba(234, 179, 8, 0.3);
  background: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
}
html[data-theme="dark"] .badge-warning { color: #facc15; }

.badge-danger {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}
html[data-theme="dark"] .badge-danger { color: #f87171; }

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

/* ===== KPI Cards (Dashboard) ===== */
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
/* In Dark mode, KPI cards look richer */
html[data-theme="dark"] .kpi-card {
  background: linear-gradient(145deg, rgba(24, 24, 31, 0.9) 0%, rgba(30, 20, 25, 0.95) 100%);
  border: 1px solid rgba(255, 106, 0, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-surface-hover);
  box-shadow: var(--shadow-sm);
}
.btn:active {
  transform: translateY(1px);
}
.btn-orange {
  background: linear-gradient(135deg, var(--orange), var(--orange-hover));
  border: none;
  color: var(--text-inverse);
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.2);
}
.btn-orange:hover {
  background: linear-gradient(135deg, #ff7b1a, #ff9b57);
  box-shadow: 0 6px 16px rgba(255, 106, 0, 0.3);
  color: var(--text-inverse);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #dc2626;
}
html[data-theme="dark"] .btn-danger { color: #f87171; }

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

/* ===== Tipografia util ===== */
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; font-weight: 500; }

/* ===== Inputs ===== */
.input, select, textarea {
  width: 100%;
  display: block;
  background: var(--bg-main);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
}
textarea { resize: vertical; min-height: 100px; }
.input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
  background: var(--bg-surface);
}

select { appearance: none; -webkit-appearance: none; }
select {
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 15px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select option {
  background: var(--bg-surface);
  color: var(--text-main);
}

/* ===== Form grid ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
  align-items: start;
}
.field { grid-column: span 12; }
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}
@media (min-width: 720px) {
  .col-3 { grid-column: span 3; }
  .col-4 { grid-column: span 4; }
  .col-6 { grid-column: span 6; }
  .col-8 { grid-column: span 8; }
  .col-9 { grid-column: span 9; }
}
.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ===== Progress List (Dashboard) ===== */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}
.progress-count {
  font-weight: 800;
  color: var(--orange);
}
.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
  border-radius: 999px;
  transition: width 1s ease-out;
}

/* ===== Table ===== */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}
.table th, .table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.table th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-main);
}
.table tbody tr:hover td {
  background: var(--bg-surface-hover);
}
.table tbody tr:last-child td {
  border-bottom: none;
}

/* ===== Modals ===== */
body.modal-open { overflow: hidden; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-backdrop.show { display: flex; opacity: 1; }

.modal {
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(16px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  overflow: hidden;
}
.modal-backdrop.show .modal {
  transform: translateY(0);
}

.modal.modal-sm { max-width: 420px; }
.modal.modal-md { max-width: 600px; }
.modal.modal-lg { max-width: 850px; }

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-surface);
  position: relative;
  flex: 0 0 auto;
}
/* Orange top bar */
.modal-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--orange-light));
}
.modal-header-title {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--text-main);
}
.modal-header-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 auto;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 24px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  flex: 0 0 auto;
}

.modal > form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  height: 100%;
}

/* Modal Inputs specific */
.modal label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

/* ===== Media Previews ===== */
.nf-preview img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--bg-main);
}
.nf-preview iframe {
  width: 100%;
  height: 65vh;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-main);
}

/* ===== Page Headers (Global) — Banner Bar ===== */
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 24px 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
/* Orange accent stripe on the left */
.page-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--orange), var(--orange-light));
  border-radius: 4px 0 0 4px;
}
.page-header-text {
  flex: 1;
  min-width: 250px;
}
.page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.page-desc {
  margin: 6px 0 0 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
}
.page-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ===== Sector List & Inline Form ===== */
.sector-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.sector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border 0.2s ease;
}
.sector-item:hover {
  border-color: var(--border-focus);
}
.sector-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
}
.sector-actions {
  display: flex;
  gap: 6px;
}
.sector-actions .btn {
  padding: 4px 8px;
  min-height: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
}
.sector-actions .btn:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
}
.sector-actions .btn-danger:hover {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
}
.sector-inline-form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sector-inline-form .input {
  flex: 1;
}

/* ===== Shelf Cards (Almoxarifado Estantes) ===== */
.shelf-card {
  padding: 0;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.shelf-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.shelf-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.shelf-card-header:hover {
  background: var(--bg-surface-hover);
}

.shelf-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(255, 106, 0, 0.1);
  color: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.shelf-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted);
  flex-shrink: 0;
}

.shelf-card-body {
  padding: 0 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: shelfExpand 0.25s ease;
}

@keyframes shelfExpand {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.shelf-level-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.shelf-level-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  flex-shrink: 0;
}

.shelf-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: var(--text-inverse);
  font-weight: 900;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.shelf-level-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  align-items: center;
}

.shelf-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  transition: border-color 0.15s ease;
}
.shelf-item-chip:hover {
  border-color: var(--orange);
}

/* ===== Responsive adjustments ===== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
  }
  .mobile-topbar {
    display: flex;
  }
  .sidebar-overlay.show {
    display: block;
  }
  .topbar {
    display: none !important;
  }
  .mobile-only-footer {
    display: flex;
  }
}
@media (max-width: 600px) {
  .modal { max-height: 95vh; }
  .modal-header, .modal-body { padding: 16px; }
  .container { padding: 16px; }
  .table { min-width: 100%; }
}

/* ===== Flash Alert Boxes (Login Page) ===== */
.flash {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 12px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
}
.flash.success {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}
html[data-theme="dark"] .flash.success {
  color: #4ade80;
}
.flash.error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}
html[data-theme="dark"] .flash.error {
  color: #f87171;
}

/* ===== Split Master-Detail Layout (Locations & Sectors) ===== */
.split-container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
}

.split-master {
  width: 360px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.split-detail {
  flex: 1;
  min-width: 0;
}

/* Master Item (Sidebar List Cards) */
.master-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.master-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-focus);
  transform: translateX(2px);
}

.master-item.active {
  background: rgba(255, 106, 0, 0.05);
  border-color: var(--orange);
  border-left-color: var(--orange);
}

/* Detail Panel (Active Details View Card) */
.detail-panel {
  display: none;
}

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

.detail-panel.active {
  display: flex;
  flex-direction: column;
  animation: detailFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Responsive collapse for split view */
@media (max-width: 900px) {
  .split-container {
    flex-direction: column;
    gap: 20px;
  }
  .split-master {
    width: 100%;
  }
  .split-detail {
    width: 100%;
  }
  .master-item:hover {
    transform: none;
  }
}


