/* ============================================
   Logi Core - Main Stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@fontsource/google-sans/300.css');
@import url('https://cdn.jsdelivr.net/npm/@fontsource/google-sans/400.css');
@import url('https://cdn.jsdelivr.net/npm/@fontsource/google-sans/500.css');
@import url('https://cdn.jsdelivr.net/npm/@fontsource/google-sans/700.css');
@import url('https://cdn.jsdelivr.net/npm/@fontsource/google-sans/800.css');

:root {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --secondary: #64748b;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --sidebar-w: 248px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

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

html,
body {
  height: 100%;
  font-family: 'Google Sans', 'Product Sans', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- APP WRAPPER ---- */
.app-wrapper {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
}

.brand-logo-img {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -1.5px;
}

.brand-logo-img span {
  color: #64748b;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-section {
  margin-bottom: 20px;
}

.nav-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 5px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: #f8fafc;
  color: var(--text);
}

.nav-item.active {
  background: #e0f2fe;
  color: #3b82f6;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

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

.user-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.logout-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.logout-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

header.top-bar {
  background: #60a5fa;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: #334155;
  padding: 6px;
  border-radius: 6px;
}

.menu-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.page-breadcrumb {
  flex: 1;
  font-size: 13px;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-breadcrumb span {
  color: #0f172a;
  font-weight: 600;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  min-height: 0;
}

.content-area::-webkit-scrollbar {
  width: 8px;
}

.content-area::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.content-area::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

.content-area::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* ---- CARDS ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.purple {
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
}

.stat-icon.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.stat-icon.red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.stat-icon.yellow {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.stat-icon.blue {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent);
}

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

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

/* ---- TABLE ---- */
.table-wrap {
  overflow-x: auto;
}

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

thead tr {
  border-bottom: 1px solid var(--border);
}

th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

tbody tr:hover {
  background: var(--bg-elevated);
}

td {
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-muted);
}

td a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

td a:hover {
  color: var(--primary-light);
}

tbody tr:last-child {
  border-bottom: none;
}

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

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

.badge-green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.badge-yellow {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-gray {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-dim);
}

.badge-blue {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent);
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
}

.btn svg {
  width: 16px;
  height: 16px;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

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

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary-light);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

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

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

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

/* ---- FORMS ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

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

.form-input::placeholder {
  color: var(--text-dim);
}

.input-error {
  border-color: var(--danger) !important;
}

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

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* ---- ALERTS ---- */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
}

.alert svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--warning);
}

.alert-info {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.3);
  color: var(--accent);
}

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.page-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
}

.pagination .active span {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.pagination .disabled span {
  opacity: 0.4;
  cursor: not-allowed;
}

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

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

.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
}

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

/* ---- CODE BLOCK ---- */
.code-block {
  background: #0d0d14;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
  color: #a5f3fc;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---- API KEY DISPLAY ---- */
.api-key-reveal {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.api-key-reveal-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-key-reveal-title svg {
  width: 18px;
  height: 18px;
}

.api-key-value {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #34d399;
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-dim);
  transition: color 0.2s;
  flex-shrink: 0;
}

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

.copy-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: float 8s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--primary);
  top: -150px;
  left: -150px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: var(--secondary);
  bottom: -100px;
  right: -100px;
  animation-delay: 3s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent);
  top: 50%;
  left: 50%;
  animation-delay: 6s;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(20px, -20px) scale(1.05);
  }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px;
}

