/* assets/css/mira-theme.css */
/* Mira Admin Dashboard Design System for Aspire Clientele */

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

:root {
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Color Palette */
  --sidebar-bg: #1c2536;
  --sidebar-hover: #25334a;
  --sidebar-active: #2f3e58;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-border: #2e3c54;

  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-alt: #f1f5f9;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --primary-text: #4338ca;

  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #0ea5e9;
  --info-light: #f0f9ff;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  --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.04);
  --shadow-card: 0 4px 20px -2px rgba(17, 24, 39, 0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --header-height: 68px;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 0.875rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Wrapper Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar (Mira Dark Theme) */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  transition: transform 0.2s ease;
  border-right: 1px solid var(--sidebar-border);
}

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

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.sidebar-brand {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  min-width: 0;
  line-height: 1.25;
}

.sidebar-brand span {
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.78rem;
  display: block;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 165px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
}

.nav-section-title {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #64748b;
  padding: 12px 12px 6px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--sidebar-text);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: #334155;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  border: 2px solid #475569;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

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

.user-role {
  font-size: 0.72rem;
  color: #94a3b8;
}

/* Main Content Area */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Header Bar */
.top-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
}

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

.header-search {
  position: relative;
  width: 320px;
}

.header-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  background: #f8fafc;
  outline: none;
  transition: all 0.15s ease;
}

