/* ============================================================
   Hosting Backup Manager — Design System
   Clean · Professional · Minimal · Responsive
   ============================================================ */
:root {
  --bg: #f1f5f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --success: #16a34a;
  --success-soft: #dcfce7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;
  --sidebar-bg: #0b1220;
  --sidebar-text: #94a3b8;
  --sidebar-active: #1e293b;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }

/* ============ Login ============ */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(1000px 600px at 20% 0%, #312e81 0%, #0b1220 55%), #0b1220;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.login-logo { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.login-logo h1 { font-size: 18px; }
.login-logo p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.logo-badge {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -4px rgba(79, 70, 229, .45);
}
.logo-badge svg { width: 22px; height: 22px; color: #fff; }
.login-error {
  background: var(--danger-soft); color: var(--danger);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 14px;
}
.login-hint { color: var(--muted-2); font-size: 12px; text-align: center; margin: 18px 0 0; }

/* ============ Layout ============ */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  transition: transform .22s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}
.brand-name { color: #e2e8f0; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #475569; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin: 1px 0;
  border-radius: 9px; color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: background .12s, color .12s;
  text-decoration: none !important;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item:hover { background: rgba(148, 163, 184, .09); color: #e2e8f0; }
.nav-item.active { background: var(--sidebar-active); color: #fff; }
.nav-item.active svg { color: #818cf8; opacity: 1; }
.sidebar-footer { padding: 14px 16px; border-top: 1px solid rgba(148, 163, 184, .12); }
.sidebar-mode { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.sidebar-version { font-size: 11px; color: #475569; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 35;
  background: rgba(15, 23, 42, .5); backdrop-filter: blur(1px);
}

.main { flex: 1; margin-left: 248px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px;
}
.topbar-burger { display: none; }
.topbar-title-wrap { flex: 1; min-width: 0; }
.topbar-title { font-size: 17px; }
.topbar-sub { margin: 1px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 9px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 600;
  font-family: var(--font); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s;
  white-space: nowrap; text-decoration: none !important;
}
.btn svg { width: 15px; height: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .4); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: #cbd5e1; background: #f8fafc; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: #f1f5f9; color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-danger-outline { background: #fff; border-color: #fecaca; color: var(--danger); }
.btn-danger-outline:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; padding: 10px 14px; }
.icon-btn {
  background: transparent; border: none; cursor: pointer; color: var(--muted);
  width: 34px; height: 34px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: #f1f5f9; color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.btn-spinner {
  width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
.btn-spinner.dark { border-color: rgba(79,70,229,.25); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Cards & grid ============ */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 14.5px; }
.card-header .sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.grid { display: grid; gap: 16px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.section-gap { margin-bottom: 16px; }

.stat-card { padding: 16px; display: flex; gap: 13px; align-items: flex-start; }
.stat-icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 19px; height: 19px; }
.stat-icon.indigo { background: var(--primary-soft); color: var(--primary); }
.stat-icon.blue { background: var(--info-soft); color: var(--info); }
.stat-icon.green { background: var(--success-soft); color: var(--success); }
.stat-icon.red { background: var(--danger-soft); color: var(--danger); }
.stat-icon.amber { background: var(--warning-soft); color: var(--warning); }
.stat-icon.violet { background: var(--violet-soft); color: var(--violet); }
.stat-icon.teal { background: #ccfbf1; color: #0d9488; }
.stat-icon.slate { background: #e2e8f0; color: #475569; }
.stat-value { font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat-extra { font-size: 11px; color: var(--muted-2); margin-top: 3px; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600;
  padding: 11px 14px; border-bottom: 1px solid var(--border); background: #f8fafc;
  white-space: nowrap;
}
.tbl tbody td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #f8fafc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 600; color: var(--text); }
.tbl .muted { color: var(--muted); }
.tbl .nowrap { white-space: nowrap; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ============ Badges ============ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.success { background: var(--success-soft); color: #15803d; }
.badge.failed { background: var(--danger-soft); color: #b91c1c; }
.badge.error { background: var(--danger-soft); color: #b91c1c; }
.badge.running { background: var(--info-soft); color: #1d4ed8; }
.badge.uploading { background: var(--violet-soft); color: #6d28d9; }
.badge.pending { background: var(--warning-soft); color: #b45309; }
.badge.neutral { background: #f1f5f9; color: #475569; }
.badge.info { background: var(--info-soft); color: #1d4ed8; }
.badge.mock { background: var(--warning-soft); color: #b45309; }
.badge.real { background: var(--success-soft); color: #15803d; }
.badge.violet { background: var(--violet-soft); color: #6d28d9; }
.badge.amber { background: var(--warning-soft); color: #b45309; }
.badge.running .dot, .badge.uploading .dot { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ============ Forms ============ */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 5px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type="text"], input[type="password"], input[type="number"], input[type="email"],
input[type="date"], select, textarea {
  width: 100%; font-family: var(--font); font-size: 13.5px;
  padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, .14);
}
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.check-row input { width: 15px; height: 15px; accent-color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

/* ============ Modal ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px 24px; overflow-y: auto;
  animation: fadein .15s ease;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px;
  animation: slideup .18s ease;
}
.modal.modal-lg { max-width: 700px; }
.modal.modal-sm { max-width: 420px; }
@keyframes slideup { from { transform: translateY(14px); opacity: 0; } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 15px; }
.modal-body { padding: 18px 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 14px 20px; border-top: 1px solid var(--border); background: #f8fafc;
  border-radius: 0 0 14px 14px;
}

/* ============ Toast ============ */
#toast-root {
  position: fixed; top: 18px; right: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 9px; max-width: 380px;
}
.toast {
  background: #0f172a; color: #e2e8f0;
  border-radius: 10px; padding: 11px 14px;
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; box-shadow: var(--shadow-lg);
  animation: toastin .2s ease;
}
@keyframes toastin { from { transform: translateX(24px); opacity: 0; } }
.toast svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.toast.success svg { color: #4ade80; }
.toast.error svg { color: #f87171; }
.toast.info svg { color: #818cf8; }
.toast .toast-close { margin-left: auto; background: none; border: none; color: #94a3b8; cursor: pointer; padding: 0; }
.toast .toast-close:hover { color: #fff; }

/* ============ Misc ============ */
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.empty-state { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-state svg { width: 40px; height: 40px; color: #cbd5e1; margin-bottom: 10px; }
.empty-state h4 { color: #334155; margin-bottom: 4px; }
.empty-state p { margin: 0 auto 14px; max-width: 380px; font-size: 13px; }
.loading-row { padding: 34px; text-align: center; color: var(--muted); }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid rgba(79, 70, 229, .2);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block; vertical-align: middle;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.toolbar input[type="text"], .toolbar select, .toolbar input[type="date"] { width: auto; min-width: 140px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 9px; padding: 13px 16px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.filter-bar select, .filter-bar input { width: auto; min-width: 128px; font-size: 12.5px; padding: 6px 9px; }

/* Jobs indicator */
.jobs-indicator { position: relative; }
.jobs-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border); background: #fff; border-radius: 8px;
  padding: 6px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text);
}
.jobs-btn.has-active { border-color: #c7d2fe; background: var(--primary-soft); color: var(--primary); }
.jobs-popover {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); width: 320px; padding: 8px;
}
.job-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; font-size: 12.5px;
}
.job-row:hover { background: #f8fafc; }
.job-row .grow { flex: 1; min-width: 0; }
.job-row .db { font-weight: 600; }
.job-row .meta { color: var(--muted); font-size: 11.5px; }

/* User menu */
.user-menu { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px 5px 6px; cursor: pointer; font-family: var(--font);
  font-size: 13px; font-weight: 600; color: var(--text);
}
.user-chip:hover { background: #f8fafc; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  background: #fff; border: 1px solid var(--border); border-radius: 11px;
  box-shadow: var(--shadow-lg); min-width: 180px; padding: 6px;
}
.dropdown-item {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 8px 11px; border-radius: 7px; cursor: pointer;
  font-family: var(--font); font-size: 13px; color: var(--text);
}
.dropdown-item:hover { background: #f1f5f9; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-soft); }

/* Detail list */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 13px 20px; }
.detail-item .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 3px; }
.detail-item .v { font-size: 13.5px; font-weight: 600; word-break: break-all; }
.detail-item .v.mono, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* Progress bar */
.progress { height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; min-width: 70px; }
.progress > div { height: 100%; background: var(--primary); border-radius: 999px; }
.progress.green > div { background: var(--success); }
.progress.amber > div { background: var(--warning); }
.progress.red > div { background: var(--danger); }

/* Drive folder tree */
.folder-tree { font-size: 13px; padding: 4px 0; }
.folder-tree ul { list-style: none; margin: 0; padding-left: 0; }
.folder-tree ul ul { padding-left: 22px; }
.folder-tree li { padding: 3.5px 0; color: #334155; display: block; }
.folder-tree li > span { display: inline-flex; align-items: center; gap: 7px; }
.folder-tree svg { width: 14px; height: 14px; color: #eab308; flex: none; }
.folder-tree .file svg { color: #64748b; }
.folder-tree .muted-line { color: var(--muted-2); }

.alert {
  border-radius: 10px; padding: 11px 14px; font-size: 13px;
  display: flex; gap: 10px; align-items: flex-start;
}
.alert svg { width: 16px; height: 16px; flex: none; margin-top: 1.5px; }
.alert.info { background: var(--info-soft); color: #1e40af; }
.alert.warn { background: var(--warning-soft); color: #92400e; }
.alert.error { background: var(--danger-soft); color: #991b1b; }
.alert.success { background: var(--success-soft); color: #166534; }

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; cursor: pointer; }
.back-link:hover { color: var(--text); text-decoration: none; }
.back-link svg { width: 15px; height: 15px; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .topbar-burger { display: inline-flex; }
  .content { padding: 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar-sub { display: none; }
  .user-chip .name { display: none; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .topbar-actions .btn span.btn-label { display: none; }
  .content { padding: 12px; }
  #toast-root { left: 16px; right: 16px; max-width: none; }
}

/* ================= Fase 2B: notification center ================= */
.notif-wrap { position: relative; }
.notif-btn { position: relative; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--border, #e2e8f0); background: #fff; color: #475569; cursor: pointer; transition: all .15s; }
.notif-btn:hover { background: #f1f5f9; color: var(--primary); }
.notif-btn svg { width: 17px; height: 17px; }
.notif-count { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 92vw); max-height: 480px; overflow: auto; background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 14px; box-shadow: 0 16px 40px rgba(15,23,42,.16); z-index: 60; }
.notif-head { position: sticky; top: 0; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; }
.notif-list { display: flex; flex-direction: column; }
.notif-row { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #f8fafc; cursor: pointer; transition: background .12s; }
.notif-row:hover { background: #f8fafc; }
.notif-row.unread { background: #eef2ff55; }
.notif-row.unread:hover { background: #eef2ff; }
.notif-title { font-size: 12.5px; font-weight: 650; color: var(--ink, #0f172a); }
.notif-msg { font-size: 11.5px; color: #64748b; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { font-size: 10.5px; color: #94a3b8; margin-top: 3px; }
.notif-empty { padding: 26px; text-align: center; color: #94a3b8; font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.sev-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; }
.sev-dot.info { background: #3b82f6; }
.sev-dot.success { background: #22c55e; }
.sev-dot.warning { background: #f59e0b; }
.sev-dot.error { background: #ef4444; }

/* ================= Fase 2B: retention & restore ================= */
details.cleanup-detail summary { cursor: pointer; color: var(--primary); font-size: 11.5px; outline: none; }
details.cleanup-detail summary:hover { text-decoration: underline; }
.cleanup-files { margin: 8px 0 2px; padding: 8px 12px; background: #f8fafc; border-radius: 8px; font-size: 11.5px; max-height: 180px; overflow: auto; }
.cleanup-files .ok { color: #15803d; }
.cleanup-files .bad { color: #b91c1c; }
.keep-over { color: #b91c1c; font-weight: 650; }
.keep-ok { color: #15803d; }
.restore-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-bottom: 14px; }
.restore-grid .item .k { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.restore-grid .item .v { font-size: 13px; font-weight: 600; color: var(--ink, #0f172a); margin-top: 2px; word-break: break-word; }
.restore-choice { display: flex; gap: 8px; margin-bottom: 14px; }
.restore-choice label { flex: 1; display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; border: 1.5px solid var(--border, #e2e8f0); border-radius: 10px; cursor: pointer; transition: all .12s; }
.restore-choice label.active { border-color: var(--primary); background: var(--primary-soft); }
.restore-choice input { margin-top: 2px; }
.restore-choice .rc-t { font-weight: 650; font-size: 13px; }
.restore-choice .rc-d { font-size: 11.5px; color: #64748b; margin-top: 1px; }
@media (max-width: 640px) { .restore-grid { grid-template-columns: 1fr; } .restore-choice { flex-direction: column; } }

/* ================= Fase 2B lanjutan: health, storage monitoring, logs ================= */
.dash-notif { max-height: 340px; overflow: auto; }

.health-card { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; padding: 16px 20px; border-left: 4px solid var(--border); }
.health-card.healthy { border-left-color: var(--success); }
.health-card.warning { border-left-color: var(--warning); background: linear-gradient(90deg, #fffbeb, var(--card) 55%); }
.health-card.critical { border-left-color: var(--danger); background: linear-gradient(90deg, #fef2f2, var(--card) 55%); }
.health-main { display: flex; gap: 11px; align-items: flex-start; flex: 1 1 280px; min-width: 240px; }
.health-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.health-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; margin-top: 4px; position: relative; }
.health-dot.healthy { background: var(--success); box-shadow: 0 0 0 4px #22c55e22; }
.health-dot.warning { background: var(--warning); box-shadow: 0 0 0 4px #f59e0b22; }
.health-dot.critical { background: var(--danger); box-shadow: 0 0 0 4px #ef444422; animation: pulse-dot 1.6s infinite; }
@keyframes pulse-dot { 0%,100% { box-shadow: 0 0 0 4px #ef444422; } 50% { box-shadow: 0 0 0 7px #ef444411; } }
.health-stats { display: grid; grid-template-columns: repeat(6, minmax(86px, 1fr)); gap: 8px 14px; flex: 2 1 520px; }
.health-stats .hs { min-width: 0; }
.health-stats .hs-v { font-weight: 750; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-stats .hs-l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 1px; }

.mon-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.mon-tile { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: #f8fafc; min-width: 0; }
.mon-tile .mt-v { font-size: 17px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-tile .mt-l { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.mon-tile .mt-s { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mon-tile.accent { border-color: #c7d2fe; background: var(--primary-soft); }
.storage-bar-wrap { margin-top: 14px; }
.storage-bar { height: 10px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.storage-bar > div { height: 100%; border-radius: 999px; background: var(--success); transition: width .3s; }
.storage-bar.warn > div { background: var(--warning); }
.storage-bar.crit > div { background: var(--danger); }
.storage-bar-legend { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 5px; flex-wrap: wrap; }

.log-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.log-filter-bar select, .log-filter-bar input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 12.5px; background: var(--card); }
.log-msg { font-size: 12px; color: #334155; word-break: break-word; }
.mono-sm { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

@media (max-width: 1100px) {
  .health-stats { grid-template-columns: repeat(3, 1fr); }
  .mon-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .health-card { padding: 14px 16px; }
  .health-stats { grid-template-columns: repeat(2, 1fr); flex-basis: 100%; }
  .mon-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 460px) {
  .mon-grid { grid-template-columns: 1fr; }
}

/* ikon inline kecil di dalam teks notifikasi/log */
.notif-time svg, .notif-msg svg, .notif-title svg { width: 11px; height: 11px; vertical-align: -1px; }
.log-msg svg { width: 11px; height: 11px; vertical-align: -1px; }

/* ============================================================
   Fase 3 — WHM, Bulk Backup & Migration
   ============================================================ */

/* Wizard steps */
.wiz-steps { list-style: none; display: flex; gap: 4px; margin: 0 0 16px; padding: 0 0 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wiz-steps li { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted-2); padding: 4px 10px 4px 4px; border-radius: 999px; white-space: nowrap; }
.wiz-steps li .dot { width: 22px; height: 22px; border-radius: 999px; background: #f1f5f9; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; }
.wiz-steps li.active { color: var(--primary); font-weight: 700; background: var(--primary-soft); }
.wiz-steps li.active .dot { background: var(--primary); color: #fff; }
.wiz-steps li.done { color: #15803d; }
.wiz-steps li.done .dot { background: var(--success-soft); color: #15803d; }
.wiz-body { min-height: 120px; }

/* Server picker cards */
.server-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.srv-card { display: block; text-align: left; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--card); cursor: pointer; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
.srv-card:hover { border-color: #c7d2fe; box-shadow: var(--shadow); }
.srv-card.active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.srv-card .muted { margin-top: 4px; }

/* Account filter bar (bulk backup) */
.acct-filter { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.acct-filter input[type="search"] { flex: 1 1 200px; min-width: 160px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 12.5px; background: var(--card); }
.acct-filter select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 12.5px; background: var(--card); }

/* Migration stage line (per-item lifecycle) */
.stage-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 6px; margin: 8px 0; }
.stage { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted-2); padding: 3px 8px; border-radius: 999px; background: #f8fafc; border: 1px solid var(--border); white-space: nowrap; }
.stage .stage-ic { font-size: 11px; width: 14px; text-align: center; flex: 0 0 auto; }
.stage.done { color: #15803d; background: var(--success-soft); border-color: #bbf7d0; }
.stage.active { color: var(--primary); background: var(--primary-soft); border-color: #c7d2fe; font-weight: 700; }
.stage.active .stage-ic { animation: pulse 1.1s ease-in-out infinite; }
.stage.failed { color: #b91c1c; background: var(--danger-soft); border-color: #fecaca; }
.stage.skip { color: #b45309; background: var(--warning-soft); border-color: #fde68a; }
.stage-arrow { color: var(--muted-2); font-size: 11px; }
.mig-item { border-left: 3px solid var(--border); }
.mig-item:has(.stage.active) { border-left-color: var(--primary); }

/* Component status chips */
.comp-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.comp-chip .badge { text-transform: none; }

/* Pre-check rows */
.pc-row { display: flex; gap: 9px; padding: 5px 0; align-items: flex-start; }
.pc-row + .pc-row { border-top: 1px solid #f1f5f9; }
.pc-ic { width: 18px; height: 18px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: 0 0 auto; margin-top: 1px; }
.pc-ic.pass { background: var(--success-soft); color: #15803d; }
.pc-ic.warn { background: var(--warning-soft); color: #b45309; }
.pc-ic.fail { background: var(--danger-soft); color: #b91c1c; }

/* Migration log box */
.log-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.55; background: #0b1220; color: #cbd5e1; border-radius: 9px; padding: 10px 12px; margin: 8px 0 0; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* Final migration report */
.report-box { border: 1px solid var(--border); border-radius: 10px; padding: 13px 15px; margin-top: 8px; background: #f8fafc; font-size: 12.5px; }
.rb-title { font-weight: 800; font-size: 13.5px; margin-bottom: 8px; }
.rb-row { display: flex; gap: 10px; padding: 3px 0; align-items: baseline; flex-wrap: wrap; }
.rb-row > span:first-child { min-width: 130px; color: var(--muted); flex: 0 0 auto; }
.rb-row > b { font-weight: 650; }

/* Bulk batch summary card */
.batch-card { border-left: 3px solid var(--primary); }

/* Check list (wizard account select) */
.check-list .check-row { cursor: pointer; }
.check-list .check-row:hover { background: #f8fafc; }

/* .restore-choice sudah didefinisikan di atas (dipakai ulang oleh wizard migration on_existing) */

/* Bulk backup modal rows */
.bb-row { display: flex; align-items: center; gap: 9px; padding: 7px 4px; border-bottom: 1px solid #f1f5f9; }

@media (max-width: 760px) {
  .wiz-steps { gap: 2px; }
  .wiz-steps li { font-size: 10.5px; padding-right: 6px; }
  .wiz-steps li .dot { width: 18px; height: 18px; font-size: 10px; }
  .server-pick { grid-template-columns: 1fr; }
  .stage-line { gap: 4px; }
  .stage { font-size: 10.5px; padding: 2px 6px; }
  .stage-arrow { display: none; }
  .rb-row > span:first-child { min-width: 96px; }
  .acct-filter input[type="search"] { flex-basis: 100%; }
}

/* Ikon inline di dalam teks (fallback: cegah SVG raksasa di luar .btn/.alert/.nav) */
.inline-ic svg { width: 13px; height: 13px; vertical-align: -1.5px; }
