/* Wawan Command Center – style.css */
:root {
  --cc-bg:        #0b1020;
  --cc-surface:   #111827;
  --cc-surface-2: #182238;
  --cc-line:      rgba(20,87,217,.25);
  --cc-ink:       #f0f4ff;
  --cc-muted:     #8a9bbf;
  --cc-blue:      #1457d9;
  --cc-blue-dark: #0a2f7a;
  --cc-red:       #e02b3f;
  --cc-green:     #19714f;
  --cc-yellow:    #d97706;
  --radius-card:  20px;
  --radius-pill:  999px;
  --radius-input: 14px;
  --sidebar-w:    220px;
  --transition:   0.18s ease;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--cc-bg);
  color: var(--cc-ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul, ol { list-style: none; }

.hidden { display: none !important; }
.muted  { color: var(--cc-muted); font-size: 0.85em; }

/* --- Login --- */
.login-overlay {
  position: fixed; inset: 0;
  background: var(--cc-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.login-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  padding: 2.5rem 2rem;
  width: 100%; max-width: 380px;
}
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; margin-bottom: 2rem; }
.logo-wcc {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  background: var(--cc-blue); color: #fff;
  font-weight: 700; font-size: 1rem; letter-spacing: 0.05em;
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(20,87,217,.2);
}
.login-title { font-size: 1.1rem; font-weight: 600; color: var(--cc-ink); }
.login-error { color: var(--cc-red); font-size: 0.85rem; margin-top: 0.75rem; text-align: center; }

/* --- App Shell --- */
.app { display: flex; height: 100vh; overflow: hidden; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--cc-surface);
  border-right: 1px solid var(--cc-line);
  display: flex; flex-direction: column;
  height: 100vh; position: sticky; top: 0;
  overflow-y: hidden; z-index: 100;
  transition: transform var(--transition);
}
.sidebar-header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--cc-line);
}
.sidebar-brand { font-weight: 600; font-size: 0.875rem; color: var(--cc-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-nav { flex: 1; padding: 0.75rem 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.625rem 1rem; margin: 0 0.5rem;
  border-radius: 10px;
  color: var(--cc-muted); font-size: 0.875rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer; user-select: none;
}
.nav-item:hover { background: var(--cc-surface-2); color: var(--cc-ink); }
.nav-item.active { background: rgba(20,87,217,.18); color: #6ea3ff; }

/* Nav group collapsible */
.nav-group { display: flex; flex-direction: column; }
.nav-group-header { cursor: pointer; justify-content: space-between; display: flex; align-items: center; }
.nav-group-header .nav-group-arrow { width: 14px; height: 14px; min-width: 14px; margin-left: auto; transition: transform 0.2s ease; opacity: 0.6; }
.nav-group-header[aria-expanded="true"] .nav-group-arrow { transform: rotate(180deg); }
.nav-submenu { display: none; flex-direction: column; overflow: hidden; }
.nav-submenu.open { display: flex; }
.nav-subitem { padding-left: 2.2rem !important; font-size: 0.85rem; opacity: 0.9; }
.nav-subitem.active { background: rgba(20,87,217,.18); color: #6ea3ff; opacity: 1; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-footer { padding: 1rem; border-top: 1px solid var(--cc-line); margin-top: auto; }

.sidebar-toggle {
  display: none; position: fixed; top: 1rem; left: 1rem;
  z-index: 200; background: var(--cc-surface);
  border: 1px solid var(--cc-line); border-radius: 10px;
  padding: 0.5rem; color: var(--cc-ink);
  transition: background var(--transition);
}
.sidebar-toggle:hover { background: var(--cc-surface-2); }

/* --- Main --- */
.main-content { flex: 1; overflow-y: auto; padding: 2rem; background: var(--cc-bg); }

.page { display: block; }
.page.hidden { display: none !important; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem; margin-bottom: 1.75rem;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--cc-ink); line-height: 1.3; }
.page-subtitle { color: var(--cc-muted); font-size: 0.875rem; margin-top: 0.25rem; }
.page-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* --- Cards --- */
.card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 50px rgba(0,0,0,.4);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--cc-line);
}
.card-title { font-size: 0.9rem; font-weight: 600; color: var(--cc-ink); }
.card-body { padding: 1.25rem; }
.panel {
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  padding: 1rem 1.25rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.5rem 1.125rem; border-radius: var(--radius-pill);
  font-size: 0.875rem; font-weight: 500;
  border: 1px solid transparent;
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap; line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--cc-blue); color: #fff; border-color: var(--cc-blue); }
.btn-primary:hover:not(:disabled) { background: #1a67f5; box-shadow: 0 0 20px rgba(20,87,217,.4); }
.btn-danger { background: var(--cc-red); color: #fff; border-color: var(--cc-red); }
.btn-danger:hover:not(:disabled) { background: #f03248; }
.btn-ghost { background: transparent; color: var(--cc-muted); border-color: var(--cc-line); }
.btn-ghost:hover:not(:disabled) { background: var(--cc-surface-2); color: var(--cc-ink); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; padding: 0.75rem 1.25rem; }

/* --- Inputs --- */
.input,
input[type="text"], input[type="password"], input[type="email"],
select, textarea {
  width: 100%;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-line);
  border-radius: var(--radius-input);
  color: var(--cc-ink);
  padding: 0.6rem 0.875rem;
  font-family: inherit; font-size: 0.875rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none; appearance: none;
}
.input:focus,
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
select:focus, textarea:focus {
  border-color: var(--cc-blue);
  box-shadow: 0 0 0 3px rgba(20,87,217,.2);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a9bbf' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  padding-right: 2.25rem;
}
textarea { resize: vertical; min-height: 80px; }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { font-size: 0.8rem; font-weight: 500; color: var(--cc-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* --- Stats --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
  padding: 1.25rem 1.5rem;
}
.stat-label { font-size: 0.75rem; font-weight: 500; color: var(--cc-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--cc-ink); line-height: 1.2; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }

/* --- Profile Grid --- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.profile-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 50px rgba(0,0,0,.4);
  padding: 1.25rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.profile-card:hover { border-color: rgba(20,87,217,.5); box-shadow: 0 16px 50px rgba(20,87,217,.1); }
.profile-name { font-size: 0.95rem; font-weight: 600; color: var(--cc-ink); word-break: break-all; }
.profile-meta { display: flex; flex-direction: column; gap: 0.3rem; }
.profile-meta-row { display: flex; justify-content: space-between; font-size: 0.8rem; }
.profile-meta-key { color: var(--cc-muted); }
.profile-meta-val { color: var(--cc-ink); font-weight: 500; word-break: break-all; text-align: right; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: auto; padding-top: 0.75rem; border-top: 1px solid var(--cc-line); }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.15rem 0.55rem; border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; white-space: nowrap;
}
.badge-blue   { background: rgba(20,87,217,.2);  color: #6ea3ff; border: 1px solid rgba(20,87,217,.35); }
.badge-green  { background: rgba(25,113,79,.2);  color: #4cae87; border: 1px solid rgba(25,113,79,.35); }
.badge-red    { background: rgba(224,43,63,.15); color: #f07585; border: 1px solid rgba(224,43,63,.35); }
.badge-muted  { background: rgba(138,155,191,.1); color: var(--cc-muted); border: 1px solid var(--cc-line); }
.badge-gray   { background: rgba(138,155,191,.1); color: #8a9bbf;        border: 1px solid rgba(138,155,191,.3); }

/* --- Model Grid --- */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.model-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 16px; padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: border-color var(--transition);
}
.model-card:hover { border-color: rgba(20,87,217,.45); }
.model-id { font-size: 0.875rem; font-weight: 600; color: var(--cc-ink); word-break: break-all; }
.model-owned { font-size: 0.78rem; color: var(--cc-muted); }

/* --- Tabs --- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--cc-line); margin-bottom: 1.25rem; }
.tab {
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  color: var(--cc-muted); font-size: 0.875rem; font-weight: 500;
  padding: 0.625rem 1rem; margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  cursor: pointer;
}
.tab.active { color: #6ea3ff; border-bottom-color: var(--cc-blue); }
.tab:hover:not(.active) { color: var(--cc-ink); }
.tab-panel { display: block; }
.tab-panel.hidden { display: none !important; }

/* --- Server Monitor --- */
.server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }
.metric-block { padding: 1rem 1.25rem; font-size: 1.05rem; font-weight: 600; color: var(--cc-ink); }
.metric-label { font-size: 0.75rem; color: var(--cc-muted); font-weight: 400; margin-top: 0.2rem; }
.pm2-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.pm2-table th { text-align: left; padding: 0.5rem 1rem; color: var(--cc-muted); font-weight: 500; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--cc-line); }
.pm2-table td { padding: 0.5rem 1rem; border-bottom: 1px solid rgba(20,87,217,.1); color: var(--cc-ink); }
.pm2-table tr:last-child td { border-bottom: none; }
.pm2-table tr:hover td { background: var(--cc-surface-2); }

/* --- BekalAkhirat --- */
.bekal-row { display: flex; justify-content: space-between; align-items: center; padding: 0.75rem 1.25rem; background: var(--cc-surface-2); border-radius: 12px; border: 1px solid var(--cc-line); margin-bottom: 0.5rem; }
.bekal-key { font-size: 0.875rem; color: var(--cc-muted); }
.bekal-val { font-size: 0.875rem; font-weight: 600; color: var(--cc-ink); }

/* --- Custom Providers --- */
.custom-provider-item { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; background: var(--cc-surface); border: 1px solid var(--cc-line); border-radius: 14px; margin-bottom: 0.75rem; }
.custom-provider-name { font-weight: 600; font-size: 0.9rem; color: var(--cc-ink); }
.custom-provider-slug { font-size: 0.78rem; color: var(--cc-muted); }
.custom-provider-info { display: flex; flex-direction: column; gap: 0.2rem; }

/* --- Section divider --- */
.section-title { font-size: 0.75rem; font-weight: 600; color: var(--cc-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 1rem; }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500; padding: 1rem;
}
.modal {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--cc-line); }
.modal-title { font-size: 1rem; font-weight: 600; color: var(--cc-ink); }
.modal-close { background: transparent; border: none; color: var(--cc-muted); font-size: 1.4rem; line-height: 1; padding: 0.2rem; transition: color var(--transition); }
.modal-close:hover { color: var(--cc-ink); }
.modal-body { padding: 1.5rem; flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; padding: 1rem 1.5rem; border-top: 1px solid var(--cc-line); }