.login-card {
  background: rgba(22, 22, 31, 0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo-icon {
  display: inline-flex;
  margin-bottom: 16px;
}

.login-logo-icon svg {
  width: 60px;
  height: 60px;
}

.login-brand {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-tagline {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 20px;
  color: var(--danger);
  font-size: 13px;
}

.login-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.input-wrapper .form-input {
  padding-left: 42px;
}

.form-remember {
  margin: 4px 0 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}

.checkbox-label input {
  display: none;
}

.checkbox-custom {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.checkbox-label input:checked+.checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}

.login-btn:hover .btn-arrow {
  transform: translateX(4px);
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dot {
  opacity: 0.4;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
  }

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

  .menu-toggle {
    display: flex;
  }

  .content-area {
    padding: 16px;
  }

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

/* ---- MISC ---- */
.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

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

.mono {
  font-family: inherit;
  font-size: 12px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-state p {
  font-size: 15px;
}

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

/* ---- FUSE SPECIFIC OVERRIDES ---- */
.brand-name-sub {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  margin-top: 2px;
}

.top-bar-company-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 0px;
  transition: all 0.2s;
}

.top-bar-company-selector svg {
  width: 15px;
  height: 15px;
  color: #ffffff;
}

.top-bar-user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #ffffff;
  font-size: 14px;
  padding: 4px 14px 4px 4px;
  cursor: pointer;
  transition: all 0.2s;
}

span.environment-badge.env-sandbox {
  color: #ffffff;
}

.top-bar-user-profile .avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* User Profile Dropdown */
.profile-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.profile-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

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

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.profile-dropdown-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Dashboard tab navigation */
.tab-menu-nav {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 8px;
  flex-wrap: wrap;
}

.tab-menu-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin-right: 12px;
}

.tab-menu-item {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  padding: 6px 4px;
  position: relative;
  transition: color 0.2s;
}

.tab-menu-item:hover {
  color: #0f172a;
}

.tab-menu-item.active {
  color: #3b82f6;
}

/* Stat Widgets with Sparklines */
.fuse-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .fuse-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .fuse-stat-grid {
    grid-template-columns: 1fr;
  }
}

.fuse-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  box-shadow: var(--shadow);
}

.fuse-stat-label {
  font-size: 15px;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.fuse-stat-label svg {
  width: 16px;
  height: 16px;
  color: #64748b;
}

.fuse-stat-value {
  font-size: 40px;
  font-weight: 800;
  color: #0f172a;
  margin-top: 12px;
  line-height: 1;
}

.fuse-stat-sub-val {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
  display: flex;
  gap: 12px;
}

.fuse-stat-sub-val span strong {
  color: #0f172a;
}

.fuse-sparkline-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  pointer-events: none;
}

.fuse-sparkline-wrap svg {
  width: 100%;
  height: 100%;
}

.fuse-progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  margin-top: 16px;
  overflow: hidden;
}

.fuse-progress-bar-fill {
  height: 100%;
  background: #06b6d4;
  border-radius: 4px;
  width: 0;
  transition: width 0.6s ease;
}

/* Dashboard chart and widget area */
.fuse-dashboard-row {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .fuse-dashboard-row {
    grid-template-columns: 1fr;
  }
}

.fuse-chart-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

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

.fuse-chart-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

/* Custom SVG Bar Chart Styles */
.custom-bar-chart {
  position: relative;
  height: 260px;
  margin-top: 16px;
}

.chart-y-axis {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 30px;
  width: 40px;
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
  font-size: 11px;
  color: #64748b;
  border-right: 1px solid #e2e8f0;
  padding-right: 8px;
  text-align: right;
}

.chart-plot-area {
  position: absolute;
  left: 48px;
  right: 0;
  top: 0;
  bottom: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
}

.chart-grid-lines {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.chart-grid-line {
  width: 100%;
  height: 1px;
  background: #f1f5f9;
}

.chart-grid-line:last-child {
  background: #e2e8f0;
}

/* x-axis line */
.chart-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.chart-bars {
  display: flex;
  gap: 4px;
  align-items: flex-end;
}

.chart-bar {
  width: 14px;
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.5s ease;
  position: relative;
}

.chart-bar.blue {
  background: #3b82f6;
}

.chart-bar.teal {
  background: #06b6d4;
}

.chart-bar-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  visibility: hidden;
  opacity: 0;
  transition: all 0.2s;
  margin-bottom: 4px;
  z-index: 10;
}

.chart-bar:hover .chart-bar-tooltip {
  visibility: visible;
  opacity: 1;
}

.chart-x-axis {
  position: absolute;
  left: 48px;
  right: 0;
  bottom: 0;
  height: 24px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  font-size: 11px;
  color: #64748b;
}

.fuse-widget-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fuse-widget-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

/* Invoices Listing Layout overrides */
.fuse-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
}

.fuse-toolbar-btn {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.fuse-toolbar-btn svg {
  width: 16px;
  height: 16px;
  color: #64748b;
}

.fuse-search-input-wrap {
  position: relative;
  margin-left: auto;
  width: 260px;
}

@media (max-width: 768px) {
  .fuse-search-input-wrap {
    margin-left: 0;
    width: 100%;
  }
}

.fuse-search-input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  outline: none;
  font-size: 13.5px;
  color: #0f172a;
  transition: all 0.2s;
  font-family: 'Google Sans', 'Product Sans', 'Inter', sans-serif;
}

.fuse-search-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.fuse-search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #64748b;
  pointer-events: none;
}

.fuse-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 4px;
}

