@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0d1220;
  --bg-2: #131a2e;
  --panel: #ffffff;
  --panel-2: #f4f6fb;
  --border: #e6eaf3;
  --text: #131c2e;
  --muted: #6b7690;
  --primary: #10a35a;
  --primary-2: #16c26b;
  --primary-soft: #e6f9ef;
  --accent: #4f7cff;
  --danger: #e5484d;
  --grad: linear-gradient(135deg, #10a35a 0%, #0bbf8a 100%);
  --shadow: 0 20px 45px rgba(19, 28, 46, 0.10);
  --shadow-sm: 0 6px 18px rgba(19, 28, 46, 0.07);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(16, 194, 107, 0.08), transparent 60%),
    radial-gradient(700px 420px at -10% 25%, rgba(79, 124, 255, 0.07), transparent 60%),
    var(--panel-2);
  background-attachment: fixed;
}

a { text-decoration: none; color: inherit; }

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background:
    radial-gradient(320px 220px at 15% 0%, rgba(22, 194, 107, 0.16), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: #cdd6e6;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand__logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--grad);
  box-shadow: 0 6px 18px rgba(16, 194, 107, 0.35);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  color: #fff;
}

.brand__text { display: flex; flex-direction: column; }
.brand__name { font-weight: 700; color: #fff; font-size: 16px; }
.brand__sub { font-size: 12px; color: #8ea0bd; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; flex: 1; }

.nav__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7d9c;
  margin: 16px 10px 6px;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: #aab6cc;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.nav__item:hover { background: rgba(255,255,255,0.07); color: #fff; transform: translateX(3px); }
.nav__item.is-active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 194, 107, 0.35);
}
.nav__item.is-disabled { opacity: 0.45; cursor: not-allowed; }
.nav__icon { width: 20px; text-align: center; }

.sidebar__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #8ea0bd;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--green { background: #34d17a; box-shadow: 0 0 0 3px rgba(52,209,122,0.2); }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar__title h1 { margin: 0; font-size: 20px; }
.topbar__title p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.theme-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 40px; height: 40px;
  font-size: 17px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.2s, transform 0.15s;
}
.theme-btn:hover { transform: translateY(-1px); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 12px rgba(16, 194, 107, 0.3);
}

.icon-btn {
  display: none;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 40px; height: 40px;
  font-size: 18px; cursor: pointer;
}

