/* ==========================================================================
   Lovable License Manager — Professional Reseller & Admin Portal CSS
   High-End Dark/Light Hybrid Studio Aesthetics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  --purple-primary: #4C00B0;
  --purple-hover: #3c008c;
  --purple-light: #f3e8ff;
  --purple-text: #4C00B0;
  --ethio-green: #009639;
  
  --bg-app: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  
  --border-color: #e2e8f0;
  --border-focus: #4C00B0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  font-family: var(--font-sans);
  background-color: #f8fafc !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Auth Gate Modal Screen (Light Mode) */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #ffffff 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.5rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--purple-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 20px rgba(76, 0, 176, 0.3);
}

.auth-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
  margin: 1.25rem 0 1rem 0;
  transition: border-color 0.2s ease;
}

.auth-input:focus {
  border-color: var(--purple-primary);
}

/* App Shell Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: #f8fafc !important;
  background: #f8fafc !important;
}

/* Sidebar Navigation (Light Mode) */
.sidebar {
  width: 260px;
  background-color: #ffffff !important;
  border-right: 1px solid #e2e8f0 !important;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #ffffff;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--purple-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand-text h2 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.sidebar-brand-text span {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ethio-green);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-menu {
  flex: 1;
  padding: 1.25rem 0.85rem;
  overflow-y: auto;
  background-color: #ffffff;
}

.menu-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.65rem;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 2px;
}

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

.menu-item.active {
  background: #4C00B0 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(76, 0, 176, 0.25);
}

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

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #e2e8f0;
  background-color: #ffffff;
}

.user-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.6rem 0.85rem;
}

/* Main Content Area */
.main-wrapper {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: calc(100% - 260px);
  background-color: #f8fafc !important;
  background: #f8fafc !important;
}

.top-bar {
  height: 68px;
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.top-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.status-pill-green {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
  padding: 0.3rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.78rem;
  font-weight: 800;
}

.page-content {
  padding: 2rem;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  background-color: #f8fafc !important;
  background: #f8fafc !important;
}

/* Cards & Grid Layouts */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.85rem;
  font-weight: 900;
  color: #0f172a;
}

/* Action Buttons */
.btn-purple {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--purple-primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.65rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.65rem;
  border: 1px solid #cbd5e1;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* Form Controls & Tables */
.card-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.custom-table th {
  background: #f8fafc;
  padding: 0.85rem 1rem;
  color: #64748b;
  font-weight: 800;
  border-bottom: 1px solid #e2e8f0;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.custom-table td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-weight: 600;
}

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

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}
