/* ============================================
   EZYVYAPAR — Dashboard & Admin Styles
   Professional SaaS Design System
   ============================================ */

body {
  transition: background 0.3s ease, color 0.3s ease;
}

:root {
  --primary: #0B6E77;
  --primary-dark: #085258;
  --primary-light: #0FA3A5;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --border: #d1d5db;
  --border-light: #e5e7eb;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #6b7280;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-bg: linear-gradient(180deg, #0e5a62 0%, #0a4249 100%);
  --primary-glow: rgba(11, 110, 119, 0.15);
}

[data-theme="dark"] {
  --bg-page: #0f1923;
  --bg-card: #182430;
  --primary-glow: rgba(20,184,166,0.1);
  --border: #2a3f4e;
  --border-light: #223344;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #7a8a9e;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --sidebar-bg: linear-gradient(180deg, #091a1e 0%, #061216 100%);
}

[data-theme="dark"] .auth-left {
  background: linear-gradient(135deg, #091a1e 0%, #061216 50%, #040e10 100%) !important;
}

/* ============ AUTH PAGES (PROFESSIONAL THEME) ============ */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: var(--bg-page);
}

.auth-left {
  flex: 1;
  background: linear-gradient(135deg, #0e5a62 0%, #0a4a52 50%, #083e45 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.auth-left::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -30%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(11, 110, 119, 0.15), transparent 70%);
  border-radius: 50%;
}

.auth-left::after {
  content: '';
  position: absolute;
  bottom: -25%;
  left: -25%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(11, 110, 119, 0.08), transparent 70%);
  border-radius: 50%;
}

.auth-left .brand-lg {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

.auth-left .logo-icon-lg {
  width: 56px;
  height: 56px;
  background: rgba(11, 110, 119, 0.25);
  border: 2px solid rgba(11, 110, 119, 0.3);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.5rem;
  color: white;
}

.auth-left .brand-name {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: white;
}

.auth-left .brand-name span {
  color: var(--primary-light);
}

.auth-left h2 {
  font-size: 1.8rem;
  color: white;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.auth-left p {
  color: rgba(255,255,255,0.6);
  text-align: center;
  max-width: 400px;
  line-height: 1.7;
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
}

.auth-features {
  list-style: none;
  margin-top: 40px;
  position: relative;
  z-index: 1;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
}

.auth-features li .af-icon {
  width: 40px;
  height: 40px;
  background: rgba(11, 110, 119, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.auth-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: var(--bg-card);
  color: var(--text-primary);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 700;
}

.auth-card .subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: all 0.3s;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 110, 119, 0.08);
}

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

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

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.form-check input {
  accent-color: var(--primary);
}

.form-link {
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
}

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

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
  font-family: inherit;
}

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

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: none;
}

/* ============ RESPONSIVE AUTH ============ */
@media (max-width: 768px) {
  .auth-page {
    flex-direction: column;
  }

  .auth-left {
    padding: 28px 20px;
    min-height: auto;
  }

  .auth-left h2 {
    font-size: 1.3rem;
    margin-bottom: 4px;
  }

  .auth-left p {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .auth-left .brand-lg img {
    height: 44px;
  }

  .auth-right {
    padding: 28px 20px;
    flex: none;
  }

  .auth-card {
    max-width: 100%;
  }

  .auth-card h1 {
    font-size: 1.4rem;
  }

  .auth-card .subtitle {
    font-size: 0.88rem;
    margin-bottom: 20px;
  }

  .auth-features {
    display: none;
  }

  .auth-footer {
    margin-top: 20px;
    font-size: 0.85rem;
  }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 420px) {
  .auth-left {
    padding: 20px 16px;
  }

  .auth-left h2 {
    font-size: 1.15rem;
  }

  .auth-right {
    padding: 24px 16px;
  }

  .auth-card h1 {
    font-size: 1.25rem;
  }
}

/* ============ SHARED DASHBOARD LAYOUT (Professional SaaS Theme) ============ */
/* Used by both merchant and admin dashboards. Admin inline styles override these. */

.dashboard {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
  width: 0;
  display: none;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 12px 16px 8px;
  letter-spacing: 1px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 4px 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.72);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-weight: 500;
  position: relative;
  font-family: inherit;
  width: calc(100% - 16px);
  text-align: left;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.05);
  color: #ffffff;
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-left: 3px solid #ffffff;
  padding-left: 13px;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  flex-shrink: 0;
}

.sidebar-link .badge {
  margin-left: auto;
  background: rgba(11, 110, 119, 0.3);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  min-width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

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

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

.user-email {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Topbar ── */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  box-shadow: var(--shadow-sm);
}

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

.topbar-left h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.mobile-sidebar-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
}

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

/* ── Page Content ── */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg-page);
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
}

/* ── Common Dashboard Components ── */
.btn {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.8rem;
}

/* ── Responsive Dashboard ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }

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

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

  .mobile-sidebar-btn {
    display: flex;
  }

  .topbar-left h1 {
    font-size: 1rem;
  }

  .page-content {
    padding: 16px;
  }
}