.content { padding: 28px; flex: 1; max-width: 1100px; width: 100%; animation: fadeUp 0.35s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* Hero */
.hero {
  background:
    radial-gradient(520px 240px at 85% -20%, rgba(255, 255, 255, 0.18), transparent 60%),
    linear-gradient(120deg, #0e8f52 0%, #0bbf8a 55%, #12a3b4 100%);
  color: #fff;
  border-radius: 22px;
  padding: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 20px 40px rgba(11, 191, 138, 0.25);
  position: relative;
  overflow: hidden;
}
.hero__text h2 { margin: 0 0 8px; font-size: 24px; }
.hero__text p { margin: 0; max-width: 620px; color: #dbf3e4; line-height: 1.5; }
.hero__badge {
  background: rgba(255,255,255,0.15);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}

.section-title { margin: 30px 0 14px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(16, 194, 107, 0.4); }
.card__icon {
  width: 50px; height: 50px; border-radius: 14px;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-size: 24px; margin-bottom: 6px;
}
.card h4 { margin: 0; font-size: 16px; }
.card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.card__cta { margin-top: auto; color: var(--primary); font-weight: 600; font-size: 14px; padding-top: 8px; }
.card--soon { opacity: 0.75; }
.card--soon:hover { transform: none; box-shadow: none; border-color: var(--border); }
.card__badge {
  margin-top: auto; padding-top: 8px;
  font-size: 12px; color: var(--muted); font-weight: 600;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 18px 28px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

/* ---------- Tool page ---------- */
.tool-wrap { max-width: 860px; }

.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--primary); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.input-row { display: flex; gap: 10px; }

input[type="text"], input[type="url"], input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--panel-2);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus, input[type="url"]:focus, input[type="password"]:focus {
  outline: none;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(14,138,75,0.15);
  background: #fff;
}
.prefix-box {
  display: flex;
  align-items: center;
  gap: 4px;
}
.prefix {
  padding: 12px 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.prefix + input { border-radius: 0 10px 10px 0; }

.btn {
  border: none;
  border-radius: 12px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow 0.2s, transform 0.15s, background 0.2s, filter 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(16, 163, 90, 0.3);
}
.btn--primary:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 12px 26px rgba(16, 163, 90, 0.38); }
.btn--ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: #eef2f7; }
.btn--sm { padding: 7px 12px; font-size: 13px; }
.btn--danger { background: #fdecea; color: var(--danger); }
.btn--danger:hover { background: #fbdad6; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

.alert {
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}
.alert.is-visible { display: block; }
.alert--error { background: #fdecea; color: var(--danger); }
.alert--success { background: var(--primary-soft); color: var(--primary); }

.result {
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed #b9dcc8;
  border-radius: 12px;
  background: var(--primary-soft);
  display: none;
}
.result.is-visible { display: block; }
.result__label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.result__row { display: flex; gap: 10px; align-items: center; }
.result__link {
  flex: 1;
  font-weight: 700;
  color: var(--primary);
  word-break: break-all;
  font-size: 15px;
}

/* Table of saved links */
.saved { margin-top: 30px; }
.saved__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.saved__head h3 { margin: 0; font-size: 16px; }

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table th, .table td {
  text-align: left;
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table th { background: var(--panel-2); color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table .short a { color: var(--primary); font-weight: 600; }
.table .long { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .clicks { text-align: center; font-weight: 600; }
.table .actions { white-space: nowrap; display: flex; gap: 6px; }

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 13px 22px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 14px 30px rgba(19, 28, 46, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Redirect page */
.redirect {
  min-height: 100vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
}
.redirect__card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  max-width: 480px;
}
.spinner {
  width: 42px; height: 42px;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- PDF tools ---------- */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 26px;
}
.pill {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.pill:hover { box-shadow: var(--shadow-sm); }
.pill.is-active { background: var(--bg); border-color: var(--bg); color: #fff; box-shadow: 0 8px 18px rgba(13, 18, 32, 0.25); }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}
.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.tool-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: rgba(16, 194, 107, 0.4); }
.tool-card h4 { margin: 4px 0 0; font-size: 16px; color: var(--text); }
.tool-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

.tool-card__icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 8px 18px rgba(19, 28, 46, 0.18);
}
.tc--red    { background: #e5322d; }
.tc--orange { background: #f0642e; }
.tc--green  { background: #3bb56b; }
.tc--blue   { background: #4d8af0; }
.tc--purple { background: #9b59b6; }
.tc--teal   { background: #17a2a6; }
.tc--yellow { background: #e8b114; }

.back-btn {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
}
.back-btn:hover { text-decoration: underline; }

.tool-panel { display: none; }
.tool-panel.is-visible { display: block; }
.tool-panel__title { margin: 0 0 6px; font-size: 17px; }
.tool-panel > .hint { font-size: 13px; color: var(--muted); margin: 0 0 18px; }

.subsection {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.subsection h4 { margin: 0 0 12px; font-size: 14px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 13px;
  color: var(--muted);
}
input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--panel-2);
  font-family: inherit;
}
input[type="number"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(14,138,75,0.15);
  background: #fff;
}
textarea { resize: vertical; line-height: 1.6; }

.file-list { list-style: none; margin: 0 0 16px; padding: 0; }
.file-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 13px;
  margin-bottom: 6px;
}
.file-list__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list__controls { display: flex; gap: 4px; }
.mini-btn {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 8px;
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.mini-btn:hover:not(:disabled) { background: #eef2f7; }
.mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.check-row { display: flex; gap: 18px; flex-wrap: wrap; }
.check {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 400; cursor: pointer;
}

.progress {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  position: relative;
  overflow: hidden;
}
.progress.is-visible { display: flex; }
.progress__bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--primary-soft);
  width: 0%;
  transition: width 0.2s;
}
.progress__text { position: relative; font-size: 13px; color: var(--text); }

/* ---------- Portal apps (leave / docs / staff) ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

input[type="date"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--panel-2);
  font-family: inherit;
}
input[type="date"]:focus {
  outline: none;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(14,138,75,0.15);
  background: #fff;
}

.chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.chip {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip b { color: var(--text); font-size: 15px; }
.chip--ok b { color: var(--primary); }
.chip--bad b { color: var(--danger); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge--pending { background: #fff4d6; color: #9a6b00; }
.badge--approved { background: var(--primary-soft); color: var(--primary); }
.badge--rejected { background: #fdecea; color: var(--danger); }

/* QR generator */
.qr-form { display: none; }
.qr-form.is-visible { display: block; }
.qr-result {
  display: none;
  margin-top: 22px;
  text-align: center;
}
.qr-result.is-visible { display: block; }
.qr-result canvas {
  max-width: min(320px, 100%);
  height: auto !important;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

/* Image crop */
.crop-stage {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel-2);
}
.crop-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

/* ---------- Dark theme ---------- */
html[data-theme="dark"] {
  --panel: #161d31;
  --panel-2: #0f1526;
  --border: #242e4b;
  --text: #e8edf7;
  --muted: #8b96b3;
  --primary-soft: rgba(16, 194, 107, 0.14);
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"], html[data-theme="dark"] body {
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(16, 194, 107, 0.10), transparent 60%),
    radial-gradient(700px 420px at -10% 25%, rgba(79, 124, 255, 0.08), transparent 60%),
    #0a0f1d;
  background-attachment: fixed;
}

html[data-theme="dark"] .topbar { background: rgba(13, 18, 32, 0.72); }
html[data-theme="dark"] input[type="text"]:focus,
html[data-theme="dark"] input[type="url"]:focus,
html[data-theme="dark"] input[type="password"]:focus,
html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] input[type="date"]:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus { background: var(--panel); }
html[data-theme="dark"] .btn--ghost:hover { background: #1c2544; }
html[data-theme="dark"] .mini-btn:hover:not(:disabled) { background: #1c2544; }
html[data-theme="dark"] .alert--error { background: rgba(229, 72, 77, 0.15); }
html[data-theme="dark"] .btn--danger { background: rgba(229, 72, 77, 0.15); }
html[data-theme="dark"] .btn--danger:hover { background: rgba(229, 72, 77, 0.25); }
html[data-theme="dark"] .badge--pending { background: rgba(240, 177, 20, 0.16); color: #eec35a; }
html[data-theme="dark"] .badge--rejected { background: rgba(229, 72, 77, 0.16); color: #f08a8d; }
html[data-theme="dark"] .result { border-color: rgba(16, 194, 107, 0.35); }
html[data-theme="dark"] .pill.is-active { background: var(--grad); border-color: transparent; }
html[data-theme="dark"] .toast { background: #e8edf7; color: #131c2e; }

/* ---------- Advanced QR generator ---------- */
.section-title {
  margin: 22px 0 12px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
.hint-inline { font-weight: 400; font-size: 12px; color: var(--muted); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(19, 28, 46, 0.15);
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
}
.swatch:hover { transform: scale(1.1); }
.swatch.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 163, 90, 0.25);
  transform: scale(1.08);
}
.swatch--transparent {
  background:
    linear-gradient(45deg, #d4d9e4 25%, transparent 25%, transparent 75%, #d4d9e4 75%),
    linear-gradient(45deg, #d4d9e4 25%, #fff 25%, #fff 75%, #d4d9e4 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
}
.swatch--custom {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  background: conic-gradient(#e5322d, #e8b114, #3bb56b, #4d8af0, #9b59b6, #e5322d);
}
.swatch--custom input[type="color"] {
  width: 160%; height: 160%;
  border: none; padding: 0;
  opacity: 0;
  cursor: pointer;
}

.logo-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.logo-preview {
  width: 64px; height: 64px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  object-fit: contain;
  padding: 6px;
  display: none;
  flex-shrink: 0;
}
.logo-preview.is-visible { display: block; }
.logo-controls { flex: 1; min-width: 0; }
.logo-controls input[type="file"] { margin-bottom: 12px; }

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 8px;
}
.check-label input[type="checkbox"] { accent-color: var(--primary); }
.btn--sm { padding: 7px 14px; font-size: 13px; }

html[data-theme="dark"] .swatch { box-shadow: inset 0 0 0 1px rgba(232, 237, 247, 0.2); }
html[data-theme="dark"] .swatch.is-active { box-shadow: 0 0 0 3px rgba(16, 194, 107, 0.3); }

/* ---------- IT Toolbox ---------- */
.kb {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 16px;
  outline: none;
  user-select: none;
}
.kb-row { display: flex; gap: 6px; }
.kb-key {
  flex: 1;
  min-width: 0;
  padding: 10px 2px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  transition: background 0.08s, color 0.08s, transform 0.08s;
}
.kb-key.is-seen { border-color: var(--primary); color: var(--primary); }
.kb-key.is-down {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
  transform: scale(0.94);
}

.mouse-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.mouse-btn {
  flex: 1;
  min-width: 80px;
  padding: 16px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: background 0.08s, color 0.08s;
}
.mouse-btn.is-seen { border-color: var(--primary); color: var(--primary); }
.mouse-btn.is-down { background: var(--grad); color: #fff; border-color: transparent; }
.mouse-area {
  display: grid;
  place-items: center;
  height: 160px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
  cursor: crosshair;
  user-select: none;
  background: var(--panel-2);
}

.meter {
  height: 14px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}
.meter__bar {
  height: 100%;
  width: 0%;
  background: var(--grad);
  border-radius: 999px;
  transition: width 0.08s linear;
}

.screen-test {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  cursor: pointer;
}

.wf-cat {
  margin: 22px 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}
.wf-cmd {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--panel);
}
.wf-cmd__head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.wf-cmd__desc { margin: 6px 0 10px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.wf-admin {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff4d6;
  color: #9a6b00;
}
.cmd-box {
  margin: 0;
  padding: 10px 12px;
  background: var(--bg);
  color: #a8f0c6;
  border-radius: 8px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
html[data-theme="dark"] .wf-admin { background: rgba(240, 177, 20, 0.16); color: #eec35a; }

html[data-theme="dark"] .kb-key { background: var(--panel); }

/* Responsive */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    z-index: 20;
    left: 0; top: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.is-open { transform: translateX(0); }
  .icon-btn { display: grid; place-items: center; }
  .hero { flex-direction: column; align-items: flex-start; }
  .logo-row { flex-direction: column; }
}
