/**
 * ==============================================================================
 * SHORA ENTERPRISE B2B DESIGN SYSTEM (KITHA HRIS & PAYROLL)
 * Inspired by Linear, Stripe Dashboard, Gusto, and Deel
 * High Information Density • Modern Corporate Sapphire Palette • Crisp Typography
 * ==============================================================================
 */

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

/* --- 1. CORE DESIGN TOKENS --- */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Executive Corporate Palette (Modern Sapphire & Emerald, NOT Pitch Black) */
  --primary: #2563eb;               /* Enterprise Sapphire Blue */
  --primary-hover: #1d4ed8;
  --accent: #3b82f6;                /* Vibrant Accent Blue */
  --accent-hover: #2563eb;
  --secondary: #059669;             /* Compliant Emerald */
  --danger: #dc2626;                /* Audited Rose / Overdue */
  --warning: #d97706;               /* Pending Amber */
  --dark: #0f172a;                  /* Obsidian text color */
  --light: #f8fafc;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --gray-subtle: #cbd5e1;

  /* Surfaces & Structural Borders */
  --card-bg: #ffffff;
  --bg-page: #f8fafc;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;
  --input-bg: #ffffff;
  --input-color: #0f172a;
  --input-border: #cbd5e1;

  /* Smooth Modern Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
  --shadow-dropdown: 0 16px 36px -4px rgba(15, 23, 42, 0.12), 0 6px 12px -2px rgba(15, 23, 42, 0.04);

  /* Modern Ergonomic Radii (NO sharp 4px retro boxes!) */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 9999px;
}

body.dark-mode {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --accent: #60a5fa;
  --secondary: #10b981;
  --danger: #f87171;
  --warning: #fbbf24;
  --dark: #f8fafc;
  --light: #0b0f19;
  --bg-page: #0b0f19;
  --gray: #94a3b8;
  --gray-light: #64748b;
  --gray-subtle: #334155;

  --card-bg: #131b2e;
  --border-color: #1e293b;
  --border-subtle: #162032;
  --input-bg: #0f172a;
  --input-color: #f8fafc;
  --input-border: #334155;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.6);
  --shadow-dropdown: 0 16px 36px rgba(0, 0, 0, 0.8);
}

/* --- 2. GLOBAL RESET & BASE TYPOGRAPHY --- */
html, body {
  font-family: var(--font-sans) !important;
  background-color: var(--bg-page) !important;
  color: var(--dark) !important;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans) !important;
  font-weight: 700 !important;
  letter-spacing: -0.025em !important;
  color: var(--dark) !important;
}

/* Numeric & Financial Formatting (Clean Inter tabular nums, NO BOXES, NO OUTLINES) */
.kpi-number,
.data-table td,
.data-table th,
.amount,
.currency,
.nominal,
.tabular-nums,
[data-format="currency"] {
  font-variant-numeric: tabular-nums !important;
  background: transparent !important;
  border-color: transparent;
  box-shadow: none !important;
}

/* --- 3. REFINED B2B SIDEBAR --- */
.sidebar {
  width: 260px !important;
  background: var(--card-bg) !important;
  border-right: 1px solid var(--border-color) !important;
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.02) !important;
}

body.dark-mode .sidebar {
  background: #0f172a !important;
  border-right: 1px solid var(--border-color) !important;
}

.sidebar-header {
  padding: 1.1rem 1.25rem !important;
  background: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
  gap: 0.65rem !important;
}

.brand-logo-glow {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
  padding: 0 !important;
}

.brand-logo-img {
  height: 22px !important;
  width: 22px !important;
}

.brand-name {
  font-size: 1.2rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.5px !important;
  color: var(--dark) !important;
}

.brand-tag {
  background: #2563eb !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 0.58rem !important;
  font-weight: 700 !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  letter-spacing: 0.5px !important;
}

.brand-subtitle {
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  letter-spacing: 1.5px !important;
  color: var(--gray) !important;
  margin-top: 1px !important;
}