.header-search input:focus {
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.header-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

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

.company-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.pan-pill {
  font-size: 0.7rem;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: #475569;
  font-weight: 700;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

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

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

.btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.btn-icon:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

/* Page Container */
.page-content {
  padding: 28px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Metric KPI Cards (Mira Style) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

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

.metric-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon.indigo { background: var(--primary-light); color: var(--primary); }
.metric-icon.emerald { background: var(--success-light); color: var(--success); }
.metric-icon.rose { background: var(--danger-light); color: var(--danger); }
.metric-icon.amber { background: var(--warning-light); color: var(--warning); }
.metric-icon.sky { background: var(--info-light); color: var(--info); }

.metric-value {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.metric-footer {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-trend-up {
  color: var(--success);
  font-weight: 600;
}

.metric-trend-down {
  color: var(--danger);
  font-weight: 600;
}

/* Card Component */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

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

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-body {
  padding: 24px;
}

.card-body-flush {
  padding: 0;
}

/* Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th {
  background: #f8fafc;
  padding: 12px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 14px 18px;
  font-size: 0.84rem;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

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

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-paid {
  background: var(--success-light);
  color: #065f46;
}
.badge-paid::before { background: var(--success); }

.badge-partially_paid {
  background: var(--info-light);
  color: #0369a1;
}
.badge-partially_paid::before { background: var(--info); }

.badge-sent, .badge-unpaid {
  background: var(--warning-light);
  color: #92400e;
}
.badge-sent::before, .badge-unpaid::before { background: var(--warning); }

.badge-overdue {
  background: var(--danger-light);
  color: #991b1b;
}
.badge-overdue::before { background: var(--danger); }

.badge-draft {
  background: #f1f5f9;
  color: #475569;
}
.badge-draft::before { background: #94a3b8; }

.badge-cancelled {
  background: #f1f5f9;
  color: #94a3b8;
  text-decoration: line-through;
}

/* Tab Navigation */
.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  padding-bottom: 2px;
}

.tab-btn {
  padding: 8px 16px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

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

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Controls */
.form-group {
  margin-bottom: 18px;
}

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

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: all 0.15s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Dynamic Invoice Builder Table */
.invoice-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.invoice-items-table th {
  background: #f1f5f9;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.invoice-items-table td {
  padding: 8px 6px;
  vertical-align: top;
}

.invoice-items-table input, .invoice-items-table select {
  width: 100%;
  padding: 7px 10px;
  font-size: 0.84rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
}

.invoice-items-table input:focus, .invoice-items-table select:focus {
  border-color: var(--primary);
}

/* Invoice Summary Box */
.invoice-summary-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  width: 360px;
  margin-left: auto;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.summary-row.total {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  border-top: 2px solid var(--border-color);
  padding-top: 10px;
  margin-top: 8px;
}

.amount-words-box {
  background: #eef2ff;
  border: 1px dashed #c7d2fe;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.8125rem;
  color: #3730a3;
  margin-top: 16px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.2s ease;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
}

/* User Profile Menu & Dropdown */
.user-menu-container {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: all 0.15s ease;
}

.user-profile-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15);
  display: none;
  flex-direction: column;
  z-index: 1050;
  overflow: hidden;
  animation: dropdownFadeIn 0.15s ease;
}

.user-menu-dropdown.show {
  display: flex;
}

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

.user-dropdown-header {
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.84rem;
  color: var(--text-main);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.user-dropdown-item:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.user-dropdown-item.danger {
  color: var(--danger);
  border-top: 1px solid var(--border-color);
}

.user-dropdown-item.danger:hover {
  background: #fef2f2;
}

/* Authentication Login View */
.login-screen-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  padding: 36px 32px;
}

.login-brand-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 auto 16px auto;
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

/* ==========================================================================
   Simple Invoice Configuration Suite (Two-Pane Layout)
   ========================================================================== */
.config-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 992px) {
  .config-layout {
    grid-template-columns: 1fr;
  }
}

.config-tree-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.config-tree-header {
  padding: 16px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-tree-header h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.config-tree-body {
  padding: 12px 10px;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.config-tree-group {
  margin-bottom: 8px;
}

.config-tree-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.config-tree-group-title:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.config-tree-children {
  padding-left: 20px;
  border-left: 1.5px solid #e2e8f0;
  margin-left: 16px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.config-tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.config-tree-item:hover {
  background: #f8fafc;
  color: var(--primary);
  transform: translateX(2px);
}

.config-tree-item.active {
  background: #eef2ff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}

.config-panel-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 28px 32px;
  min-height: 600px;
}

.config-panel-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-panel-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.config-panel-subtitle {
  font-size: 0.85rem;
  color: #64748b;
  margin-top: 4px;
}

.color-swatch-list {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.color-swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1.5px #cbd5e1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.active {
  box-shadow: 0 0 0 3px var(--primary);
  transform: scale(1.15);
}

.token-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #f1f5f9;
  color: #334155;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: monospace;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.token-pill:hover {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.bank-item-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.bank-item-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.bank-item-card.is-default {
  border-left: 4px solid var(--primary);
  background: #fafafa;
}

/* ==========================================================================
   Simple Invoice Comprehensive Reports Suite Styles
   ========================================================================== */
.reports-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1024px) {
  .reports-layout {
    grid-template-columns: 1fr;
  }
}

.reports-sidebar-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.reports-sidebar-header {
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reports-menu-list {
  padding: 8px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reports-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: all 0.15s ease;
}

.reports-menu-item:hover {
  background: #f1f5f9;
  color: var(--primary);
}

.reports-menu-item.active {
  background: #eef2ff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary);
}

.reports-menu-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.reports-menu-item.active .reports-menu-radio {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: inset 0 0 0 2.5px #ffffff;
}

.report-viewer-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.report-controls-panel {
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  padding: 16px 20px;
}

.report-tab-strip {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.report-tab-btn {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.report-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #ffffff;
  border-radius: 6px 6px 0 0;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 16px;
  align-items: end;
}

.report-options-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
}

.report-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
}

.report-radio-group {
  display: inline-flex;
  background: #ffffff;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.report-radio-pill {
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s ease;
}

.report-radio-pill.active {
  background: var(--primary);
  color: #ffffff;
}

.report-sheet-view {
  padding: 24px 28px;
  min-height: 500px;
  background: #ffffff;
}

.report-doc-header {
  margin-bottom: 20px;
}

.report-doc-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.report-doc-subtitle {
  font-size: 0.85rem;
  color: #64748b;
}

.report-grid-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  margin-bottom: 20px;
}

.report-grid-table th {
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.report-grid-table.no-lines th,
.report-grid-table.no-lines td {
  border-left: none;
  border-right: none;
}

.report-grid-table td {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.report-grid-table tr:hover td {
  background: #f8fafc;
}

.report-group-header-row td {
  background: #e2e8f0 !important;
  font-weight: 800;
  color: #0f172a;
  font-size: 0.88rem;
  padding: 10px 12px;
}

.report-subtotal-row td {
  background: #f8fafc;
  font-weight: 700;
  color: #0f172a;
  border-top: 2px solid #cbd5e1;
}

.report-grandtotal-row td {
  background: #eef2ff !important;
  font-weight: 800;
  color: #312e81;
  font-size: 0.92rem;
  border-top: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
}

.columns-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 16px;
  padding: 12px 0;
}

/* ==========================================================================
   WORDPRESS-LIKE MEDIA LIBRARY MODAL
   ========================================================================== */
.wp-media-modal {
  width: 95vw;
  max-width: 1040px;
  height: 86vh;
  min-height: 560px;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.wp-media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid #dcdcde;
}

.wp-media-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e1e1e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wp-media-tabs {
  display: flex;
  padding: 0 20px;
  background: #f0f0f1;
  border-bottom: 1px solid #dcdcde;
  gap: 4px;
}

.wp-media-tab-btn {
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #50575e;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.wp-media-tab-btn:hover {
  color: #135e96;
}

.wp-media-tab-btn.active {
  color: #135e96;
  background: #ffffff;
  border-bottom: 3px solid #2271b1;
  border-top: 1px solid #dcdcde;
  border-left: 1px solid #dcdcde;
  border-right: 1px solid #dcdcde;
  margin-bottom: -1px;
  border-radius: 4px 4px 0 0;
}

.wp-media-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Tab 1: Upload Files */
.wp-uploader-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  background: #f6f7f7;
  overflow-y: auto;
}

.wp-dropzone-box {
  width: 100%;
  max-width: 580px;
  padding: 48px 32px;
  border: 2px dashed #c3c4c7;
  border-radius: 10px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.wp-dropzone-box:hover, .wp-dropzone-box.dragover {
  border-color: #2271b1;
  background: #f0f6fc;
}

.wp-dropzone-icon {
  font-size: 48px;
  margin-bottom: 12px;
  color: #2271b1;
}

.wp-dropzone-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e1e1e;
  margin-bottom: 6px;
}

.wp-dropzone-subtitle {
  font-size: 13px;
  color: #646970;
  margin-bottom: 20px;
}

/* Tab 2: Media Library Layout */
.wp-library-view {
  flex: 1;
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.wp-library-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #dcdcde;
}

.wp-library-toolbar {
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid #dcdcde;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.wp-library-grid-container {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #ffffff;
}

.wp-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}

.wp-media-item {
  position: relative;
  aspect-ratio: 1;
  background: #f0f0f1;
  border: 2px solid transparent;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
  user-select: none;
}

.wp-media-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  border-color: #72aee6;
}

