/* ==========================================================
   ZimaOS / CasaOS Premium Dark Theme + Auth System
   ========================================================== */

:root {
  --bg-dark: #0a0c10;
  --card-bg: rgba(20, 23, 32, 0.82);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-hover-bg: rgba(28, 32, 45, 0.9);
  --accent-cyan: #00f0ff;
  --accent-blue: #0284c7;
  --accent-green: #a3e635;
  --accent-gold: #f59e0b;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #8e99aa;
  --text-dim: #5c667a;
  --radius-widget: 18px;
  --radius-card: 20px;
  --radius-icon: 16px;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  user-select: none;
}

/* ---------------- Wallpaper & Ambient Glow ---------------- */
.wallpaper-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #11141c 0%, #07080b 100%);
}

.light-streak {
  position: absolute;
  filter: blur(45px);
  transform: rotate(-35deg);
  pointer-events: none;
  opacity: 0.22;
}

.streak-1 {
  width: 800px;
  height: 80px;
  top: -100px;
  left: 20%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), rgba(0, 240, 255, 0.2), transparent);
}

.streak-2 {
  width: 950px;
  height: 110px;
  top: 30%;
  left: 35%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), rgba(163, 230, 53, 0.15), transparent);
}

.streak-3 {
  width: 700px;
  height: 60px;
  bottom: 10%;
  left: 10%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
}

.matrix-grid {
  position: absolute;
  top: 0;
  width: 140px;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  opacity: 0.35;
}

.left-grid { left: 10px; }
.right-grid { right: 10px; }

