/* ============================================
   HostPanel Lite - Hostingbeheerpaneel
   ============================================ */

:root {
  --primary: #059669;
  --primary-dark: #047857;
  --primary-light: #d1fae5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-w: 240px;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--gray-900);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-700);
}

.sidebar-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}
.sidebar-logo span { color: var(--primary); }

.sidebar-menu {
  list-style: none;
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1.5rem;
  color: var(--gray-400);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-menu a:hover { color: #fff; background: var(--gray-800); }
.sidebar-menu a.active { color: #fff; background: var(--gray-800); border-left-color: var(--primary); }
.sidebar-menu svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-divider { border-top: 1px solid var(--gray-700); margin: 0.5rem 0; }

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-700);
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--gray-400);
}
.sidebar-footer a { color: var(--gray-400); text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }

/* ---- HAMBURGER ---- */
.hamburger {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 200;
  background: var(--gray-900);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---- CONTENT ---- */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  width: 100%;
}
.content-full { margin-left: 0; display: flex; justify-content: center; align-items: center; }

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---- ALERTS ---- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ---- CARDS ---- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header h3 { font-size: 1rem; font-weight: 600; }
.card-warning { border-left: 4px solid var(--danger); }

/* ---- STATS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-label { font-size: 0.8rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.25rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }

/* ---- TABLE ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.65rem 1rem; text-align: left; font-size: 0.875rem; }
.table thead th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--gray-200);
}
.table tbody tr { border-bottom: 1px solid var(--gray-100); }
.table tbody tr:hover { background: var(--gray-50); }
.table a { color: var(--primary); text-decoration: none; }
.table a:hover { text-decoration: underline; }
td.empty { text-align: center; color: var(--gray-400); padding: 2rem; }

/* ---- BADGES ---- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-gray { background: var(--gray-200); color: var(--gray-600); }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: #fff;
  color: var(--gray-700);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }
.btn-full { width: 100%; justify-content: center; }

/* ---- FORMS ---- */
.input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  background: #fff;
  color: var(--gray-800);
  transition: border-color 0.2s;
}
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,0.1); }
textarea.input { resize: vertical; }
select.input { cursor: pointer; }
.form-group { margin-bottom: 1rem; flex: 1; min-width: 150px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--gray-600); margin-bottom: 0.3rem; }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }

.filter-bar { margin-bottom: 1rem; }
.filter-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-form .input { max-width: 300px; }

/* ---- DETAIL ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.detail-list { display: flex; flex-direction: column; gap: 0.5rem; }
.detail-item { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid var(--gray-100); font-size: 0.9rem; }
.detail-label { color: var(--gray-500); }

code {
  background: var(--gray-100);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* ---- LOGIN ---- */