/* --- Toast --- */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 1000; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast { padding: 0.75rem 1.125rem; border-radius: 12px; font-size: 0.875rem; font-weight: 500; color: #fff; box-shadow: 0 8px 30px rgba(0,0,0,.5); opacity: 0; transform: translateY(16px); animation: toastIn 0.25s ease forwards; pointer-events: auto; max-width: 320px; }
.toast.toast-out { animation: toastOut 0.25s ease forwards; }
.toast-info    { background: var(--cc-blue-dark); border: 1px solid var(--cc-blue); }
.toast-success { background: #0e4d35; border: 1px solid var(--cc-green); }
.toast-error   { background: #5c1220; border: 1px solid var(--cc-red); }
.toast-warning { background: #5c3910; border: 1px solid var(--cc-yellow); }
@keyframes toastIn  { to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(8px); } }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--cc-muted); font-size: 0.875rem; }

/* --- Spinner --- */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--cc-line); border-top-color: var(--cc-blue); border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- BekalAkhirat Enhanced --- */
.arabic-text {
  direction: rtl; text-align: right;
  font-family: 'Amiri', serif;
  font-size: 1.2rem; line-height: 2;
  color: var(--cc-ink);
}
.latin-text { font-style: italic; color: var(--cc-muted); }
.step-item {
  border-left: 3px solid var(--cc-blue);
  padding-left: 1rem;
  margin-bottom: 0.75rem;
}
.expandable-card { cursor: pointer; }
.expandable-card .chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.75rem;
  color: var(--cc-muted);
}
.expandable-card.expanded .chevron { transform: rotate(180deg); }
.steps-panel { display: none; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--cc-line); }
.expandable-card.expanded .steps-panel { display: block; }
.badge-orange { background: rgba(251,146,60,0.15); color: rgb(251,146,60); border: 1px solid rgba(251,146,60,0.35); }
.badge-yellow { background: rgba(234,179,8,0.15);  color: rgb(234,179,8);  border: 1px solid rgba(234,179,8,0.35); }
.filter-tabs-inner {
  display: flex; gap: 0.2rem;
  margin-bottom: 1rem;
}
.filter-tabs-inner .tab-inner {
  background: transparent;
  border: 1px solid var(--cc-line);
  border-radius: var(--radius-pill);
  color: var(--cc-muted);
  font-size: 0.78rem; font-weight: 500;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.filter-tabs-inner .tab-inner.active {
  background: rgba(20,87,217,.2);
  color: #6ea3ff;
  border-color: rgba(20,87,217,.4);
}
.filter-tabs-inner .tab-inner:hover:not(.active) { background: var(--cc-surface-2); color: var(--cc-ink); }
.bekal-content-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color var(--transition);
}
.bekal-content-card:hover { border-color: rgba(20,87,217,.45); }
.bekal-card-title { font-size: 0.95rem; font-weight: 600; color: var(--cc-ink); margin-bottom: 0.35rem; }
.bekal-card-body { font-size: 0.82rem; color: var(--cc-muted); margin-bottom: 0.6rem; line-height: 1.6; }
.bekal-card-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.bekal-card-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; padding-top: 0.75rem; border-top: 1px solid var(--cc-line); }
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.device-card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 16px; padding: 1.1rem 1.25rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: border-color var(--transition);
}
.device-card:hover { border-color: rgba(20,87,217,.45); }
.device-name { font-size: 0.9rem; font-weight: 600; color: var(--cc-ink); text-transform: capitalize; }
.push-log-item {
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.6rem;
}
.push-log-title { font-size: 0.875rem; font-weight: 600; color: var(--cc-ink); margin-bottom: 0.4rem; }
.push-log-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-size: 0.78rem; color: var(--cc-muted); }
.push-log-errors { margin-top: 0.5rem; font-size: 0.78rem; color: rgb(251,146,60); }

