:root {
  --bg: #f5f6fb;
  --panel: #ffffff;
  --ink: #1b1b25;
  --muted: #6b7280;
  --line: #e6e7ef;
  --brand: #0f766e;
  --brand-dark: #0b5c55;
  --brand-soft: #e6f4f1;
  --wishlist: #8b8fa3;
  --applied: #3b82f6;
  --interview: #f59e0b;
  --offer: #10b981;
  --rejected: #ef4444;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 16px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0; color: var(--muted); }
small { display: block; color: var(--muted); margin-top: 3px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.struck { text-decoration: line-through; opacity: .55; }

/* Layout ------------------------------------------------------------------ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  background: #14131c;
  color: #cfcde0;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 40px; width: auto; display: block; background: #ffffff; padding: 6px 10px; border-radius: 10px; }
.logo { color: #2dd4bf; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #cfcde0;
  font-weight: 500;
}
.nav a:hover { background: #221f31; text-decoration: none; color: #fff; }
.nav a.active { background: var(--brand); color: #fff; }
.nav .ico { width: 18px; text-align: center; opacity: .9; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-weight: 600; flex: 1; }
.menu { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--ink); }
.content { padding: 28px; max-width: 1240px; width: 100%; }

/* Buttons ----------------------------------------------------------------- */
.button, button {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 9px;
  padding: 10px 15px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-block;
}
.button:hover, button:hover { background: var(--brand-dark); text-decoration: none; }
.button.block { text-align: center; }
.button.ghost { background: var(--brand-soft); color: var(--brand); }
.button.ghost:hover { background: #d3ece7; }
.button.large { padding: 13px 24px; }
.danger { background: var(--rejected); }
.danger:hover { background: #d13b3b; }
.subtle { padding: 6px 10px; font-size: 13px; }

/* Page head --------------------------------------------------------------- */
.pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.back { display: inline-block; margin-bottom: 10px; font-size: 14px; }
.search { display: flex; gap: 8px; }
.search input { width: 260px; }

/* Panels & stats ---------------------------------------------------------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat span { font-size: 13px; color: var(--muted); }
.stat strong { display: block; font-size: 30px; margin-top: 8px; color: var(--brand-dark); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Meters ------------------------------------------------------------------ */
.meter { margin-bottom: 14px; }
.meter-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.meter-track { height: 9px; background: #eef0f6; border-radius: 20px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--brand); border-radius: 20px; transition: width .3s; }
.meter-fill.stage-wishlist { background: var(--wishlist); }
.meter-fill.stage-applied { background: var(--applied); }
.meter-fill.stage-interview { background: var(--interview); }
.meter-fill.stage-offer { background: var(--offer); }
.meter-fill.stage-rejected { background: var(--rejected); }

/* Chart ------------------------------------------------------------------- */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 8px; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, #2dd4bf, var(--brand)); border-radius: 8px 8px 0 0; min-height: 3px; }
.bar-label { font-size: 11px; color: var(--muted); }

/* Rows & tags ------------------------------------------------------------- */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-of-type { border-bottom: 0; }
.row b { font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { background: var(--brand-soft); color: var(--brand-dark); padding: 7px 12px; border-radius: 30px; font-size: 13px; }
.tag b { margin-left: 4px; }
.chip { background: #eef0f6; color: #4b5563; padding: 5px 10px; border-radius: 30px; font-size: 12px; white-space: nowrap; }
.chip.overdue { background: #fde8e8; color: #b42318; }
.chip.status-active { background: #e7f6ec; color: #1f6b3a; }
.chip.status-idle { background: #fef3e2; color: #9a5b00; }
.chip.status-inactive { background: #fde8e8; color: #b42318; }
.chip.status-never { background: #eef0f6; color: #4b5563; }

/* Kanban board ------------------------------------------------------------ */
.board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.column {
  flex: 0 0 288px;
  background: #eceef5;
  border-radius: var(--radius);
  padding: 12px;
  min-height: 140px;
}
.column.over { outline: 2px dashed var(--brand); outline-offset: -3px; background: #dff3ee; }
.colhead { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.colhead h2 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.colhead .count { margin-left: auto; background: #fff; color: var(--muted); border-radius: 20px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--wishlist); }
.dot-applied { background: var(--applied); }
.dot-interview { background: var(--interview); }
.dot-offer { background: var(--offer); }
.dot-rejected { background: var(--rejected); }
.cards { display: flex; flex-direction: column; gap: 10px; min-height: 30px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px;
  box-shadow: var(--shadow);
  cursor: grab;
}
.card:active { cursor: grabbing; }
.card.dragging { opacity: .45; }
.card-title { font-weight: 600; color: var(--ink); display: block; }
.card-company { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; font-size: 12px; color: var(--muted); }
.card-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.card-foot .muted { font-size: 12px; }

/* Forms ------------------------------------------------------------------- */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span-2 { grid-column: 1 / -1; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
label input, label select, label textarea { display: block; margin-top: 7px; font-weight: 400; }
label small { font-weight: 400; }
input, select, textarea {
  width: 100%;
  border: 1px solid #d9dbe6;
  border-radius: 9px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #a7ddd2; border-color: var(--brand); }
textarea { resize: vertical; }
.formpanel { max-width: 940px; }
.formpanel h2 { margin-top: 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.inline-form input { flex: 1; min-width: 130px; width: auto; }
.inline-form button { flex: 0 0 auto; }

.check { margin: 0; }
.checkbox {
  width: 26px; height: 26px; padding: 0;
  border-radius: 7px;
  background: #fff;
  border: 2px solid #cfd2e0;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}
.checkbox.done { background: var(--offer); border-color: var(--offer); }

/* Tables ------------------------------------------------------------------ */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td small { margin-top: 4px; }
.empty { text-align: center; padding: 40px; color: var(--muted); }

/* Notices ----------------------------------------------------------------- */
.notice { padding: 12px 15px; border-radius: 10px; background: #e7f6ec; color: #1f6b3a; margin-bottom: 18px; }
.notice.error { background: #fde8e8; color: #b42318; }

/* Login ------------------------------------------------------------------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: #f2faf7;
  background-image: linear-gradient(rgba(255, 255, 255, .72), rgba(255, 255, 255, .85)),
                    url("login-bg.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.login-card { width: 100%; max-width: 380px; margin: 0; }
.login-card h1 { font-size: 22px; margin-bottom: 6px; }
.login-card p { margin-bottom: 18px; }
.login-card label { margin-bottom: 18px; }
.auth-logo { position: fixed; top: 26px; left: 32px; height: 68px; width: auto; }
@media (max-width: 520px) { .auth-logo { height: 46px; top: 16px; left: 16px; } }

/* Cookie banner ----------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 18px;
  background: #14131c;
  color: #e8e6f2;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { color: #cfcde0; margin: 0; font-size: 14px; }
@media (max-width: 520px) {
  .cookie-banner { flex-direction: column; align-items: flex-start; }
}

/* Legal pages ------------------------------------------------------------- */
.legal-wrap { max-width: 820px; margin: 0 auto; padding: 40px 24px; }
.legal-logo { height: 48px; width: auto; display: block; margin-bottom: 20px; }
.legal h1 { font-size: 26px; margin-bottom: 4px; }
.legal h2 { font-size: 17px; margin: 24px 0 8px; }
.legal p, .legal li { color: #4b5563; line-height: 1.65; }
.legal ul { padding-left: 20px; margin: 8px 0; }
.legal li { margin-bottom: 6px; }
.privacy-link { color: #8b87a3; font-size: 13px; text-align: center; display: block; margin-top: 4px; }
.privacy-link:hover { color: #cfcde0; }
.login-alt { text-align: center; margin-top: 16px; font-size: 14px; }
.who { color: var(--muted); font-size: 14px; padding: 0 8px; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .menu { display: block; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .search input { width: 100%; }
}
@media (max-width: 520px) {
  .content { padding: 18px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .search { width: 100%; }
}