.login-page {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #1e3a5f 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 1rem;
}
.login-container {
  background: #fff;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 95%;
  max-width: 380px;
  animation: fadeInUp 0.5s ease-out;
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header .sidebar-logo { color: #fff; font-size: 1.8rem; background: linear-gradient(135deg, #3b82f6, #2563eb); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-header .sidebar-logo span { -webkit-text-fill-color: #059669; }
.login-header p { color: #94a3b8; margin-top: 0.25rem; font-size: 0.9rem; }
.login-form .form-group { margin-bottom: 1.25rem; }
.login-form .form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: #475569; margin-bottom: 0.4rem; }
.login-form .form-group input { width: 100%; height: 44px; padding: 0.5rem 1rem; font-size: 0.95rem; border: 2px solid #e2e8f0; border-radius: 10px; background: #f8fafc; transition: all 0.2s; outline: none; }
.login-form .form-group input:focus { border-color: #3b82f6; background: #fff; box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.login-form .btn { margin-top: 0.5rem; padding: 0.75rem; font-size: 1rem; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #2563eb); border: none; box-shadow: 0 4px 12px rgba(37,99,235,0.3); transition: all 0.2s; }
.login-form .btn:hover { background: linear-gradient(135deg, #2563eb, #1d4ed8); box-shadow: 0 6px 20px rgba(37,99,235,0.4); transform: translateY(-1px); }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ---- EXTRA BADGE STATUSES ---- */
[data-status="actief"] { background: #d1fae5; color: #065f46; }
[data-status="gestopt"] { background: #fee2e2; color: #991b1b; }
[data-status="onbekend"] { background: var(--gray-200); color: var(--gray-500); }

/* ---- SIDEBAR DIVIDER ---- */
.sidebar-divider { border-top: 1px solid var(--gray-700); margin: 0.5rem 0; }

/* ---- DARK MODE ---- */
[data-theme="dark"] {
  --gray-50: #1a1a2e;
  --gray-100: #16213e;
  --gray-200: #1f2937;
  --gray-300: #374151;
  --gray-400: #9ca3af;
  --gray-500: #d1d5db;
  --gray-600: #e5e7eb;
  --gray-700: #374151;
  --gray-800: #f3f4f6;
  --gray-900: #0f0f23;
  --primary-light: #064e3b;
}
[data-theme="dark"] body { background: #0f172a; color: #e2e8f0; }
[data-theme="dark"] .card { background: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
[data-theme="dark"] .card-header { border-color: #334155; }
[data-theme="dark"] .stat-card { background: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
[data-theme="dark"] .stat-value { color: #f1f5f9; }
[data-theme="dark"] .table thead th { background: #1e293b; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .table tbody tr { border-color: #1e293b; }
[data-theme="dark"] .table tbody tr:hover { background: #1e293b; }
[data-theme="dark"] .input { background: #1e293b; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,150,105,0.2); }
[data-theme="dark"] .btn { background: #1e293b; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .btn:hover { background: #334155; }
[data-theme="dark"] .btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
[data-theme="dark"] .btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
[data-theme="dark"] .alert-success { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
[data-theme="dark"] .alert-error { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
[data-theme="dark"] code { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .sidebar { background: #0f0f23; }
[data-theme="dark"] .sidebar-header { border-color: #1e293b; }
[data-theme="dark"] .sidebar-menu a:hover { background: #1e293b; }
[data-theme="dark"] .sidebar-menu a.active { background: #1e293b; }
[data-theme="dark"] .sidebar-footer { border-color: #1e293b; }
[data-theme="dark"] .sidebar-divider { border-color: #1e293b; }
[data-theme="dark"] .login-container { background: #1e293b; }
[data-theme="dark"] .page-header h2 { color: #f1f5f9; }
[data-theme="dark"] .detail-item { border-color: #1e293b; }

/* Auto dark mode voor systeem voorkeur */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --gray-50: #1a1a2e;
    --gray-100: #16213e;
    --gray-200: #1f2937;
    --gray-300: #374151;
    --gray-400: #9ca3af;
    --gray-500: #d1d5db;
    --gray-600: #e5e7eb;
    --gray-700: #374151;
    --gray-800: #f3f4f6;
    --gray-900: #0f0f23;
    --primary-light: #064e3b;
  }
  html:not([data-theme="light"]) body { background: #0f172a; color: #e2e8f0; }
  html:not([data-theme="light"]) .card { background: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
  html:not([data-theme="light"]) .card-header { border-color: #334155; }
  html:not([data-theme="light"]) .stat-card { background: #1e293b; }
  html:not([data-theme="light"]) .stat-value { color: #f1f5f9; }
  html:not([data-theme="light"]) .table thead th { background: #1e293b; color: #94a3b8; border-color: #334155; }
  html:not([data-theme="light"]) .table tbody tr { border-color: #1e293b; }
  html:not([data-theme="light"]) .table tbody tr:hover { background: #1e293b; }
  html:not([data-theme="light"]) .input { background: #1e293b; color: #e2e8f0; border-color: #334155; }
  html:not([data-theme="light"]) .btn { background: #1e293b; color: #e2e8f0; border-color: #334155; }
  html:not([data-theme="light"]) .btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
  html:not([data-theme="light"]) .btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
  html:not([data-theme="light"]) .alert-success { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
  html:not([data-theme="light"]) .alert-error { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
  html:not([data-theme="light"]) code { background: #334155; color: #e2e8f0; }
  html:not([data-theme="light"]) .sidebar { background: #0f0f23; }
  html:not([data-theme="light"]) .sidebar-header { border-color: #1e293b; }
  html:not([data-theme="light"]) .sidebar-menu a:hover { background: #1e293b; }
  html:not([data-theme="light"]) .sidebar-menu a.active { background: #1e293b; }
  html:not([data-theme="light"]) .sidebar-footer { border-color: #1e293b; }
  html:not([data-theme="light"]) .sidebar-divider { border-color: #1e293b; }
  html:not([data-theme="light"]) .login-container { background: #1e293b; }
  html:not([data-theme="light"]) .page-header h2 { color: #f1f5f9; }
  html:not([data-theme="light"]) .detail-item { border-color: #1e293b; }
}

/* Dark mode toggle knop */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--gray-700);
  color: var(--gray-400);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  font-size: 0.85rem;
  cursor: pointer;
  line-height: 1;
}
.theme-toggle:hover { color: #fff; border-color: var(--gray-500); }


/* Language switch */
.lang-switch { display: flex; gap: 2px; }
.lang-btn {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  transition: all 0.15s;
}
.lang-btn:hover { color: #fff; background: var(--gray-700); }
.lang-btn.lang-active { color: #fff; background: var(--primary); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .hamburger { display: block; }
  .content { margin-left: 0; padding: 1rem; padding-top: 4rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filter-form { flex-direction: column; }
  .filter-form .input { max-width: 100%; }
  .form-row { flex-direction: column; }
}

/* ============================================
   HostPanel - cPanel Style Feature Grid
   ============================================ */

/* ---- SERVER STATS BAR ---- */
.server-stats-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  flex-wrap: wrap;
}
.server-stat {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  min-width: 120px;
}
.server-stat-icon {
  font-size: 1.4rem;
  opacity: 0.7;
}
.server-stat small {
  display: block;
  font-size: 0.7rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.server-stat strong {
  font-size: 1rem;
  color: var(--gray-900);
}
.text-success { color: var(--success) !important; }

/* ---- cPANEL CATEGORY ---- */
.cpanel-category {
  margin-bottom: 1.5rem;
}
.cpanel-category-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--gray-500);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

/* ---- cPANEL GRID ---- */
.cpanel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

/* ---- cPANEL TILE ---- */
.cpanel-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 0.75rem;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.8rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.cpanel-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  border-color: var(--primary);
  color: var(--primary);
}
.cpanel-tile-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cpanel-tile-icon svg {
  width: 24px;
  height: 24px;
}

/* ---- DARK MODE for cPanel grid ---- */
[data-theme="dark"] .server-stats-bar { background: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
[data-theme="dark"] .server-stat strong { color: #f1f5f9; }
[data-theme="dark"] .cpanel-category-title { color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .cpanel-tile { background: #1e293b; color: #e2e8f0; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
[data-theme="dark"] .cpanel-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.4); border-color: var(--primary); color: var(--primary); }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .server-stats-bar { background: #1e293b; }
  html:not([data-theme="light"]) .server-stat strong { color: #f1f5f9; }
  html:not([data-theme="light"]) .cpanel-category-title { color: #94a3b8; border-color: #334155; }
  html:not([data-theme="light"]) .cpanel-tile { background: #1e293b; color: #e2e8f0; }
  html:not([data-theme="light"]) .cpanel-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.4); border-color: var(--primary); color: var(--primary); }
}

/* ---- RESPONSIVE cPanel grid ---- */
@media (max-width: 768px) {
  .cpanel-grid { grid-template-columns: repeat(3, 1fr); }
  .server-stats-bar { gap: 0.5rem; }
  .server-stat { min-width: 80px; }
}
@media (max-width: 480px) {
  .cpanel-grid { grid-template-columns: repeat(2, 1fr); }
}