/* Workspace Pill Card */
.workspace-pill-card {
  padding: 0.55rem 0.75rem !important;
  border-radius: 8px !important;
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

body.dark-mode .workspace-pill-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.workspace-name {
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  color: var(--dark) !important;
}

.workspace-tag {
  font-size: 0.65rem !important;
  color: var(--gray) !important;
}

/* Sidebar Menu Categories & Items */
.sidebar-menu {
  padding: 0.75rem 0.65rem !important;
}

.menu-category {
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  color: var(--gray) !important;
  letter-spacing: 0.08em !important;
  margin: 1.1rem 0.65rem 0.4rem 0.65rem !important;
}

.menu-category::after {
  background: var(--border-color) !important;
}

.menu-item {
  padding: 0.5rem 0.75rem !important;
  border-radius: 8px !important;
  font-size: 0.835rem !important;
  font-weight: 500 !important;
  color: var(--gray) !important;
  transition: all 0.15s ease !important;
  margin-bottom: 2px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.menu-item:hover {
  background: #f1f5f9 !important;
  color: var(--dark) !important;
  transform: none !important;
}

body.dark-mode .menu-item:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
}

/* Active Menu Item */
.menu-item.active {
  background: rgba(37, 99, 235, 0.09) !important;
  color: #2563eb !important;
  font-weight: 600 !important;
  border-color: transparent !important;
  box-shadow: none !important;
  position: relative !important;
}

body.dark-mode .menu-item.active {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #93c5fd !important;
}

.menu-item.active::before {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  top: 18% !important;
  height: 64% !important;
  width: 3.5px !important;
  border-radius: 3px !important;
  background: #2563eb !important;
  box-shadow: none !important;
}

/* Monochrome Silhouettes for 3D icons in sidebar */
.menu-icon-box {
  width: 24px !important;
  height: 24px !important;
  border-radius: 6px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-right: 8px !important;
}

.menu-item:hover .menu-icon-box,
.menu-item.active .menu-icon-box {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.menu-3d-icon {
  width: 18px !important;
  height: 18px !important;
  object-fit: contain !important;
  filter: grayscale(100%) opacity(0.6) !important;
  transition: all 0.15s ease !important;
  transform: none !important;
}

.menu-item:hover .menu-3d-icon {
  filter: grayscale(100%) opacity(0.9) !important;
}

.menu-item.active .menu-3d-icon {
  filter: none !important;
  opacity: 1 !important;
}

/* Sidebar Badges / Pills */
.sidebar-pill {
  font-size: 0.62rem !important;
  font-weight: 700 !important;
  padding: 2px 7px !important;
  border-radius: 6px !important;
  letter-spacing: 0.04em !important;
  border: none !important;
}

.pill-live {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

.pill-tax {
  background: #dcfce7 !important;
  color: #15803d !important;
}

.pill-ess {
  background: #fef3c7 !important;
  color: #b45309 !important;
}

/* Sidebar Footer User Card */
.sidebar-footer {
  padding: 0.75rem 0.85rem !important;
  border-top: 1px solid var(--border-color) !important;
  background: var(--card-bg) !important;
}

body.dark-mode .sidebar-footer {
  background: #0f172a !important;
}

.user-profile-card {
  padding: 0.5rem 0.65rem !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
}

body.dark-mode .user-profile-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.user-avatar-img {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
}

.user-profile-name {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
}

.user-profile-role {
  font-size: 0.68rem !important;
  color: var(--gray) !important;
}

/* --- 4. TOP HEADER BAR --- */
.top-header {
  height: 58px !important;
  padding: 0 1.5rem !important;
  background: var(--card-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  box-shadow: none !important;
}

body.dark-mode .top-header {
  background: #0f172a !important;
}

#pageTitle {
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--dark) !important;
}

.tenant-badge {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #dbeafe !important;
  font-size: 0.74rem !important;
  font-weight: 600 !important;
  padding: 0.3rem 0.75rem !important;
  border-radius: 8px !important;
}

/* --- 5. MODERN EXECUTIVE HERO BANNER --- */
.dash-hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  padding: 1.15rem 1.4rem !important;
  margin-bottom: 1.25rem !important;
  box-shadow: var(--shadow) !important;
  gap: 1.25rem !important;
}

body.dark-mode .dash-hero-banner {
  background: linear-gradient(135deg, #131b2e 0%, #0f172a 100%) !important;
  border-color: #1e293b !important;
}

.dash-hero-banner::before {
  display: none !important;
}

.hero-left h2 {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 0.2rem !important;
}

.hero-left p {
  font-size: 0.82rem !important;
  color: var(--gray) !important;
  margin-bottom: 0.85rem !important;
  line-height: 1.45 !important;
}

.hero-greeting-tag {
  background: #eff6ff !important;
  border: 1px solid #dbeafe !important;
  padding: 0.2rem 0.65rem !important;
  font-size: 0.65rem !important;
  font-weight: 700 !important;
  color: #2563eb !important;
  letter-spacing: 0.04em !important;
  border-radius: 6px !important;
  margin-bottom: 0.4rem !important;
  display: inline-block;
}

.hero-quick-actions {
  gap: 0.55rem !important;
  display: flex;
  flex-wrap: wrap;
}

/* Modern Pill & Rounded Buttons (NOT black square boxes!) */
button,
.btn,
.hero-btn,
.btn-primary {
  border-radius: 9px !important;
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  cursor: pointer;
}

/* Primary Button: Sapphire Gradient with subtle glow */
.btn-primary,
.hero-btn-primary,
.hero-btn-indigo {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  border: none !important;
  padding: 0.5rem 1rem !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
}

.btn-primary:hover,
.hero-btn-primary:hover,
.hero-btn-indigo:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
  transform: translateY(-1px) !important;
}

/* Success Button */
.hero-btn-success {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #bbf7d0 !important;
  padding: 0.5rem 1rem !important;
}

.hero-btn-success:hover {
  background: #15803d !important;
  color: #ffffff !important;
  border-color: #15803d !important;
  transform: translateY(-1px) !important;
}

/* Outline / Secondary Button */
.hero-btn-outline,
.btn-secondary {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 1px solid #cbd5e1 !important;
  padding: 0.5rem 1rem !important;
  box-shadow: var(--shadow-xs) !important;
}

.hero-btn-outline:hover,
.btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
  color: #0f172a !important;
}

