/* admin/assets/css/admin.css */
:root {
  --primary: #c0392b;
  --primary-dark: #a82315;
  --primary-light: #e74c3c;
  --secondary: #2c3e50;
  --accent: #e67e22;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: #b8b8d0;
  --sidebar-active: #c0392b;
  --dark: #1e1e2a;
  --gray: #6c757d;
  --light-gray: #f4f6f9;
  --white: #ffffff;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-lg: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--light-gray); color: var(--dark); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* Login Page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 2rem;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 3rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand {
  text-align: center;
  margin-bottom: 2rem;
}
.login-card .brand i {
  font-size: 2.5rem;
  color: var(--primary);
}
.login-card .brand h1 {
  font-size: 1.5rem;
  margin-top: 0.5rem;
  color: var(--secondary);
}
.login-card .brand p {
  color: var(--gray);
  font-size: 0.9rem;
}
.login-card .form-group { margin-bottom: 1.25rem; }
.login-card label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--dark);
}
.login-card input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s;
}
.login-card input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 5px 15px rgba(192,57,43,0.3); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-info { background: var(--info); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-outline { background: transparent; border: 1px solid var(--gray); color: var(--gray); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; justify-content: center; }

.alert {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-danger { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* Admin Layout */
.admin-wrapper { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.sidebar-brand i { color: var(--primary); }
.sidebar-nav { padding: 1rem 0; flex: 1; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  color: var(--sidebar-text);
  transition: all 0.2s;
  font-size: 0.9rem;
  font-weight: 500;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.05); color: var(--white); }
.sidebar-nav a.active {
  background: rgba(192,57,43,0.15);
  color: var(--white);
  border-right: 3px solid var(--primary);
}
.sidebar-nav a i { width: 20px; text-align: center; font-size: 1rem; }
.sidebar-nav hr { border: none; border-top: 1px solid rgba(255,255,255,0.05); margin: 1rem 1.5rem; }
.sidebar-nav .badge {
  margin-left: auto;
  background: var(--primary);
  color: var(--white);
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}
.text-danger { color: var(--danger) !important; }

/* Main Area */
.main-area {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  background: var(--white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 500;
}
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--secondary);
}
.topbar-right { display: flex; align-items: center; gap: 1rem; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}
.topbar-user i { font-size: 1.5rem; color: var(--primary); }
.topbar-user small { color: var(--gray); font-weight: 400; }

.content { padding: 2rem; flex: 1; }

/* Dashboard Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--white);
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--white);
  flex-shrink: 0;
}
.stat-icon.primary { background: var(--primary); }
.stat-icon.success { background: var(--success); }
.stat-icon.info { background: var(--info); }
.stat-icon.warning { background: var(--warning); }
.stat-info h3 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.stat-info p { color: var(--gray); font-size: 0.85rem; margin: 0; }

/* Section */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.section-header h2 { font-size: 1.5rem; font-weight: 700; }

/* Tables */
.table-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-card .section-header { padding: 1.5rem 1.5rem 0; }
.table-toolbar { padding: 1rem 1.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

table {
  width: 100%;
  border-collapse: collapse;
}
thead { background: #f8f9fa; }
th {
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
td {
  padding: 1rem 1.5rem;
  border-top: 1px solid #f0f0f0;
  font-size: 0.9rem;
}
tr:hover { background: #fafafa; }
.table-actions { display: flex; gap: 0.5rem; }
.table-actions a, .table-actions button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-edit { background: #e8f4fd; color: var(--info); }
.btn-edit:hover { background: var(--info); color: var(--white); }
.btn-delete { background: #fde8e8; color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: var(--white); }
.btn-view { background: #e8f8e8; color: var(--success); }
.btn-view:hover { background: var(--success); color: var(--white); }

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-active { background: #d4edda; color: #155724; }
.status-inactive { background: #fde8e8; color: #c0392b; }
.status-draft { background: #fff3cd; color: #856404; }
.status-published { background: #d4edda; color: #155724; }

/* Forms */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  max-width: 900px;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.form-group .hint {
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 0.25rem;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}
select.form-control { appearance: auto; }
textarea.form-control { min-height: 120px; resize: vertical; }
textarea.form-control.editor { min-height: 400px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 1rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #f0f0f0; }

/* Search Box */
.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--light-gray);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #e0e0e0;
}
.search-box input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  min-width: 200px;
}
.search-box i { color: var(--gray); }

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: #e9ecef;
  border-radius: 50px;
  overflow: hidden;
  margin: 0.5rem 0;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 50px;
  transition: width 0.5s ease;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius);
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.modal-content h3 { margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 1rem; margin-top: 1.5rem; justify-content: flex-end; }

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state h3 { color: var(--dark); margin-bottom: 0.5rem; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .content { padding: 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  th, td { padding: 0.75rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 2rem 1.5rem; }
}