/* ============================================================
   iNTERNAU Panel — Design System
   Industrial-Tech Aesthetic | Dark/Light Theme
   Font: Rajdhani (headings) + IBM Plex Mono (data) + Outfit (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500&family=Outfit:wght@300;400;500;600&display=swap');

/* ============================================================
   CSS VARIABLES — DARK THEME (default)
   ============================================================ */
:root,
[data-theme="dark"] {
  --bg-base:        #0a0c10;
  --bg-surface:     #0f1117;
  --bg-card:        #141720;
  --bg-elevated:    #1a1e2b;
  --bg-hover:       #1f2436;
  --bg-active:      #242a3a;

  --border:         #1e2435;
  --border-muted:   #161b28;
  --border-bright:  #2a3349;

  --text-primary:   #e8ecf5;
  --text-secondary: #7a8399;
  --text-muted:     #4a5268;
  --text-inverse:   #0a0c10;

  --accent:         #00d4ff;
  --accent-dim:     rgba(0, 212, 255, 0.12);
  --accent-glow:    rgba(0, 212, 255, 0.25);
  --accent-hover:   #33ddff;
  --accent-dark:    #0099bb;

  --success:        #00e599;
  --success-dim:    rgba(0, 229, 153, 0.12);
  --warning:        #ffb800;
  --warning-dim:    rgba(255, 184, 0, 0.12);
  --danger:         #ff3d5a;
  --danger-dim:     rgba(255, 61, 90, 0.12);
  --info:           #7c6af5;
  --info-dim:       rgba(124, 106, 245, 0.12);

  --sidebar-width:  260px;
  --topbar-height:  60px;

  --shadow-sm:      0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.6);
  --shadow-accent:  0 0 20px rgba(0, 212, 255, 0.2);

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;

  --font-ui:    'Outfit', sans-serif;
  --font-head:  'Rajdhani', sans-serif;
  --font-mono:  'IBM Plex Mono', monospace;

  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   LIGHT THEME
   ============================================================ */
[data-theme="light"] {
  --bg-base:        #f0f2f8;
  --bg-surface:     #f7f8fc;
  --bg-card:        #ffffff;
  --bg-elevated:    #ffffff;
  --bg-hover:       #f0f4ff;
  --bg-active:      #e8edff;

  --border:         #dde1ef;
  --border-muted:   #eaecf5;
  --border-bright:  #c5ccdf;

  --text-primary:   #111827;
  --text-secondary: #4b5773;
  --text-muted:     #9ca3c0;
  --text-inverse:   #ffffff;

  --accent:         #0088cc;
  --accent-dim:     rgba(0, 136, 204, 0.10);
  --accent-glow:    rgba(0, 136, 204, 0.20);
  --accent-hover:   #006fa8;
  --accent-dark:    #005580;

  --success:        #00a86b;
  --success-dim:    rgba(0, 168, 107, 0.10);
  --warning:        #d97706;
  --warning-dim:    rgba(217, 119, 6, 0.10);
  --danger:         #dc2626;
  --danger-dim:     rgba(220, 38, 38, 0.10);
  --info:           #5b4fe0;
  --info-dim:       rgba(91, 79, 224, 0.10);

  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:      0 8px 32px rgba(0,0,0,0.12);
  --shadow-accent:  0 0 20px rgba(0, 136, 204, 0.15);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-primary);
}

.font-mono { font-family: var(--font-mono); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }

/* ============================================================
   LAYOUT — PANEL SHELL
   ============================================================ */
.panel-shell {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition), background var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Sidebar Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-brand-logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--info));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  color: var(--bg-base);
  letter-spacing: 0.05em;
  flex-shrink: 0;
  box-shadow: var(--shadow-accent);
}

.sidebar-brand-name {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-brand-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  list-style: none;
}

.sidebar-section-label {
  padding: 16px 20px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-nav-item a,
.sidebar-nav-item button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all var(--transition);
  position: relative;
}

.sidebar-nav-item a:hover,
.sidebar-nav-item button:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-left-color: var(--border-bright);
}

.sidebar-nav-item.active a,
.sidebar-nav-item.active button {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.sidebar-nav-item a i,
.sidebar-nav-item button i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

/* Badge in sidebar */
.sidebar-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition);
}