/* Period Widget */
.hero-period-card {
  padding: 0.85rem 1.15rem !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: var(--shadow-xs) !important;
}

body.dark-mode .hero-period-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

.period-header {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  color: var(--gray) !important;
}

.period-month {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: var(--dark) !important;
  margin-bottom: 0.4rem !important;
}

.progress-track {
  height: 5px !important;
  background: #e2e8f0 !important;
  border-radius: 3px !important;
  margin-bottom: 0.45rem !important;
}

.progress-fill {
  background: #2563eb !important;
  border-radius: 3px !important;
}

/* --- 6. MODERN FINANCIAL KPI CARDS --- */
.dash-grid,
.dash-kpi-horizontal-grid {
  gap: 1rem !important;
  margin-bottom: 1.25rem !important;
}

.dash-kpi-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 1.1rem 1.25rem !important;
  box-shadow: var(--shadow) !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.dash-kpi-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-lg) !important;
  border-color: #93c5fd !important;
}

body.dark-mode .dash-kpi-card {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

body.dark-mode .dash-kpi-card:hover {
  border-color: #3b82f6 !important;
}

.kpi-top {
  margin-bottom: 0.6rem !important;
}

.kpi-icon-glow {
  width: 36px !important;
  height: 36px !important;
  border-radius: 9px !important;
  background: #eff6ff !important;
  box-shadow: none !important;
  border: 1px solid #dbeafe !important;
  color: #2563eb !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 1rem !important;
}

.kpi-label {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.05em !important;
  color: #64748b !important;
  text-transform: uppercase !important;
}

.kpi-number {
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  color: #0f172a !important;
  line-height: 1.2 !important;
  margin: 0.25rem 0 !important;
}

body.dark-mode .kpi-number {
  color: #f8fafc !important;
}

.kpi-trend {
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
}

.trend-up {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: none !important;
}

.trend-neutral {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: none !important;
}

.kpi-footer-tags {
  margin-top: 0.75rem !important;
  padding-top: 0.65rem !important;
  border-top: 1px solid #f1f5f9 !important;
  display: flex !important;
  gap: 0.5rem !important;
}

.kpi-pill {
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
  color: #334155 !important;
}

/* --- 7. CLEAN, FLOATING ENTERPRISE DATA TABLES (NO HARSH BLACK BOXES) --- */
.card,
.dash-card,
.dash-panel-modern,
.card-content {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 14px !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden;
}

body.dark-mode .card,
body.dark-mode .dash-card,
body.dark-mode .dash-panel-modern {
  background: #131b2e !important;
  border-color: #1e293b !important;
}

/* Data Table: Soft, floating, no grid cage */
.data-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  font-size: 0.84rem !important;
  border: none !important;
}

