/* JCWD Tools — WP Manager. Themed to the Jomar brand:
   palette navy #1F2838 / sky #97E2FF / slate #3C4B66 on white/#EEEEF0,
   Inter typeface, soft "contained block" card radius + crisp "action" radius
   on buttons/inputs. Flat fills, no gradients. Semantic status colors
   (green/amber/red) are kept for ops meaning — color used for meaning, not decor. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap');

:root {
  --canvas:    #EEEEF0;   /* page background */
  --surface:   #FFFFFF;   /* cards / panels */
  --surface-2: #F4F5F7;   /* subtle inset */
  --primary:   #1F2838;   /* dark navy — ink + key UI */
  --secondary: #97E2FF;   /* sky blue — accent / reverse */
  --accent:    #3C4B66;   /* muted slate — exception use only */
  --border:    #EEEEF0;   /* structural dividers */
  --text:      #1F2838;
  --muted:     #5B6678;
  /* Semantic status (restrained, for meaning only) */
  --green: #1c8a54; --green-soft: #e8f4ee;
  --amber: #b97e16; --amber-soft: #f6efe0;
  --red:   #c0413c; --red-soft:   #f6e9e8;
  --shadow: 0 1px 2px rgba(31,40,56,.04), 0 6px 20px rgba(31,40,56,.07);
  --radius-card: 20px;   /* contained blocks: cards, panels */
  --radius: 20px;
  --radius-action: 10px; /* action elements: buttons, inputs, chips */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { text-transform: capitalize; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Layout ── */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--primary); border-right: none;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 22px 20px 16px; display: flex; align-items: center; gap: 11px; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--secondary); color: var(--primary);
  display: grid; place-items: center; font-weight: 900; font-size: 17px;
}
.brand h1 { font-size: 15px; margin: 0; font-weight: 800; color: #fff; letter-spacing: -.01em; text-transform: capitalize; }
.brand small { color: rgba(255,255,255,.55); font-weight: 500; display: block; font-size: 11px; text-transform: capitalize; }
.nav { padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-action);
  color: rgba(255,255,255,.72); font-weight: 600; font-size: 13px; text-transform: capitalize;
}
.nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav a.active { background: var(--secondary); color: var(--primary); }
.nav a.disabled { opacity: .4; cursor: default; }
.nav a.disabled:hover { background: none; color: rgba(255,255,255,.72); }
.nav .badge-soon { margin-left: auto; font-size: 9px; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.6); background: rgba(255,255,255,.12); padding: 2px 7px; border-radius: 20px; }
.sidebar .foot { margin-top: auto; padding: 16px; border-top: 1px solid rgba(255,255,255,.12); }
/* ghost-reverse: sky outline on navy */
.sidebar .foot .btn { color: var(--secondary); border-color: rgba(151,226,255,.4); background: transparent; }
.sidebar .foot .btn:hover { background: rgba(151,226,255,.12); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 28px; position: sticky; top: 0; z-index: 10;
}
.topbar h2 { font-size: 17px; margin: 0; font-weight: 800; text-transform: capitalize; }
.topbar .spacer { flex: 1; }
.content { padding: 32px 28px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ── Buttons (action elements) ── */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--primary);
  padding: 10px 18px; border-radius: var(--radius-action); font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px; transition: .12s; text-transform: capitalize;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* Primary = navy block with sky ink + directional cue (brand button anatomy) */
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--secondary); }
.btn.primary:hover { background: #2a3550; }
.btn.primary::after { content: '\2192'; font-weight: 700; margin-left: 2px; }
.btn.primary.no-arrow::after { content: none; }
.btn.danger { color: var(--red); border-color: #e6c5c4; background: var(--surface); }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }

/* ── Cards / grid ── */
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px; box-shadow: var(--shadow); }
.stat .n { font-size: 34px; font-weight: 900; letter-spacing: -.02em; line-height: 1.05; }
.stat .l { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 6px; text-transform: capitalize; }
.stat.warn .n { color: var(--amber); }
.stat.bad .n { color: var(--red); }

.sites-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.site-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px;
}
.site-card .head { display: flex; align-items: flex-start; gap: 12px; }
.site-card .fav { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); display: grid; place-items: center; font-weight: 900; color: var(--secondary); flex-shrink: 0; }
.site-card .title { font-weight: 800; font-size: 15px; }
.site-card .url { color: var(--muted); font-size: 12px; word-break: break-all; }
.site-card .meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.site-card .badges { display: flex; flex-wrap: wrap; gap: 6px; }
.site-card .actions { display: flex; gap: 8px; margin-top: auto; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.connected { background: var(--green); }
.dot.error { background: var(--red); }
.dot.unknown { background: var(--muted); }

/* status tags — action-level radius per brand */
.badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 5px; text-transform: capitalize;
}
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.up { background: var(--amber-soft); color: var(--amber); }
.badge.err { background: var(--red-soft); color: var(--red); }
.badge.muted { background: var(--surface-2); color: var(--muted); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.tabs button {
  border: none; background: none; padding: 11px 14px; font-weight: 600; font-size: 13px; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px; text-transform: capitalize;
}
.tabs button:hover { color: var(--primary); }
.tabs button.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--secondary); }
.tabs button.disabled { opacity: .45; cursor: default; }
.tabs button.disabled:hover { color: var(--muted); }
.tabs button .soon { font-size: 9px; text-transform: uppercase; background: var(--surface-2); padding: 1px 5px; border-radius: 10px; margin-left: 5px; }