.sidebar-user:hover { background: var(--bg-hover); }

.sidebar-user-avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--info), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.sidebar-user-role {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 90;
  transition: background var(--transition);
}

.topbar-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  flex: 1;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.topbar-breadcrumb a { color: var(--text-secondary); text-decoration: none; transition: color var(--transition); }
.topbar-breadcrumb a:hover { color: var(--accent); }
.topbar-breadcrumb .sep { color: var(--text-muted); }
.topbar-breadcrumb .current { color: var(--text-primary); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Theme Toggle */
.theme-toggle {
  width: 36px; height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 15px;
  transition: all var(--transition);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Notification Bell */
.topbar-notif {
  width: 36px; height: 36px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 15px;
  text-decoration: none;
  position: relative;
  transition: all var(--transition);
}

.topbar-notif:hover {
  border-color: var(--border-bright);
  color: var(--text-primary);
}

.topbar-notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 28px;
  min-height: calc(100vh - var(--topbar-height));
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), border-color var(--transition);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  color: var(--accent);
  font-size: 16px;
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-card.accent::before  { background: var(--accent); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before  { background: var(--danger); }
.stat-card.info::before    { background: var(--info); }

.stat-card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stat-card-icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  margin-bottom: 14px;
}

.stat-card.accent .stat-card-icon  { background: var(--accent-dim); color: var(--accent); }
.stat-card.success .stat-card-icon { background: var(--success-dim); color: var(--success); }
.stat-card.warning .stat-card-icon { background: var(--warning-dim); color: var(--warning); }
.stat-card.danger .stat-card-icon  { background: var(--danger-dim); color: var(--danger); }
.stat-card.info .stat-card-icon    { background: var(--info-dim); color: var(--info); }

.stat-card-value {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.stat-card-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.stat-card-trend {
  font-family: var(--font-mono);
  font-size: 11px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.data-table thead tr {
  border-bottom: 1px solid var(--border);
}

.data-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-muted);
  transition: background var(--transition);
}

.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody tr:hover {
  background: var(--bg-hover);
}

.data-table tbody td {
  padding: 12px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* ============================================================
   BADGES / PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-active   { background: var(--success-dim); color: var(--success); }
.badge-pending  { background: var(--warning-dim); color: var(--warning); }
.badge-danger   { background: var(--danger-dim);  color: var(--danger);  }
.badge-info     { background: var(--info-dim);    color: var(--info);    }
.badge-default  { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-accent   { background: var(--accent-dim);  color: var(--accent); }

.badge-dot::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1.4;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--bg-base);
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-bright);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-success {
  background: var(--success-dim);
  color: var(--success);
  border-color: var(--success);
}
.btn-success:hover:not(:disabled) {
  background: var(--success);
  color: var(--bg-base);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }
.btn-icon.btn-sm { padding: 5px; width: 28px; height: 28px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  padding: 9px 13px;
  transition: all var(--transition);
  outline: none;
  appearance: none;
}

.form-control::placeholder { color: var(--text-muted); }

.form-control:focus {
  border-color: var(--accent);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-control:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a8399' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
  cursor: pointer;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.form-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-group { margin-bottom: 18px; }

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control {
  border-radius: 0;
  flex: 1;
}

.input-group-text {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 9px 12px;
  color: var(--text-secondary);
  font-size: 13px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.input-group :first-child,
.input-group :first-child .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group :last-child,
.input-group :last-child .form-control  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ============================================================
   ALERTS / FLASH MESSAGES
   ============================================================ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert i { flex-shrink: 0; margin-top: 1px; font-size: 16px; }

.alert-success { background: var(--success-dim); color: var(--success); border-color: rgba(0,229,153,0.25); }
.alert-warning { background: var(--warning-dim); color: var(--warning); border-color: rgba(255,184,0,0.25); }
.alert-danger  { background: var(--danger-dim);  color: var(--danger);  border-color: rgba(255,61,90,0.25); }
.alert-info    { background: var(--info-dim);    color: var(--info);    border-color: rgba(124,106,245,0.25); }
.alert-accent  { background: var(--accent-dim);  color: var(--accent);  border-color: rgba(0,212,255,0.25); }

/* ============================================================
   PROGRESS BARS
   ============================================================ */
.progress {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.6s ease;
}

/* ============================================================
   DROPDOWNS
   ============================================================ */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  display: none;
  animation: dropdownFadeIn 0.12s ease;
}

.dropdown-menu.show { display: block; }

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  font-size: 13.5px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--transition);
}

