:root {
  /* Signature Manager Light Palette */
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-sidebar: #f8fafc;
  --bg-header: rgba(255, 255, 255, 0.85);
  
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-active: #818cf8;

  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #94a3b8;

  /* Accent Colors */
  --indigo: #4F46E5;
  --indigo-hover: #4338ca;
  --indigo-light: #eef2ff;
  
  --blue: #2563EB;
  --blue-hover: #1d4ed8;
  --blue-light: #eff6ff;

  --emerald: #059669;
  --emerald-hover: #047857;
  --emerald-light: #ecfdf5;

  --amber: #d97706;
  --amber-light: #fffbeb;

  --rose: #e11d48;
  --rose-light: #fff1f2;

  /* Dimensions & Radius */
  --sidebar-width: 256px;
  --sidebar-collapsed: 64px;
  --header-height: 60px;
  --row-height: 48px;
  --radius: 8px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

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

body.light-theme {
  font-family: 'Inter', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Main Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar (256px / 64px) */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 120;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.app-layout.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--indigo);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.brand-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.brand-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--indigo);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  padding: 8px 8px 4px 8px;
  white-space: nowrap;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  color: var(--text-sub);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
  background: transparent;
  border: none;
  width: 100%;
  cursor: pointer;
  font-size: 13px;
}

.nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

.nav-link.active {
  background: var(--indigo-light);
  color: var(--indigo);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-sub);
}

.nav-badge.badge-warning {
  background: var(--amber-light);
  color: var(--amber);
}

/* Sidebar Collapsed State Hide Labels */
.app-layout.sidebar-collapsed .brand-text,
.app-layout.sidebar-collapsed .nav-label,
.app-layout.sidebar-collapsed .nav-section-title,
.app-layout.sidebar-collapsed .nav-badge {
  display: none;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-toggle-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  color: var(--text-sub);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-main);
}

/* Main Wrapper */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-layout.sidebar-collapsed .main-wrapper {
  margin-left: var(--sidebar-collapsed);
}

/* Sticky Header (56-64px) */
.sticky-header {
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
}

.bc-sep { font-size: 10px; color: var(--text-muted); }
.bc-item.active { font-weight: 600; color: var(--text-main); }

.header-center {
  flex: 1;
  max-width: 440px;
}

.header-search {
  position: relative;
  width: 100%;
}

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

.header-search input {
  width: 100%;
  padding: 8px 38px 8px 36px;
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.header-search input:focus {
  background: var(--bg-surface);
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 2px 5px;
  font-size: 10px;
  font-family: monospace;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-muted);
}

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

.quick-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--indigo-light);
  color: var(--indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

/* Content Body */
.content-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}

.section-title-row h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

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

/* Bento Grid Dashboard */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.bento-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  grid-column: span 3;
}

.bento-hero {
  grid-column: span 6;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-color: #cbd5e1;
}

.bento-warning {
  border-color: rgba(217, 119, 6, 0.3);
  background: #fffdf5;
}

.bento-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

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

.bento-tag.tag-warning { color: var(--amber); }

.icon-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.icon-emerald { background: var(--emerald-light); color: var(--emerald); }
.icon-indigo { background: var(--indigo-light); color: var(--indigo); }
.icon-amber { background: var(--amber-light); color: var(--amber); }

.bento-hero-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  margin-bottom: 4px;
}

.bento-hero-lbl {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 16px;
}

.bento-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.bento-desc {
  font-size: 12px;
  color: var(--text-sub);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--indigo);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.bento-hero-foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

/* Filter Chips Bar */
.filter-chips-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.chips-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
}

.chips-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--indigo-light);
  color: var(--indigo);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
}

.chip-remove {
  cursor: pointer;
  color: var(--indigo);
  font-size: 12px;
}

.chip-remove:hover { color: var(--rose); }

/* Table Toolbar */
.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.segment-tabs {
  display: flex;
  background: #e2e8f0;
  padding: 3px;
  border-radius: var(--radius);
}

.segment-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.segment-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

/* Dropdown Menu */
.dropdown-wrapper {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 200px;
  padding: 8px;
  z-index: 110;
  display: none;
}

.dropdown-wrapper.open .dropdown-menu {
  display: block;
}

.dropdown-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 8px 8px 8px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
}

.dropdown-item:hover { background: var(--bg-app); }

/* Floating Bulk Action Bar */
.bulk-actions-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--text-main);
  color: white;
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.bulk-actions-bar.active {
  display: flex;
}

.bulk-badge {
  background: var(--indigo);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.bulk-buttons {
  display: flex;
  gap: 8px;
}

/* Compact Data-Dense Table (48px Row Height) */
.compact-table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.saas-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.saas-table th {
  background: #f1f5f9;
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.saas-table td {
  height: var(--row-height);
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-size: 13px;
}

.saas-table tr:last-child td {
  border-bottom: none;
}

.saas-table tr:hover td {
  background-color: #f8fafc;
}

/* Table Cells Styling */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--indigo-light);
  color: var(--indigo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.table-company-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #f1f5f9;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-sub);
  font-weight: 600;
}

.table-checker-box {
  width: 180px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background-color: #f1f5f9;
  background-image: 
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%), 
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%), 
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
  transition: border-color 0.15s;
}

.table-checker-box:hover {
  border-color: var(--indigo);
}

.table-checker-box img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-status.complete {
  background: var(--emerald-light);
  color: var(--emerald);
}

.badge-status.missing {
  background: var(--amber-light);
  color: var(--amber);
}

/* Pagination Footer */
.pagination-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top: none;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  font-size: 13px;
  color: var(--text-sub);
}

.pagination-controls {
  display: flex;
  gap: 6px;
}

.page-btn {
  padding: 5px 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--indigo);
  color: var(--indigo);
}

.page-btn.active {
  background: var(--indigo);
  color: white;
  border-color: var(--indigo);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

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

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

.btn-amber { background: var(--amber); color: white; }
.btn-amber:hover { filter: brightness(0.95); }

.btn-outline {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-sub);
}
.btn-outline:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-light {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
}
.btn-light:hover { background: rgba(255, 255, 255, 0.3); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-text { background: transparent; border: none; font-size: 12px; font-weight: 600; cursor: pointer; }
.text-danger { color: var(--rose); }
.text-danger:hover { text-decoration: underline; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open { display: flex; }

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-lg { max-width: 850px; }
.modal-xl { max-width: 1040px; }

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

.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-sub { font-size: 12px; color: var(--text-sub); }

.close-icon-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-icon-btn:hover { background: var(--bg-app); color: var(--text-main); }

.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-app);
}

/* Cropper Modal Layout */
.cropper-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
}

.cropper-view-container {
  max-height: 440px;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.cropper-view-container img { max-width: 100%; display: block; }

.cropper-tools-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-box {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  cursor: pointer;
}

.slider-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.slider-box input { width: 100%; }

.btn-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Raw Cards */
.raw-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.raw-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.raw-img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #0f172a;
  border-radius: 6px;
}

/* Checkerboard Lightbox */
.checkerboard-lightbox {
  width: 100%;
  height: 320px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f1f5f9;
  background-image: 
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%), 
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%), 
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
}

.checkerboard-lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.ml-1 { margin-left: 4px; }
