/* ====================================================================
   SMART GABRI — STRICT LIGHT MODE DESIGN SYSTEM (DESIGN.MD)
   ==================================================================== */

:root {
  /* 60-30-10 Color System */
  --color-canvas: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-surface-subtle: #F1F5F9;
  --color-text-main: #0F172A;
  --color-text-sub: #64748B;
  --color-border: #E2E8F0;

  --color-primary: #059669;
  --color-primary-hover: #047857;
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-info: #2563EB;

  /* Fibonacci Spacing */
  --space-3: 3px;
  --space-5: 5px;
  --space-8: 8px;
  --space-13: 13px;
  --space-21: 21px;
  --space-34: 34px;
  --space-55: 55px;

  /* Border Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 10px 15px -3px rgba(15, 23, 42, 0.08);
  --shadow-modal: 0 20px 25px -5px rgba(15, 23, 42, 0.12);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--color-canvas);
  color: var(--color-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ALL MAIUSC Casing Law & Typography */
h1, h2, h3, h4, h5, h6,
button, .tab-btn, .badge, th, .metric-label, .nav-title {
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Email Exception */
input[type="email"], .email-input, .email-text {
  text-transform: none !important;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Layout Containers (ASTRO CRM Enterprise Mesh Layout) */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--color-canvas);
}

.sidebar {
  width: 250px;
  background-color: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.2s ease;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar.collapsed {
  width: 72px;
}

.sidebar-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-13);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-logo-icon {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #FFFFFF;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
  flex-shrink: 0;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-left: 10px;
}

.sidebar.collapsed .sidebar-brand-text {
  display: none;
}

.sidebar-logo-text {
  font-size: 14px;
  font-weight: 900;
  color: var(--color-text-main);
  line-height: 1.1;
}

.sidebar-logo-sub {
  font-size: 9px;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-collapse-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-sub);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-collapse-toggle-btn:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-main);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-13) var(--space-8);
  list-style: none;
  overflow-y: auto;
}

.sidebar-nav-item {
  margin-bottom: var(--space-5);
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--color-text-sub);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  width: 100%;
  background: transparent;
  text-align: left;
}

.sidebar-nav-link:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-main);
}

.sidebar-nav-link.active {
  background: #ECFDF5;
  color: var(--color-primary);
  border-color: rgba(5, 150, 105, 0.2);
  font-weight: 800;
}

.sidebar-nav-link.active .material-symbols-outlined {
  color: var(--color-primary);
}

.sidebar.collapsed .sidebar-nav-label,
.sidebar.collapsed .sidebar-nav-badge {
  display: none;
}

.sidebar-nav-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--color-surface-subtle);
  color: var(--color-text-main);
}

.sidebar-nav-link.active .sidebar-nav-badge {
  background: rgba(5, 150, 105, 0.15);
  color: var(--color-primary);
}

.sidebar-footer {
  padding: var(--space-13);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-footer-info {
  display: none;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-main);
  line-height: 1.2;
}

.sidebar-user-email {
  font-size: 10px;
  color: var(--color-text-sub);
  text-transform: none !important;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.app-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-21);
  min-height: 100vh;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-13) var(--space-21);
  margin-bottom: var(--space-21);
  box-shadow: var(--shadow-sm);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

/* Cards & Widgets */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-21);
  margin-bottom: var(--space-21);
  box-shadow: var(--shadow-card);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-13);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  font-size: 13px;
  font-weight: 700;
  padding: var(--space-8) var(--space-13);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

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

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

.btn-outline:hover {
  background-color: var(--color-surface-subtle);
}

.btn-danger {
  background-color: var(--color-danger);
  color: #FFFFFF;
}

/* Material Symbols Outlined Font Helper */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
}

/* Tabs & Store Filter */
.store-tabs {
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-13);
  border-bottom: 1px solid var(--color-border);
}

.tab-btn {
  padding: var(--space-8) var(--space-13);
  font-size: 12px;
  font-weight: 700;
  background: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
}

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

/* Checklist Items */
.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-13);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-8);
  transition: background 0.15s ease;
}

.checklist-item.superfluous {
  opacity: 0.55;
  background: var(--color-surface-subtle);
}

.checklist-item.checked {
  border-color: var(--color-success);
  background: #F0FDF4;
}

.item-left {
  display: flex;
  align-items: center;
  gap: var(--space-13);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-34);
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-modal);
  text-align: center;
}

/* ====================================================================
   VIEW SWITCHER & SECTION NAVIGATION (ASTRO CRM PATTERN)
   ==================================================================== */
.view-nav-bar {
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-21);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

.view-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-13);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-sub);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-transform: uppercase;
}

.view-nav-btn:hover {
  background: var(--color-surface-subtle);
  color: var(--color-text-main);
}

.view-nav-btn.active {
  background: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.view-nav-btn.active .material-symbols-outlined {
  color: #FFFFFF;
}

.view-nav-btn .material-symbols-outlined {
  font-size: 18px;
  color: var(--color-text-sub);
}

.view-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--color-surface-subtle);
  color: var(--color-text-main);
  margin-left: 2px;
}

.view-nav-btn.active .view-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* Mobile Bottom Navigation (Visible on narrow viewports) */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  z-index: 900;
  box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.08);
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .app-container {
    padding: var(--space-13);
    padding-bottom: 80px;
  }
  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
  }
  .mobile-tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 9px;
    font-weight: 700;
    color: var(--color-text-sub);
    cursor: pointer;
    padding: 4px;
    gap: 2px;
    text-transform: uppercase;
  }
  .mobile-tab-btn.active {
    color: var(--color-primary);
  }
  .mobile-tab-btn .material-symbols-outlined {
    font-size: 20px;
  }
}