.data-table thead tr th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 0.85rem 1rem !important;
  border-bottom: 1px solid #e2e8f0 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 10 !important;
}

body.dark-mode .data-table thead tr th {
  background: #0f172a !important;
  color: #94a3b8 !important;
  border-bottom-color: #1e293b !important;
}

.data-table tbody tr td {
  padding: 0.85rem 1rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  color: #1e293b !important;
  vertical-align: middle !important;
  background: transparent !important;
}

body.dark-mode .data-table tbody tr td {
  border-bottom-color: #1e293b !important;
  color: #f1f5f9 !important;
}

.data-table tbody tr:hover td {
  background-color: rgba(37, 99, 235, 0.03) !important;
}

body.dark-mode .data-table tbody tr:hover td {
  background-color: rgba(59, 130, 246, 0.06) !important;
}

/* Table Micro-Actions (Rounded pills, NOT sharp black buttons!) */
.btn-action {
  padding: 0.35rem 0.75rem !important;
  border-radius: 7px !important;
  font-size: 0.76rem !important;
  font-weight: 600 !important;
  border: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  transition: all 0.15s ease !important;
  cursor: pointer;
}

.btn-edit {
  background: #eff6ff !important;
  color: #2563eb !important;
  border: 1px solid #dbeafe !important;
}

.btn-edit:hover {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  transform: translateY(-1px) !important;
}

.btn-delete {
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fee2e2 !important;
}

.btn-delete:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  transform: translateY(-1px) !important;
}

/* Status Badges in Tables (Soft Pastels, NO harsh black boxes) */
.badge,
.status-pill {
  border-radius: 6px !important;
  padding: 3px 9px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  border: none !important;
}

.badge-success, .badge-green {
  background: #dcfce7 !important;
  color: #15803d !important;
}

.badge-danger, .badge-red {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}

.badge-warning, .badge-amber {
  background: #fef3c7 !important;
  color: #b45309 !important;
}

.badge-info, .badge-blue {
  background: #dbeafe !important;
  color: #1e40af !important;
}

/* Form Inputs & Controls */
input, select, textarea {
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background-color: #ffffff !important;
  color: #0f172a !important;
  font-family: var(--font-sans) !important;
  font-size: 0.84rem !important;
  padding: 0.55rem 0.85rem !important;
  transition: all 0.15s ease !important;
}

input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Modals: Smooth, elevated */
.modal-content {
  border-radius: 16px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: var(--shadow-dropdown) !important;
  background: #ffffff !important;
  overflow: hidden;
}

.modal-header {
  padding: 1.15rem 1.4rem !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.modal-footer {
  padding: 1rem 1.4rem !important;
  border-top: 1px solid #f1f5f9 !important;
  background: #f8fafc !important;
}
