/* ==========================================================================
   SeferLog WebPanel (webpanel.seferlog.com) — Admin Styling & Dual Theme
   ========================================================================== */

:root {
  /* Default Light Theme Tokens */
  --bg-body: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;
  --border-color: #e2e8f0;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --accent: #10b981;
  --accent-light: #ecfdf5;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 14px -2px rgba(0,0,0,0.06);
  --transition: all 0.25s ease;
}

/* Dark Theme Overrides */
[data-theme="dark"] {
  --bg-body: #0b0f19;
  --bg-sidebar: #111827;
  --bg-card: #1f2937;
  --bg-hover: #374151;
  --border-color: #374151;
  
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: rgba(59, 130, 246, 0.15);
  
  --accent: #10b981;
  --accent-light: rgba(16, 185, 129, 0.15);
  
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
}

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

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem;
  width: calc(100% - 260px);
}

/* Sidebar Brand & Nav */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nav-item button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.nav-item button:hover, .nav-item button.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* User Profile & Theme Toggle Footer in Sidebar */
.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.user-info h5 {
  font-size: 0.85rem;
  color: var(--text-main);
}

.user-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.theme-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Header & Top Bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.page-title h1 {
  font-size: 1.8rem;
  font-weight: 800;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: var(--bg-card); border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.stat-card-label { font-size: 0.85rem; color: var(--text-muted); }
.stat-card-value { font-size: 2.1rem; font-weight: 800; margin-top: 0.2rem; }
.stat-card-change { font-size: 0.8rem; color: var(--accent); font-weight: 600; }

/* Tables */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  margin-bottom: 2rem;
}

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

.data-table th {
  background: var(--bg-hover);
  padding: 0.9rem 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-success { background: var(--accent-light); color: var(--accent); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

/* Login Page Styling */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-body);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.form-group {
  margin-bottom: 1.2rem;
  text-align: left;
}

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

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
}
