/* ============================================================
   EM CRM Portal — Main Stylesheet
   ============================================================ */

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

:root {
  --primary: #00ff88;
  --primary-dark: #00cc6e;
  --primary-light: #66ffb3;
  --secondary: #000000;
  --success: #00ff88;
  --warning: #ffcc00;
  --danger: #ff4444;
  --info: #00d4ff;
  --purple: #bf00ff;

  --bg-main: #f0f2f7;
  --bg-card: #ffffff;
  --sidebar-bg: #000000;
  --sidebar-hover: #111111;
  --sidebar-active: #00ff88;
  --sidebar-text: #ffffff;
  --sidebar-width: 210px;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --transition: all 0.2s ease;
  --header-h: 74px;
}

/* Utilities */
.flex {
  display: flex;
  align-items: center;
}

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

.flex-column {
  display: flex;
  flex-direction: row;
}

.flex-wrap {
  display: flex;
  flex-wrap: wrap;
}

.gap-5 {
  gap: 5px;
}

.gap-10 {
  gap: 10px;
}

.gap-15 {
  gap: 15px;
}

.gap-20 {
  gap: 20px;
}

.gap-30 {
  gap: 30px;
}

.gap-40 {
  gap: 40px;
}

.gap-100 {
  gap: 100px;
}

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

.justify-center {
  justify-content: center;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #ef4444;
  border-radius: 10px;
  border: 2px solid #1a1a1a;
}

::-webkit-scrollbar-thumb:hover {
  background: #c0392b;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  padding: 24px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  animation: slideUp 0.4s ease;
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo .logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}

.auth-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-logo p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: #000;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: var(--transition);
  overflow-y: auto;
  border-right: 1px solid #222;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 15px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .brand-icon {
  width: 40px;
  height: 40px;
  background: #00ff88;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
  flex-shrink: 0;
}

.sidebar-brand .brand-text h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.sidebar-brand .brand-text span {
  font-size: 11px;
  color: var(--sidebar-text);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(199, 210, 254, 0.4);
  padding: 12px 15px 6px;
  text-transform: uppercase;
}

.nav-item {
  margin: 2px 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover {
  background: #111;
  color: #00ff88;
}

.nav-link.active {
  background: #00ff88;
  color: #000;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

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

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}

.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #00ff88;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user .user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user .user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user .user-role {
  font-size: 11px;
  color: var(--sidebar-text);
}

.sidebar-user .logout-btn {
  color: rgba(199, 210, 254, 0.6);
  font-size: 15px;
  text-decoration: none;
  transition: var(--transition);
}

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

/* ---- Main Content ---- */
.main-content {
  margin-left: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* ---- Header ---- */
.top-header {
  height: var(--header-h);
  background: #000;
  border-bottom: 1px solid #222;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  color: #fff;
}

.top-header .page-title {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}

.top-header .page-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
  display: block;
}

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

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition);
  position: relative;
  text-decoration: none;
}

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

.notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid #fff;
}

/* ---- Page Content ---- */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}

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

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

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-main);
}

/* ---- Stat Cards ---- */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-color, var(--primary));
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  background: color-mix(
    in srgb,
    var(--stat-color, var(--primary)) 12%,
    transparent
  );
  color: var(--stat-color, var(--primary));
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-change.up {
  color: var(--success);
}

.stat-change.down {
  color: var(--danger);
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
}

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

.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-secondary);
  background: var(--bg-main);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #f8fafc;
}

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

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-label .required {
  color: var(--danger);
  margin-left: 3px;
}

.form-control,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition);
  outline: none;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: block;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.input-group {
  display: flex;
  gap: 0;
}

.input-group .form-control {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  flex: 1;
}

