/**
 * Admin V2 - Main Stylesheet
 * Moderne, rent design med blå toner
 */

:root {
  /* Primary */
  --primary-600: #2563EB;
  --primary-500: #3B82F6;
  --primary-400: #60A5FA;
  --primary-300: #93C5FD;
  --primary-100: #EFF6FF;

  /* Neutrals */
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --muted-600: #334155;
  --muted-400: #64748B;
  --muted-200: #E2E8F0;
  --muted-100: #F1F5F9;

  /* Status */
  --success: #16A34A;
  --warning: #F59E0B;
  --danger:  #DC2626;
  --info:    #0EA5E9;

  /* Accent */
  --accent: #7C3AED;

  /* Misc */
  --radius: 8px;
  --shadow: 0 6px 18px rgba(15,23,42,0.06);
}

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

body {
  background: var(--bg);
  color: var(--muted-600);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

/* Buttons: se buttons.css */

.page-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.page-title-bar h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-bar h1 i {
  color: var(--primary-600);
}

.page-title-bar .subtitle {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0;
}

.page-actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* ==================== CARDS ==================== */
/* Card uden titel */
.card {
  background: var(--surface);
  border: 1px solid var(--muted-200);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* Card med titel */
.card-with-header {
  background: var(--surface);
  border: 1px solid var(--muted-200);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-with-header .card-header {
  background: var(--muted-100);
  padding: 16px 24px;
  border-bottom: 1px solid var(--muted-200);
}

.card-with-header .card-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--muted-600);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-with-header .card-body {
  padding: 24px;
}

/* ==================== LAYOUT ==================== */
body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}

/* ==================== LOGIN PAGE ==================== */
body.adminv2-login-page {
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.adminv2-login-page .login-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 400px;
}

.adminv2-login-page .login-card h1 {
  margin: 0 0 8px 0;
  font-size: 1.75rem;
  color: #1f2937;
}

.adminv2-login-page .login-card p {
  margin: 0 0 24px 0;
  color: #6b7280;
}

.adminv2-login-page .btn-login-submit {
  width: 100%;
}

.adminv2-login-page .login-card .form-group {
  margin-bottom: 20px;
}

.container {
  width: 100%;
  padding: 0 20px;
}

.main-wrapper {
  flex: 1;
  margin-left: 260px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: 260px;
  background: var(--surface);
  border-right: 1px solid var(--muted-200);
  padding: 20px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 0 20px 20px 20px;
  border-bottom: 1px solid var(--muted-200);
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-600);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-nav {
  padding: 0 10px;
  flex: 1;
}

.sidebar-section-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-400);
  margin: 0 12px 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--muted-600);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s;
  margin-bottom: 4px;
}

.sidebar-item:hover {
  background: var(--muted-100);
  color: var(--primary-600);
}

.sidebar-item.active {
  background: var(--primary-100);
  color: var(--primary-600);
  font-weight: 500;
}

.sidebar-item i {
  width: 18px;
  text-align: center;
  font-size: 16px;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--muted-200);
  margin-top: auto;
}

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

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
}

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

.sidebar-user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-900);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-role {
  font-size: 12px;
  color: var(--muted-500);
  text-transform: capitalize;
}

/* User Avatar Small (for tables) */
.user-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

/* ==================== CONTENT ==================== */
.content-header {
  background: var(--surface);
  border-bottom: 1px solid var(--muted-200);
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.content-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--muted-900);
  margin: 0 0 4px 0;
}

.content-header p {
  font-size: 14px;
  color: var(--muted-500);
  margin: 0;
}

.container {
  padding: 32px;
  flex: 1;
  overflow-y: auto;
  width: 100%;
  box-sizing: border-box;
}

/* ==================== STATS GRID ==================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--muted-200);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 13px;
  color: var(--muted-400);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--muted-600);
}

.stat-change {
  font-size: 12px;
  margin-top: 6px;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

/* ==================== TABLE ==================== */
.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--muted-200);
  border-radius: 12px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--muted-100);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--muted-600);
  border-bottom: 1px solid var(--muted-200);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--muted-200);
  font-size: 14px;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--muted-100);
}

/* ==================== FORMS ==================== */
.form-group {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted-600);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--muted-200);
  border-radius: var(--radius);
  font-size: 14px;
  transition: all 0.2s;
  background: var(--surface);
  color: var(--muted-600);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px var(--primary-100);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ==================== BADGES ==================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.badge-primary {
  background: var(--primary-100);
  color: var(--primary-600);
}

.badge-success {
  background: #DCFCE7;
  color: var(--success);
}

.badge-warning {
  background: #FEF3C7;
  color: #D97706;
}

.badge-danger {
  background: #FEE2E2;
  color: var(--danger);
}

.badge-info {
  background: #E0F2FE;
  color: var(--info);
}

.badge-secondary {
  background: var(--muted-100);
  color: var(--muted-600);
}

/* ==================== ALERTS ==================== */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: #DCFCE7;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.alert-danger {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

.alert-warning {
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #FDE68A;
}

.alert-info {
  background: #E0F2FE;
  color: #075985;
  border: 1px solid #BAE6FD;
}

/* ==================== UTILS ==================== */
.text-muted {
  color: var(--muted-400);
}

.text-primary {
  color: var(--primary-600);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .content {
    margin-left: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-title-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .card {
    padding: 16px;
  }

  .card-with-header .card-header {
    padding: 12px 16px;
  }

  .card-with-header .card-body {
    padding: 16px;
  }
}

/* ==================== DRAG SORT ==================== */
.drag-cell {
  width: 44px;
  text-align: center;
}

.drag-handle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: grab;
  transition: color 0.2s, background 0.2s;
}

.drag-handle:hover {
  background: #f1f5f9;
  color: #475569;
}

.drag-handle:active {
  cursor: grabbing;
}

.sortable-chosen {
  background: #f8fafc !important;
}