.wp-media-item.selected {
  border-color: #2271b1;
  box-shadow: inset 0 0 0 2px #2271b1, 0 4px 12px rgba(34, 113, 177, 0.2);
}

.wp-media-item.selected::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: #2271b1;
  color: #ffffff;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.wp-media-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wp-media-item .wp-doc-icon {
  font-size: 38px;
  margin-bottom: 4px;
}

.wp-media-item .wp-doc-label {
  font-size: 10.5px;
  font-weight: 600;
  color: #475569;
  text-align: center;
  padding: 0 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Right Sidebar */
.wp-media-sidebar {
  width: 310px;
  background: #f6f7f7;
  padding: 16px;
  overflow-y: auto;
  font-size: 12.5px;
  color: #50575e;
}

.wp-sidebar-heading {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1e1e1e;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  border-bottom: 1px solid #dcdcde;
  padding-bottom: 6px;
}

.wp-sidebar-preview {
  width: 100%;
  height: 140px;
  background: #ffffff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  overflow: hidden;
}

.wp-sidebar-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.wp-sidebar-meta-row {
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
}

.wp-sidebar-meta-row strong {
  color: #1e1e1e;
}

/* Modal Footer */
.wp-media-footer {
  padding: 12px 20px;
  background: #ffffff;
  border-top: 1px solid #dcdcde;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wp-selected-summary {
  font-size: 13px;
  color: #50575e;
  font-weight: 500;
}

/* ==========================================================================
   COMMAND PALETTE (CTRL+K / CMD+K)
   ========================================================================== */
.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.cmd-palette-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.cmd-palette-box {
  width: 100%;
  max-width: 620px;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cmdScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cmd-palette-search-wrapper {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
}

.cmd-palette-search-icon {
  font-size: 1.15rem;
  color: #818cf8;
}

.cmd-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: #f8fafc;
}

.cmd-palette-input::placeholder {
  color: #64748b;
}

.cmd-palette-badge {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: #94a3b8;
  font-family: monospace;
}

.cmd-palette-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  padding: 8px 12px 4px 12px;
}

.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.cmd-item:hover,
.cmd-item.active {
  background: rgba(99, 102, 241, 0.22);
  color: #ffffff;
}

.cmd-item.active .cmd-item-title {
  color: #818cf8;
}

.cmd-item-icon {
  font-size: 16px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cmd-item-content {
  flex: 1;
  min-width: 0;
}

.cmd-item-title {
  font-weight: 600;
  font-size: 13.5px;
  color: #f1f5f9;
}

.cmd-item-subtitle {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-shortcut {
  font-size: 11px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.cmd-palette-footer {
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
}

.cmd-palette-footer kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
  color: #94a3b8;
  font-family: inherit;
}