.fuse-list-count {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.fuse-list-select {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 6px;
  padding: 5px 28px 5px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 16px;
  font-family: 'Google Sans', 'Product Sans', 'Inter', sans-serif;
}

/* Table modern style with internal scroll & sticky header */
.fuse-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow-y: auto;
  max-height: calc(100vh - 280px);
}

.fuse-table-card::-webkit-scrollbar {
  width: 7px;
}

.fuse-table-card::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.fuse-table-card::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.fuse-table-card::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

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

.fuse-table th {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: none;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  letter-spacing: 0.3px;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fuse-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: #334155 !important;
  border-bottom: 1px solid #f1f5f9;
}

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

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

.fuse-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #bbf7f0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f766e;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.fuse-action-btn:hover {
  background: #99f6ec;
  color: #115e59;
}

.fuse-action-btn svg {
  width: 16px;
  height: 16px;
}

.skeleton-row {
  height: 12px;
  background: #f1f5f9;
  border-radius: 6px;
  margin: 4px 0;
}

.skeleton-row.w-80 {
  width: 80%;
}

.skeleton-row.w-60 {
  width: 60%;
}

.skeleton-row.w-40 {
  width: 40%;
}

.skeleton-row.w-20 {
  width: 20%;
}

/* ---- LOGIN PAGE STYLES ---- */
.login-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  font-family: 'Google Sans', 'Product Sans', 'Inter', sans-serif;
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
}

.login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.08;
  animation: float 10s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: #3b82f6;
  top: -150px;
  left: -150px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: #60a5fa;
  bottom: -100px;
  right: -100px;
  animation-delay: 3.5s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: #93c5fd;
  top: 50%;
  left: 50%;
  animation-delay: 7s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, -30px) scale(1.06);
  }
}

.login-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 40px;
  width: 100%;
  box-sizing: border-box;
}

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

.header-logo {
  height: 26px;
}

.header-divider {
  width: 1px;
  height: 18px;
  background-color: #cbd5e1;
}

.header-tagline {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #64748b;
}

.header-right {
  font-size: 14px;
  color: #64748b;
}

.lang-selector {
  font-weight: 500;
}

.lang-link {
  text-decoration: none;
  color: #64748b;
  padding: 0 2px;
  transition: color 0.2s;
}

.lang-link.active {
  color: #0ea5e9;
  font-weight: 700;
}

.login-container {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
}

.login-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  width: 100%;
  max-width: 460px;
  padding: 28px 36px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.025);
  box-sizing: border-box;
}

.login-card-title {
  font-size: 21px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 12px;
  text-align: left;
}

.login-card-subtitle {
  font-size: 14px;
  color: #64748b;
  margin-top: -8px;
  margin-bottom: 12px;
  line-height: 1.5;
  text-align: left;
}

.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 4px;
  padding: 8px 12px;
  margin-bottom: 12px;
  color: #ef4444;
  font-size: 13.5px;
  text-align: left;
  line-height: 1.4;
  box-sizing: border-box;
}

.login-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: #ef4444;
  fill: none;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  text-align: left;
}

.login-card .form-input {
  width: 100%;
  padding: 8px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  color: #1e293b;
  font-size: 15px;
  box-sizing: border-box;
  transition: all 0.2s ease;
  outline: none;
}

.login-card .form-input:focus {
  background: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-remember {
  display: flex;
  align-items: center;
  margin-top: 2px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  user-select: none;
}

.checkbox-label input {
  display: none;
}

.checkbox-custom {
  width: 15px;
  height: 15px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  display: inline-block;
  position: relative;
  background: #ffffff;
  transition: all 0.2s;
}

.checkbox-label input:checked+.checkbox-custom {
  background: #3b82f6;
  border-color: #3b82f6;
}

.checkbox-label input:checked+.checkbox-custom::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 3px;
  height: 6px;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.form-submit-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 6px;
}

.login-btn {
  width: auto;
  min-width: 100px;
  padding: 9px 24px;
  background: #60a5fa;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.login-btn:hover {
  background: #0284c7;
}

.login-btn:active {
  transform: scale(0.98);
}

.forgot-password-wrapper {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  color: #64748b;
}

.reset-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.reset-link:hover {
  text-decoration: underline;
}

.login-success-message {
  display: block;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 4px;
  padding: 12px;
  color: #10b981;
  font-size: 14px;
  text-align: left;
  line-height: 1.5;
}

.login-page-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 24px 48px;
  font-size: 13px;
  color: #94a3b8;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
}