.dropdown-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-dim); }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  display: none;
  animation: backdropFadeIn 0.15s ease;
}

.modal-backdrop.show { display: flex; }

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 560px;
  width: 100%;
  animation: modalSlideIn 0.15s ease;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.96) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px;
  padding: 4px; border-radius: 4px;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.modal-body    { padding: 20px; }
.modal-footer  { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
   CODE / MONO DISPLAYS
   ============================================================ */
.code-block {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent);
  overflow-x: auto;
}

.inline-code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-title {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-header-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

/* Hintergrund-Grid für Auth-Seiten */
.auth-shell::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  pointer-events: none;
}

.auth-shell::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(0, 212, 255, 0.06);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--accent), var(--info));
  border-radius: var(--radius-md);
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--bg-base);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  box-shadow: var(--shadow-accent);
}

.auth-logo-name {
  display: block;
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.auth-tagline {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-title {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 20px;
  letter-spacing: 0.03em;
}

/* ============================================================
   SERVICE CARDS (Kundenbereich)
   ============================================================ */
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity var(--transition);
}

.service-card.active-service::after { background: var(--success); opacity: 1; }
.service-card.pending-service::after { background: var(--warning); opacity: 1; }
.service-card.suspended-service::after { background: var(--danger); opacity: 1; }

.service-card:hover {
  border-color: var(--border-bright);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.service-card-icon {
  width: 40px; height: 40px;
  background: var(--accent-dim);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 12px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.page-link {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
}

.page-link:hover { border-color: var(--border-bright); color: var(--text-primary); }
.page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: var(--bg-base); }
.page-item.disabled .page-link { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 42px;
  margin-bottom: 14px;
  opacity: 0.4;
  display: block;
}

.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state-text  { font-size: 13px; }

/* ============================================================
   TOOLTIPS
   ============================================================ */
[data-tooltip] {
  position: relative;
  cursor: default;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 300;
  box-shadow: var(--shadow-md);
}

[data-tooltip]:hover::after { opacity: 1; }

/* ============================================================
   DIVIDERS
   ============================================================ */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ============================================================
   GRID UTILS
   ============================================================ */
.row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.col { flex: 1; padding: 0 12px; }
.col-auto { flex: 0 0 auto; padding: 0 12px; }

/* ============================================================
   UTILITIES
   ============================================================ */
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-none    { display: none; }
.d-block   { display: block; }
.align-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: 6px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 18px; }
.gap-4 { gap: 24px; }
.w-100 { width: 100%; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; }
.ms-auto { margin-left: auto; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.small { font-size: 12px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 300;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .topbar {
    left: 0;
  }

  .main-content {
    margin-left: 0;
    padding: 16px;
  }

  .auth-card { padding: 28px 20px; }

  .page-header { flex-direction: column; }
  .stat-card-value { font-size: 22px; }
}

@media (max-width: 480px) {
  .modal { max-width: 95vw; }
  :root { --sidebar-width: 100vw; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-fade-in { animation: fadeIn 0.25s ease both; }
.animate-pulse   { animation: pulse 2s ease-in-out infinite; }
.spinner         { animation: spin 0.8s linear infinite; display: inline-block; }

/* Stagger für Listen */
.stagger > *:nth-child(1)  { animation-delay: 0.00s; }
.stagger > *:nth-child(2)  { animation-delay: 0.04s; }
.stagger > *:nth-child(3)  { animation-delay: 0.08s; }
.stagger > *:nth-child(4)  { animation-delay: 0.12s; }
.stagger > *:nth-child(5)  { animation-delay: 0.16s; }
.stagger > *:nth-child(6)  { animation-delay: 0.20s; }
.stagger > *:nth-child(7)  { animation-delay: 0.24s; }
.stagger > *:nth-child(8)  { animation-delay: 0.28s; }

/* ============================================================
   LOADING STATES
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