/* ---------------- Dashboard Layout ---------------- */
.dashboard-container {
  position: relative;
  z-index: 10;
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 28px 40px 28px;
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.top-nav-spacer {
  flex: 1;
}

.top-center-pill {
  width: 44px;
  height: 44px;
  background: rgba(22, 26, 36, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.top-center-pill:hover {
  background: rgba(34, 40, 56, 0.9);
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 240, 255, 0.2);
}

.pill-icon {
  width: 20px;
  height: 20px;
}

/* User Profile Menu (Top Right) */
.user-profile-menu {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  position: relative;
}

.user-pill {
  background: rgba(22, 26, 36, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 5px 14px 5px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.user-pill:hover {
  background: rgba(32, 38, 52, 0.9);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #00f0ff);
  color: #0b0f19;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  margin-left: -4px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
}

.user-chevron {
  font-size: 11px;
  color: var(--text-dim);
}

.user-dropdown-card {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: rgba(22, 26, 36, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  padding: 12px;
  display: none;
  flex-direction: column;
  z-index: 50;
  animation: slideDown 0.2s ease;
}

.user-dropdown-card.active {
  display: flex;
}

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

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 10px 4px;
}

.dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #00f0ff);
  color: #0b0f19;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dropdown-username {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.dropdown-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.dropdown-item {
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  font-family: inherit;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.dropdown-item.logout {
  color: #f87171;
}

.dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Main Split Layout: Left Widgets (300px) + Right Apps */
.main-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 28px;
  align-items: start;
}

/* ---------------- Left Sidebar Widgets ---------------- */
.sidebar-widgets {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.widget {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-widget);
  padding: 16px 18px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s ease;
}

.widget:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Clock Widget */
.clock-widget {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 4px 6px 8px 6px;
}

.clock-time {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1;
  color: #ffffff;
}

.clock-date {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Widget Header */
.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.widget-title {
  font-size: 14px;
  font-weight: 600;
  color: #cbd5e1;
}

.widget-chevron, .widget-gear, .widget-iface {
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s;
}

.widget-gear:hover, .widget-chevron:hover, .widget-iface:hover {
  color: var(--text-main);
}

/* Gauges (CPU & RAM) */
.gauges-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gauge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.circular-gauge {
  position: relative;
  width: 90px;
  height: 90px;
}

.circular-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  stroke: #1e2432;
  stroke-width: 8;
  fill: transparent;
}

.gauge-fill {
  stroke-width: 8;
  fill: transparent;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease, stroke 0.3s ease;
}

.gauge-cpu {
  stroke: var(--accent-cyan);
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.4));
}

.gauge-ram {
  stroke: var(--accent-green);
  filter: drop-shadow(0 0 4px rgba(163, 230, 53, 0.4));
}

.gauge-label-group {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-value {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.gauge-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.5px;
}

.gauge-subtext {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  white-space: nowrap;
}

/* Storage Widget */
.storage-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.storage-drive-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.storage-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 6px;
  align-self: flex-start;
  margin-bottom: 2px;
}

.status-pill.healthy {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.storage-info {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.storage-progress-bar {
  width: 100%;
  height: 6px;
  background: #1c2230;
  border-radius: 4px;
  margin-top: 12px;
  overflow: hidden;
}

.storage-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 4px;
  transition: width 0.8s ease;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* Network Widget */
.network-chart-container {
  position: relative;
  width: 100%;
  height: 85px;
  background: rgba(11, 14, 20, 0.6);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

#networkChart {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-y-axis {
  position: absolute;
  top: 4px;
  left: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100% - 8px);
  pointer-events: none;
}

.chart-y-axis span {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: #475569;
}

.network-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
}

.net-unit {
  color: var(--text-dim);
  font-weight: 600;
}

.net-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.net-up {
  color: #38bdf8;
}

.net-down {
  color: #34d399;
}

.net-status-check {
  font-size: 11px;
  color: #64748b;
  border: 1px solid #334155;
  border-radius: 3px;
  width: 15px;
  height: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Widget Settings Button */
.widget-settings-btn {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-widget);
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.widget-settings-btn:hover {
  background: var(--card-hover-bg);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

/* ---------------- Right Main Area ---------------- */
.main-content {
  display: flex;
  flex-direction: column;
}

/* Search Bar */
.search-container {
  margin-bottom: 24px;
}

.search-box {
  width: 100%;
  background: rgba(22, 26, 36, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.search-box:focus-within {
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.15);
  background: rgba(28, 33, 46, 0.9);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 14px;
  width: 100%;
  font-family: inherit;
}

.search-box input::placeholder {
  color: var(--text-dim);
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}

.search-clear-btn:hover {
  color: #ffffff;
}

/* Apps Header */
.apps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding: 0 4px;
}

.apps-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.add-app-btn {
  width: 32px;
  height: 32px;
  background: rgba(26, 30, 42, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-app-btn:hover {
  background: rgba(38, 44, 62, 0.9);
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.3);
  transform: scale(1.05);
}

.add-app-btn svg {
  width: 16px;
  height: 16px;
}

/* Apps Grid */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 18px;
}

/* App Card (ZimaOS Squircle Style) */
.app-card {
  aspect-ratio: 1;
  background: rgba(22, 26, 36, 0.7);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  padding: 12px;
}

.app-card:hover {
  background: var(--card-hover-bg);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-5px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.12);
}

.app-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.app-card:hover .app-icon-wrapper {
  transform: scale(1.06);
}

.app-icon-wrapper svg {
  width: 100%;
  height: 100%;
}

.app-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  text-align: center;
  max-width: 95%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.app-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.app-delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
}

.app-card:hover .app-delete-btn {
  display: flex;
}

.app-delete-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

/* ---------------- Auth Overlay (Login / Register) ---------------- */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(6, 8, 12, 0.88);
  backdrop-filter: blur(28px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-overlay.active {
  display: flex;
  opacity: 1;
}

.auth-card {
  width: 90%;
  max-width: 420px;
  background: rgba(18, 22, 32, 0.94);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 240, 255, 0.08);
  padding: 32px 28px;
  transform: translateY(15px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-overlay.active .auth-card {
  transform: translateY(0);
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
  text-align: center;
}

.auth-logo-glow {
  width: 52px;
  height: 52px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.45));
}

.auth-logo-glow svg {
  width: 100%;
  height: 100%;
}

.auth-title {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.4px;
}

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

/* Tabs */
.auth-tabs {
  display: flex;
  background: rgba(12, 14, 22, 0.8);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.auth-tab {
  flex: 1;
  padding: 9px 0;
  background: transparent;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.auth-tab:hover {
  color: #ffffff;
}

.auth-tab.active {
  background: rgba(30, 36, 50, 0.95);
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Alerts */
.auth-alert {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-alert.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* Forms */
.auth-form {
  display: flex;
  flex-direction: column;
}

.input-password-wrap {
  position: relative;
  width: 100%;
}

.input-password-wrap input {
  padding-right: 40px !important;
}

.btn-toggle-pwd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
}

.btn-toggle-pwd:hover {
  color: #ffffff;
}

.auth-extra-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.remember-label input {
  accent-color: var(--accent-cyan);
}

.auth-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent-cyan);
  opacity: 0.85;
}

.auth-submit-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #0284c7, #00f0ff);
  border: none;
  border-radius: 12px;
  color: #080d1a;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.3);
  font-family: inherit;
}

.auth-submit-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(0, 240, 255, 0.45);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------------- Other Modals ---------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 10, 0.75);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-card {
  width: 90%;
  max-width: 480px;
  background: rgba(22, 26, 36, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  padding: 24px;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: #ffffff;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(14, 17, 24, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--accent-cyan);
}

.icon-selector-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.icon-choice {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(14, 17, 24, 0.8);
  font-size: 20px;
  transition: all 0.15s ease;
}

.icon-choice.selected {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.btn-secondary {
  padding: 10px 18px;
  background: rgba(30, 35, 48, 0.8);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-secondary:hover {
  background: rgba(40, 46, 64, 0.9);
  color: #ffffff;
}

.btn-primary {
  padding: 10px 20px;
  background: linear-gradient(135deg, #0284c7, #00f0ff);
  border: none;
  border-radius: 10px;
  color: #0b0f19;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.3);
  font-family: inherit;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Terminal Modal */
.terminal-card {
  max-width: 650px;
  background: rgba(12, 14, 20, 0.98);
  border: 1px solid #1e2433;
}

.term-traffic-lights {
  display: flex;
  gap: 6px;
}

.term-traffic-lights .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.term-traffic-lights .red { background: #ef4444; }
.term-traffic-lights .yellow { background: #f59e0b; }
.term-traffic-lights .green { background: #10b981; }

.terminal-body {
  background: #07080c;
  border-radius: 10px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #94a3b8;
  max-height: 380px;
  overflow-y: auto;
}

.term-line {
  color: #e2e8f0;
  margin-top: 6px;
}

.term-line .prompt {
  color: #00f0ff;
  font-weight: 600;
  margin-right: 8px;
}

.term-text {
  color: #38bdf8;
  padding-left: 4px;
}

.cursor {
  animation: blink 1s infinite;
  color: #00f0ff;
}

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

/* ---------------- Responsive ---------------- */
@media (max-width: 980px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar-widgets {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .clock-widget {
    grid-column: span 2;
  }

  .widget-settings-btn {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .dashboard-container {
    padding: 12px 16px;
  }

  .sidebar-widgets {
    grid-template-columns: 1fr;
  }

  .clock-widget, .widget-settings-btn {
    grid-column: span 1;
  }

  .apps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .app-card {
    border-radius: 16px;
    padding: 10px;
  }

  .app-icon-wrapper {
    width: 48px;
    height: 48px;
  }

  .app-name {
    font-size: 11.5px;
  }
}