/* ── Tables / panels ── */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow); overflow: hidden; }
.panel .phead { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.panel .phead h3 { margin: 0; font-size: 14px; font-weight: 800; text-transform: capitalize; }
.panel .phead .spacer { flex: 1; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 22px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; background: var(--surface-2); }
tr:last-child td { border-bottom: none; }
td .name { font-weight: 600; }
td .ver { color: var(--muted); font-size: 12px; }
.checkcell { width: 36px; }

/* ── Forms ── */
label.field { display: block; margin-bottom: 14px; }
label.field span { display: block; font-weight: 600; font-size: 12px; margin-bottom: 6px; color: var(--text); text-transform: capitalize; }
input[type=text], input[type=email], input[type=password], input[type=url] {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-action); font-size: 14px; font-family: inherit; background: var(--surface); color: var(--text);
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(151,226,255,.55); }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ── Modal ── */
.overlay { position: fixed; inset: 0; background: rgba(31,40,56,.5); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--surface); border-radius: 24px; width: 100%; max-width: 520px; box-shadow: 0 24px 64px rgba(31,40,56,.28); max-height: 88vh; display: flex; flex-direction: column; }
.modal.lg { max-width: 680px; }
.modal .mhead { padding: 26px 28px 0; }
.modal .mhead h3 { margin: 0 0 4px; font-size: 19px; font-weight: 800; text-transform: capitalize; }
.modal .mhead p { margin: 0; color: var(--muted); font-size: 13px; }
.modal .mbody { padding: 22px 28px; overflow: auto; }
.modal .mfoot { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.dropzone { border: 2px dashed var(--border); border-radius: 16px; padding: 32px; text-align: center; color: var(--muted); transition: .12s; cursor: pointer; }
.dropzone.drag { border-color: var(--secondary); background: rgba(151,226,255,.18); color: var(--primary); }
.dropzone strong { color: var(--text); }
.filechip { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--surface-2); border-radius: 10px; margin-top: 10px; font-size: 13px; }

.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.step { flex: 1; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-action); font-size: 12px; color: var(--muted); font-weight: 600; }
.step.active { border-color: var(--primary); color: var(--primary); background: rgba(151,226,255,.2); }
.copyrow { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.copyrow input { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
ol.guide { padding-left: 18px; color: var(--muted); font-size: 13px; }
ol.guide li { margin-bottom: 7px; }
ol.guide strong { color: var(--text); }

/* ── Toast ── */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast { background: var(--primary); color: #fff; padding: 13px 17px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 28px rgba(31,40,56,.3); display: flex; align-items: center; gap: 9px; animation: slidein .2s ease; max-width: 360px; }
.toast.ok { background: #1c7a4b; }
.toast.err { background: #b23b39; }
.toast.info { background: var(--accent); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Misc ── */
.empty { text-align: center; padding: 72px 20px; color: var(--muted); }
.empty .big { font-size: 44px; margin-bottom: 12px; color: var(--secondary); }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); width: 100%; max-width: 400px; padding: 40px; }
.auth-card .logo { width: 48px; height: 48px; border-radius: 12px; background: var(--secondary); color: var(--primary); display: grid; place-items: center; font-weight: 900; margin: 0 auto 18px; font-size: 20px; }
.auth-card h2 { text-align: center; margin: 0 0 4px; text-transform: capitalize; }
.auth-card p.sub { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: 13px; }
.kv .k { color: var(--muted); font-weight: 600; text-transform: capitalize; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 14px; }
.metric { background: var(--surface-2); border-radius: 14px; padding: 20px; }
.metric .mv { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.metric .ml { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; }
.score-ring { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-weight: 900; font-size: 20px; }
.muted-text { color: var(--muted); }
.row-actions { display: flex; gap: 6px; }
.loading-row { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 720px) {
  .sidebar { display: none; }
  .summary { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 24px 18px; }
}
