:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --bg-main: #f1f5f9;
  --bg-card: #ffffff;
  --sidebar: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-hover: #1e293b;
  --text-main: #334155;
  --text-muted: #64748b;
  --border: #e2e8f0;
}

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.5;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

.sidebar {
  width: 260px;
  background-color: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 24px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-nav {
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.sidebar-nav a {
  padding: 12px 24px;
  color: var(--sidebar-text);
  font-weight: 500;
  transition: background 0.2s;
}

.sidebar-nav a:hover {
  background-color: var(--sidebar-hover);
  color: #fff;
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 32px;
}

.content-wrapper {
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Utils */
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-auto { margin-top: auto; }
.text-center { text-align: center; }
.text-danger { color: #ef4444 !important; }
.w-100 { width: 100%; }

/* Typography */
h1 {
  font-size: 1.875rem;
  color: #0f172a;
  margin-bottom: 8px;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.dashboard-card {
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

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

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

.btn-danger {
  background-color: var(--danger);
  color: #fff;
}

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

.btn-outline {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background-color: var(--bg-main);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 0.8125rem;
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: #0f172a;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
  resize: vertical;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
}

.errors {
  list-style: none;
  color: var(--danger);
  font-size: 0.875rem;
  margin-top: 6px;
}

.form-card {
  max-width: 800px;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  font-weight: 600;
  color: #0f172a;
  background-color: #f8fafc;
}

.table td.actions {
  white-space: nowrap;
  width: 1%;
}

.table td.actions form {
  margin-left: 8px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background-color: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

/* Login */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 128px);
}

.login-card {
  width: 100%;
  max-width: 400px;
}

.login-card h2 {
  text-align: center;
  margin-bottom: 24px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 24px;
  font-weight: 500;
}

.alert-success {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