.input-group .input-group-btn {
  padding: 0 14px;
  background: var(--bg-main);
  border: 1.5px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.input-group .input-group-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-icon {
  padding: 8px;
  width: 34px;
  height: 34px;
  justify-content: center;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
  background: var(--bg-main);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

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

.btn-danger:hover {
  background: #dc2626;
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-info {
  background: var(--info);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

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

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge-primary {
  background: #ede9fe;
  color: var(--primary);
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #cffafe;
  color: #155e75;
}

.badge-secondary {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.badge-purple {
  background: #ede9fe;
  color: #5b21b6;
}

/* ============================================================
   ALERTS / FLASH
   ============================================================ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  margin-bottom: 20px;
}

.alert-success {
  background: #f0fdf4;
  border-color: var(--success);
  color: #14532d;
}

.alert-danger {
  background: #fef2f2;
  border-color: var(--danger);
  color: #7f1d1d;
}

.alert-warning {
  background: #fffbeb;
  border-color: var(--warning);
  color: #78350f;
}

.alert-info {
  background: #f0f9ff;
  border-color: var(--info);
  color: #0c4a6e;
}

.alert-close {
  margin-left: auto;
  cursor: pointer;
  opacity: 0.6;
  background: none;
  border: none;
  font-size: 16px;
  line-height: 1;
}

.alert-close:hover {
  opacity: 1;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.2s;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--danger);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   SEARCH & FILTERS
   ============================================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

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

.search-input-wrap input {
  padding-left: 36px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.page-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

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

.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   GRID UTILITIES
   ============================================================ */
.grid {
  display: grid;
  gap: 20px;
}

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

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-20 {
  margin-bottom: 20px;
}

.text-muted {
  color: var(--text-secondary);
}

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

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

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

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

.w-100 {
  width: 100%;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  color: var(--text-muted);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-in {
  animation: slideUp 0.35s ease both;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .page-content {
    padding: 16px;
  }

  .top-header {
    padding: 0 16px;
  }

  .mobile-toggle {
    display: flex !important;
  }
}

.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: var(--bg-main);
  cursor: pointer;
  font-size: 18px;
  color: var(--text-primary);
}

/* Sidebar overlay on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

.sidebar-overlay.open {
  display: block;
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .sidebar,
  .top-header,
  .no-print {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================================
   EXCEL SHEET WORKBOOK NAVIGATION
   ============================================================ */

/* Hide sidebar/overlay on pages that use the excel nav layout */
.excel-nav-page .sidebar,
.excel-nav-page .sidebar-overlay,
.excel-nav-page .mobile-toggle {
  display: none !important;
}

.excel-nav-page .main-content {
  margin-left: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

.page-content {
  padding-bottom: 58px !important; /* Exact footer height: 28px ribbon + 28px tabs + 2px border */
}

/* Nav Container */
.excel-nav-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 2000;
  background: #000000;
  border-top: 1px solid #2d2d30;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
  font-family: "Inter", sans-serif;
  display: flex;
  flex-direction: column;
}

/* Ribbon Row */
.excel-ribbon-bar {
  background: #000000;
  height: 28px;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #2d2d30;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.excel-ribbon-bar::-webkit-scrollbar {
  display: none;
}

.excel-ribbon-group {
  display: none;
  align-items: stretch;
  height: 100%;
  gap: 0;
  width: auto;
}

.ribbon-link {
  background: #000000;
  color: #a1a1aa; /* Muted neutral for inactive */
  text-decoration: none;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  white-space: nowrap;
  height: 100%;
  min-width: 80px;
  width: auto;
  border-right: 1px solid #2d2d30;
  box-sizing: border-box;
  text-align: center;
  gap: 4px;
}

.ribbon-link i {
  font-size: 12px;
}

.ribbon-link:hover {
  background: #1f1f22;
  color: #e4e4e7;
}

.ribbon-link.active {
  background: #000000 !important;
  color: #ffffff !important;
  font-weight: 700;
  border-top: none;
  border-bottom: 2px solid #22c55e !important; /* Green accent */
  border-right: 1px solid #2d2d30;
  border-left: 1px solid #2d2d30;
  box-shadow: none;
  border-radius: 0;
  height: 100%;
}

.ribbon-badge {
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  margin-left: 4px;
}

/* Sheet Tab Bar Row */
.excel-sheet-bar {
  background: #000000;
  height: 28px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  user-select: none;
  border-top: 1px solid #2d2d30;
  padding: 0;
}

.excel-nav-arrows {
  display: flex;
  align-items: center;
  border-right: 1px solid #2d2d30;
  height: 100%;
}

.nav-arrow {
  background: none;
  border: none;
  color: #a1a1aa;
  font-size: 10px;
  padding: 0 10px;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-items: center;
  transition: all 0.15s ease;
}

.nav-arrow:hover {
  color: #8ab4f8;
  background: #1f1f22;
}

.excel-tabs-scroll-area {
  display: flex;
  align-items: stretch;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
}
.excel-tabs-scroll-area::-webkit-scrollbar {
  display: none;
}

.excel-sheet-tab {
  background: #000000;
  color: #a1a1aa; /* Muted neutral for inactive */
  border: none;
  border-right: 1px solid #2d2d30;
  cursor: pointer;
  height: 100%;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
  position: relative;
  box-sizing: border-box;
  min-width: 80px;
  width: auto;
  margin: 0;
  border-radius: 0;
  gap: 5px;
}

.excel-sheet-tab:hover {
  background: #1f1f22;
  color: #e4e4e7;
}

.excel-sheet-tab.active {
  background: #000000 !important;
  color: #ffffff !important;
  font-weight: 700;
  border-top: none;
  border-bottom: 2px solid #22c55e !important; /* Green accent for active tab */
  border-right: 1px solid #2d2d30;
  border-left: 1px solid #2d2d30;
  z-index: 10;
  height: 100%;
  border-radius: 0;
}

.sheet-caret {
  margin-left: 6px;
  font-size: 8px;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.excel-sheet-tab.active .sheet-caret {
  color: #ffffff !important;
  opacity: 0.9;
}

.excel-sheet-tab.active .sheet-icon {
  color: #ffffff !important; /* White active sheet icon */
}

.excel-sheet-tab .sheet-icon {
  font-size: 13px;
  color: #ef4444; /* Red inactive sheet icon */
}

/* Excel Status Area */
.excel-status-area {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  font-size: 11px;
  color: #71717a;
  border-left: 1px solid #27272a;
  height: 100%;
  background: #18181b;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.zoom-slider {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #a1a1aa;
}

/* Mobile responsive navigation bar adjustments */
@media (max-width: 768px) {
  .excel-status-area {
    display: none;
  }
  .excel-ribbon-bar {
    height: auto;
    padding: 8px 10px;
  }
  .excel-ribbon-group {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .ribbon-link {
    font-size: 11px;
    padding: 4px 8px;
  }
}

/* Add sheet plus button styling */
.excel-sheet-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #71717a;
  cursor: pointer;
  margin-left: 10px;
  align-self: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.excel-sheet-add:hover {
  background: #27272a;
  color: #ef4444;
}

.excel-sheet-add i {
  font-size: 10px;
}

/* Excel Table Layout System */
.excel-container {
  display: block;
  width: 100%;
  box-sizing: border-box;
  flex: 1 !important;
  min-height: 0;
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  position: relative;
  cursor: grab;
}
.excel-container:active {
  cursor: grabbing;
}

.excel-container::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
.excel-container::-webkit-scrollbar-track {
  background: #f4f4f5;
  border-top: 1px solid #e4e4e7;
}
.excel-container::-webkit-scrollbar-thumb {
  background: #ef4444;
  border: none;
  border-radius: 0;
  cursor: pointer;
}
.excel-container::-webkit-scrollbar-thumb:hover {
  background: #dc2626;
}
.excel-container::-webkit-scrollbar-corner {
  background: #f4f4f5;
}

.excel-table {
  width: 100%;
  min-width: 1000px;
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
.excel-table th {
  background: #111;
  color: #fff;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 4px 6px;
  border: 1px solid #333;
  position: sticky;
  top: 0;
  z-index: 20;
}
.excel-table td {
  padding: 4px 6px;
  border: 1px solid #ccc;
  font-size: 12px;
  vertical-align: top !important;
}

/* Excel Table Column Color Coding Palette */
.col-v-1 {
  background: #fef2f2 !important;
  color: #333;
  font-weight: 700;
}
.col-v-2 {
  background: #fff7ed !important;
  color: #333;
  font-weight: 800;
}
.col-v-3 {
  background: #fef9c3 !important;
  color: #333;
  font-weight: 700;
}
.col-v-4 {
  background: #f0fdf4 !important;
  color: #333;
}
.col-v-5 {
  background: #e0f2fe !important;
  color: #333;
  font-weight: 700;
}
.col-v-6 {
  background: #fafafa !important;
  color: #333;
}
.col-v-7 {
  background: #f3e8ff !important;
  color: #111;
  font-weight: 700;
}
.col-v-8 {
  background: #f1f5f9 !important;
  color: #333;
  font-weight: 700;
}
.col-v-9 {
  background: #ffffff !important;
  color: #333;
  font-weight: 700;
}
.col-v-10 {
  background: #fff7ed !important;
  color: #111;
  font-weight: 700;
}
.col-v-11 {
  background: #fffbeb !important;
  color: #111;
  font-weight: 700;
}
.col-v-12 {
  background: #ecfdf5 !important;
  color: #111;
  font-weight: 700;
}

.btn-punchy-black {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-punchy-black:hover {
  background: #ef4444;
  color: #fff;
  transform: scale(1.05);
}

.action-circle {
  width: 24px;
  height: 24px;
  font-size: 10px;
  background: #111;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.action-circle:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.action-circle.view:hover {
  background: #ef4444;
  color: #fff;
}
.action-circle.edit:hover {
  background: #4c6ef5;
  color: #fff;
}
.action-circle.delete:hover {
  background: #fa5252;
  color: #fff;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font-size: 7px;
  font-weight: 800;
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.2s;
}
.page-btn:hover {
  background: #111;
  color: #fff;
}
.page-btn.active {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.pagination-container {
  padding: 2px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #ccc;
  background: #fff;
  flex-shrink: 0 !important;
}
