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

/* ─── Design Tokens ─── */
:root {
  --cyan: #06B6D4;
  --teal: #2DD4BF;
  --bright: #00D1FF;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --gradient: linear-gradient(135deg, var(--cyan), var(--teal));
}

body.dark {
  --bg: #0F172A;
  --surface: #1E293B;
  --surface2: #334155;
  --border: #475569;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --input-bg: #0F172A;
}
body.light {
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --surface2: #F8FAFC;
  --border: #CBD5E1;
  --text: #0F172A;
  --muted: #64748B;
  --input-bg: #F8FAFC;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  transition: background .3s, color .3s;
}

/* ─── Header ─── */
.header-accent { height: 3px; background: var(--gradient); }
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-logo {
  width: 36px; height: 36px;
  background: var(--gradient);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 16px;
}
.header-title { font-size: 15px; font-weight: 700; }
.header-sub { font-size: 12px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gradient); color: white; }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(6,182,212,.35); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); color: white; }
.btn-success:hover { box-shadow: 0 4px 16px rgba(16,185,129,.35); }
.btn-ghost {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); padding: 6px 12px;
}
.btn-ghost:hover { background: var(--surface2); }
.btn-office {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--cyan); padding: 7px 14px;
}
.btn-office:hover { background: var(--cyan); color: white; border-color: var(--cyan); }

/* ─── Status Badge ─── */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
}
.status-online { background: rgba(16,185,129,.15); color: var(--green); }
.status-offline { background: rgba(239,68,68,.15); color: var(--red); }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ─── Main Content ─── */
.main { max-width: 1200px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 24px; }

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: background .3s, border-color .3s;
}
.section-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}

/* ─── Inputs ─── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.form-label .req { color: var(--red); }
.form-input {
  width: 100%; border-radius: 8px;
  padding: 10px 14px; font-size: 14px;
  border: 1px solid var(--border);
  background: var(--input-bg); color: var(--text);
  font-family: inherit; outline: none;
  transition: border-color .2s;
}
.form-input:focus { border-color: var(--cyan); }
textarea.form-input { resize: vertical; min-height: 120px; line-height: 1.6; }
.form-actions { display: flex; gap: 10px; padding-top: 4px; }

/* ─── Kanban Board ─── */
.kanban-wrapper { overflow-x: auto; padding-bottom: 8px; }
.kanban-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(150px, 1fr));
  gap: 12px;
  min-width: 900px;
}
.kanban-col {
  background: var(--surface2);
  border-radius: 10px;
  padding: 0;
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  overflow: hidden;
}
.kanban-col-header {
  padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.kanban-col-header .col-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kanban-col-header .col-icon svg { width: 15px; height: 15px; }
.kanban-col-header .col-count {
  font-size: 10px; font-weight: 600; padding: 1px 6px;
  border-radius: 99px; background: var(--surface2);
  color: var(--muted); margin-left: auto;
}
.kanban-col-body { padding: 8px; flex: 1; }

/* ─── Kanban Card ─── */
.k-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color .2s, transform .15s;
  cursor: default;
}
.k-card:hover { border-color: var(--cyan); transform: translateY(-1px); }
.k-card-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.k-card-desc { font-size: 11px; color: var(--muted); line-height: 1.4; margin-bottom: 8px; }
.k-card-footer { display: flex; align-items: center; justify-content: space-between; }
.k-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 4px;
}
.k-badge-done { background: rgba(16,185,129,.15); color: var(--green); }
.k-badge-active { background: rgba(245,158,11,.15); color: var(--amber); }
.k-badge-wait { background: var(--surface2); color: var(--muted); }
.k-progress {
  height: 3px; border-radius: 99px;
  background: var(--surface2); margin-top: 8px; overflow: hidden;
}
.k-progress-fill {
  height: 100%; border-radius: 99px;
  background: var(--gradient);
  transition: width .8s cubic-bezier(.4,0,.2,1);
}

/* ─── Output Tabs ─── */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tab-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); border-radius: 7px;
  padding: 6px 12px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s;
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
}
.tab-btn svg { width: 14px; height: 14px; }
.tab-btn:hover { color: var(--text); background: var(--surface); }
.tab-btn.active { background: var(--cyan); border-color: var(--cyan); color: white; }
.output-panel { display: none; }
.output-panel.active { display: block; }
.output-body {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
  font-size: 13px; line-height: 1.7;
  white-space: pre-wrap;
  max-height: 280px; overflow-y: auto;
}
.output-body::-webkit-scrollbar { width: 4px; }
.output-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

/* ─── Toast ─── */
#toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  transform: translateY(80px); opacity: 0;
  transition: all .35s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.success { background: var(--green); color: white; box-shadow: 0 6px 20px rgba(16,185,129,.4); }
#toast.error { background: var(--red); color: white; box-shadow: 0 6px 20px rgba(239,68,68,.4); }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Footer ─── */
.footer {
  text-align: center; font-size: 11px; color: var(--muted);
  padding: 16px; border-top: 1px solid var(--border);
}

/* ─── Skeleton ─── */
.skeleton {
  background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 50%, var(--surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite; border-radius: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