/* --- Responsive --- */
@media (max-width: 600px) {
  .sidebar { position: fixed; top: 0; left: 0; height: 100vh; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 40px rgba(0,0,0,.6); }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .main-content { padding: 1rem; padding-top: 4rem; }
  .profile-grid, .model-grid { grid-template-columns: 1fr; }
  .stats-grid, .server-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* ── BekalAkhirat cards ───────────────────────────────── */
.bk-card {
  background: var(--bg-card, var(--cc-surface));
  border: 1px solid var(--border, var(--cc-line));
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  transition: border-color 0.15s;
}
.bk-card:hover { border-color: var(--accent, #3b82f6); }

/* ── Cron Jobs ─────────────────────────────────────────────────── */
:root {
  --red:        var(--cc-red, #e02b3f);
  --border:     var(--cc-line, rgba(20,87,217,.25));
  --text-muted: var(--cc-muted, #8a9bbf);
  --bg-code:    rgba(255,255,255,0.06);
}
.badge-ok   { background: rgba(25,113,79,.2);   color: #4cae87; border: 1px solid rgba(25,113,79,.35);   font-size:11px; padding:2px 8px; border-radius:999px; white-space:nowrap; }
.badge-warn { background: rgba(217,119,6,.2);   color: #fbbf24; border: 1px solid rgba(217,119,6,.35);   font-size:11px; padding:2px 8px; border-radius:999px; white-space:nowrap; }
.badge-error{ background: rgba(224,43,63,.15);  color: #f07585; border: 1px solid rgba(224,43,63,.35);   font-size:11px; padding:2px 8px; border-radius:999px; white-space:nowrap; }
.badge-info { background: rgba(20,87,217,.2);   color: #6ea3ff; border: 1px solid rgba(20,87,217,.35);   font-size:11px; padding:2px 8px; border-radius:999px; white-space:nowrap; }
.btn-sm     { padding: 4px 10px; font-size: 12px; }

/* Cron Jobs Grid */
.cron-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.cron-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.cron-card:hover {
  border-color: rgba(20,87,217,.5);
  box-shadow: 0 4px 20px rgba(20,87,217,.1);
}
@media (max-width: 640px) {
  .cron-grid { grid-template-columns: 1fr; }
}

/* --- MFA --- */
.mfa-desc {
  font-size: 0.875rem;
  color: var(--cc-muted);
  text-align: center;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.mfa-setup-card {
  max-width: 420px;
}
.mfa-qr-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}
.mfa-qr-img {
  width: 180px;
  height: 180px;
  display: block;
  border-radius: 8px;
}
.mfa-secret-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: var(--cc-surface-2);
  border-radius: 10px;
  border: 1px solid var(--cc-line);
}
.mfa-secret-label {
  font-size: 0.75rem;
  color: var(--cc-muted);
}
.mfa-secret-code {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #6ea3ff;
  letter-spacing: 0.08em;
  word-break: break-all;
  text-align: center;
}
.input-otp {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  padding: 0.75rem 1rem;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--cc-line);
  color: var(--cc-muted);
  border-radius: var(--radius-input);
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  transition: background var(--transition), color var(--transition);
  margin-top: 0.5rem;
  width: 100%;
}
.btn-ghost:hover {
  background: var(--cc-surface-2);
  color: var(--cc-ink);
}

/* MFA Method Picker */
.mfa-method-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1rem;
}
.mfa-method-btn {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: var(--cc-surface-2);
  border: 1px solid var(--cc-line);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  color: var(--cc-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  width: 100%;
}
.mfa-method-btn:hover {
  border-color: var(--cc-blue);
  background: rgba(20,87,217,.1);
  box-shadow: 0 0 0 3px rgba(20,87,217,.12);
}
.mfa-method-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.mfa-method-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.mfa-method-info strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--cc-ink);
}
.mfa-method-info span {
  font-size: 0.78rem;
  color: var(--cc-muted);
}

/* ── Skills Config ───────────────────────────────────────────────────────── */
.skills-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  margin-bottom: .75rem;
}
.skills-search-wrap { flex: 1; min-width: 180px; }
.skills-search-wrap .input { width: 100%; }

.skills-summary {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}

.badge-gray   { background: rgba(148,163,184,.15); color: #94a3b8; }
.badge-purple { background: rgba(168,85,247,.15);  color: #a855f7; }
.badge-green  { background: rgba(34,197,94,.15);   color: #22c55e; }
.badge-red    { background: rgba(239,68,68,.15);   color: #ef4444; }

.skills-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.skills-table thead tr {
  border-bottom: 1px solid var(--border);
}
.skills-table th {
  text-align: left;
  padding: .6rem 1rem;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
}
.skill-row {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.skill-row:hover { background: var(--hover); }
.skill-row-disabled { opacity: .55; }
.skills-table td { padding: .55rem 1rem; vertical-align: middle; }

.skill-name {
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-word;
}
.skill-cat {
  font-size: .78rem;
  color: var(--text-muted);
}
.skill-td-name  { min-width: 160px; max-width: 260px; }
.skill-td-cat   { min-width: 100px; }
.skill-td-src   { min-width: 80px; }
.skill-td-status{ min-width: 80px; }
.skill-td-action{ min-width: 64px; text-align: center; }

/* Toggle switch */
.skill-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  transition: opacity .2s;
}
.skill-toggle-btn:disabled { cursor: not-allowed; }
.skill-toggle-track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 9999px;
  transition: background .2s;
}
.skill-toggle-on .skill-toggle-track  { background: #22c55e; }
.skill-toggle-off .skill-toggle-track { background: #ef4444; }
.skill-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.skill-toggle-on  .skill-toggle-thumb { transform: translateX(16px); }
.skill-toggle-off .skill-toggle-thumb { transform: translateX(0); }

/* ── Control Room UI refresh ─────────────────────────────────── */
:root {
  --cc-bg: #080d19;
  --cc-surface: #101827;
  --cc-surface-2: #172235;
  --cc-line: rgba(102, 144, 220, .18);
  --cc-ink: #f4f7ff;
  --cc-muted: #94a6c7;
  --cc-blue: #3979ed;
  --radius-card: 16px;
}
body { background: radial-gradient(circle at 100% 0, rgba(57,121,237,.12), transparent 29rem), var(--cc-bg); }
.sidebar { width: 244px; background: rgba(13, 21, 35, .96); backdrop-filter: blur(14px); }
.sidebar-header { min-height: 76px; padding: 1rem 1.15rem; }
.sidebar-brand { letter-spacing: -.01em; }
.sidebar-nav { padding: .85rem 0 1.1rem; }
.nav-item { margin: .14rem .65rem; padding: .66rem .8rem; border-radius: 9px; }
.nav-item.active { background: linear-gradient(90deg, rgba(57,121,237,.22), rgba(57,121,237,.08)); color: #a8c8ff; box-shadow: inset 2px 0 0 #4f8fff; }
.nav-item:hover { background: rgba(255,255,255,.055); }
.nav-subitem { padding-left: 2.35rem !important; font-size: .82rem; }
.sidebar-footer { background: rgba(0,0,0,.1); }
.main-content { padding: 2.25rem clamp(1.25rem, 3vw, 3.25rem) 3rem; }
.dashboard-hero { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; padding: .25rem 0 1.4rem; }
.eyebrow { display:block; margin-bottom:.4rem; color:#79a7ff; font-size:.7rem; font-weight:700; letter-spacing:.13em; text-transform:uppercase; }
.page-title { font-size: clamp(1.75rem, 3vw, 2.2rem); letter-spacing: -.045em; }
.page-subtitle { max-width: 680px; }
.dashboard-health { display:flex; align-items:center; gap:.8rem; padding:.9rem 1rem; margin-bottom:1.2rem; border:1px solid rgba(43, 193, 130, .28); border-radius:12px; background:linear-gradient(90deg, rgba(25,113,79,.22), rgba(25,113,79,.06)); }
.dashboard-health.is-warning { border-color:rgba(217,119,6,.36); background:linear-gradient(90deg, rgba(217,119,6,.2), rgba(217,119,6,.05)); }
.dashboard-health.is-error { border-color:rgba(224,43,63,.4); background:linear-gradient(90deg, rgba(224,43,63,.2), rgba(224,43,63,.05)); }
.dashboard-health.is-loading { border-color:var(--cc-line); background:rgba(255,255,255,.025); }
.health-dot { width:10px; height:10px; border-radius:50%; flex:0 0 auto; background:#4cae87; box-shadow:0 0 0 5px rgba(76,174,135,.12); }
.is-warning .health-dot { background:#fbbf24; box-shadow:0 0 0 5px rgba(251,191,36,.12); }
.is-error .health-dot { background:#f07585; box-shadow:0 0 0 5px rgba(240,117,133,.12); }
.is-loading .health-dot { background:#6ea3ff; box-shadow:0 0 0 5px rgba(110,163,255,.12); animation: pulse-dot 1.2s infinite; }
.dashboard-health strong,.dashboard-health span { display:block; }
.dashboard-health strong { font-size:.86rem; }
.dashboard-health div span { font-size:.78rem; color:var(--cc-muted); margin-top:.1rem; }
@keyframes pulse-dot { 50% { opacity:.4; transform:scale(.8); } }
.dashboard-metrics { gap:1rem; }
.server-grid .card,.dashboard-grid .card,.profile-card,.model-card { box-shadow:0 12px 30px rgba(0,0,0,.2); }
.server-grid .card { position:relative; overflow:hidden; }
.server-grid .card::before { content:""; position:absolute; left:0; right:0; top:0; height:2px; background:linear-gradient(90deg, #3979ed, #67a1ff); opacity:.8; }
.card-header { padding: .9rem 1.1rem; background:rgba(255,255,255,.015); }
.metric-block { padding: 1.15rem 1.25rem 1.25rem; }
.pm2-table { min-width: 560px; }
#server-pm2 { overflow-x:auto; }
.badge { font-weight:650; }
.btn { border-radius:10px; font-weight:600; }
.btn-primary { box-shadow:0 8px 18px rgba(57,121,237,.2); }
.btn-ghost { background:rgba(255,255,255,.02); }
.card,.profile-card,.model-card,.panel { border-color:rgba(102,144,220,.16); }
.card:hover,.profile-card:hover,.model-card:hover { border-color:rgba(102,144,220,.38); }
.sidebar-backdrop { display:none; }
@media (max-width: 600px) {
  .main-content { padding: 4.6rem 1rem 2rem; }
  .sidebar { width:min(84vw, 300px); }
  .sidebar.open ~ .sidebar-backdrop { display:block; position:fixed; inset:0; z-index:90; background:rgba(3,7,18,.62); backdrop-filter:blur(2px); }
  .dashboard-hero { align-items:flex-start; flex-direction:column; }
  .dashboard-hero .btn { width:100%; justify-content:center; }
  .dashboard-health { align-items:flex-start; }
  .server-grid { grid-template-columns:1fr 1fr; gap:.7rem; }
  .server-grid .card:last-child { grid-column:span 2; }
}
@media (max-width: 390px) { .server-grid { grid-template-columns:1fr; } .server-grid .card:last-child { grid-column:auto; } }
