/* Dasos ("forest" in Greek) - forest green brand. */
:root {
  --brand: #1E5631;
  --brand-dark: #143D22;
  --accent: #4C9A2A;
  --muted: #5B6B60;
  --text: #1F2421;
  --border: #D6DED8;
  --soft: #EEF4EF;
  --page: #F6F8F6;
  --danger: #A12622;
  --radius: 6px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--page); }
[hidden] { display: none !important; }
a { color: var(--brand); }
h1, h2, h3 { color: var(--brand-dark); margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 16px; margin-bottom: 8px; }
.subtitle { color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---- Buttons & inputs ------------------------------------------------------------------ */
.btn {
  font: inherit; cursor: pointer; border: 1px solid var(--border); background: #fff;
  color: var(--brand); padding: 6px 12px; border-radius: var(--radius); white-space: nowrap;
  text-decoration: none; display: inline-block;
}
.btn:hover { border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.link { border: none; background: none; padding: 4px 6px; text-decoration: underline; }
.btn.small { padding: 3px 8px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; }

input, select, textarea {
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid var(--border); border-radius: 4px; padding: 6px 8px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-weight: 600; font-size: 12px; color: var(--muted); }
label > input, label > select, label > textarea { margin-top: 4px; font-weight: normal; }
.form-error { color: var(--danger); font-size: 13px; margin: 8px 0; }
.hint { font-weight: normal; font-size: 12px; color: var(--muted); margin: 4px 0 0; }

/* ---- Login ----------------------------------------------------------------------------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: 100%; max-width: 360px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 28px; display: grid; gap: 14px;
}
.login-card .subtitle { margin: 0 0 6px; }
.brand-big { font-size: 28px; color: var(--brand); }

/* ---- Top bar --------------------------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 20px; background: var(--brand); color: #fff;
  padding: 0 20px; position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.brand { color: #fff; font-weight: bold; font-size: 18px; text-decoration: none; padding: 12px 0; }
.tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.tabs a {
  color: #D5E8DA; text-decoration: none; padding: 14px 12px; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.tabs a:hover { color: #fff; }
.tabs a.active { color: #fff; font-weight: 600; border-bottom-color: #A8D88E; }
.user-menu { display: flex; align-items: center; gap: 8px; }
.user-menu a { color: #fff; text-decoration: none; }
.user-menu a.active { text-decoration: underline; }
.user-menu .btn.link { color: #D5E8DA; }

/* ---- Page layout ----------------------------------------------------------------------- */
.view { padding: 20px; max-width: 1300px; margin: 0 auto; outline: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head .toolbar { margin: 0; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.stack { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-size: 13px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; margin: 14px 0 10px; flex-wrap: wrap; }
.toolbar select { width: auto; min-width: 150px; }
.toolbar input[type="search"] { width: 240px; }
.toolbar .count { margin-left: auto; color: var(--muted); font-size: 12px; }
.description { white-space: pre-wrap; margin: 0; line-height: 1.5; }

/* ---- Product cards --------------------------------------------------------------------- */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 16px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.card:hover { border-color: #A9BFAF; }
.card h2 { margin: 0; font-size: 17px; }
.card h2 a { color: var(--brand-dark); text-decoration: none; }
.card h2 a:hover { text-decoration: underline; }
.card .description {
  color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; flex: 1;
}
.card-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- Badges & pills -------------------------------------------------------------------- */
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600;
  white-space: nowrap; border: 1px solid transparent;
}
.badge.web { color: #1F4E79; background: #DCEBF7; }
.badge.ios { color: #333; background: #ECECEC; }
.badge.android { color: #2F6B12; background: #E2F2D8; }
.badge.global { color: #5B2C83; background: #EDE3F6; }
.badge.specific { color: #7A4A00; background: #FCEFD9; }

.status {
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 10px;
  border-radius: 10px; border: 1px solid transparent; white-space: nowrap;
}
.status.pending { color: #7A5B00; background: #FFF3CD; }
.status.done { color: #1E6B34; background: #D4EDDA; }
.status:hover { border-color: currentColor; }
.status:disabled { opacity: .6; cursor: default; }

.prio {
  display: inline-block; min-width: 34px; text-align: center; padding: 2px 6px; border-radius: 4px;
  font-weight: 700; font-size: 12px;
}
.prio.high { color: #fff; background: #B3261E; }
.prio.mid { color: #7A4A00; background: #FCE4C0; }
.prio.low { color: #4A5650; background: #E6EBE7; }

/* Progress bar */
.progress { display: grid; gap: 4px; }
.progress .bar { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.progress .bar > span { display: block; height: 100%; background: var(--accent); }
.progress .label { font-size: 12px; color: var(--muted); }

/* ---- Product detail -------------------------------------------------------------------- */
.product-head h1 { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.stat .value { font-size: 22px; font-weight: 700; color: var(--brand-dark); }
.stat .label { font-size: 12px; color: var(--muted); }
.meta { font-size: 12px; color: var(--muted); }

/* ---- Feature table --------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
table.list { border-collapse: collapse; width: 100%; font-size: 13px; }
table.list th {
  background: var(--soft); color: var(--brand-dark); font-weight: 600; text-align: left;
  padding: 9px 10px; white-space: nowrap; border-bottom: 1px solid var(--border);
}
table.list th button { all: unset; cursor: pointer; }
table.list th button:hover { text-decoration: underline; }
table.list td { padding: 9px 10px; border-bottom: 1px solid #E8EDE9; vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.is-done .feature-name { color: var(--muted); text-decoration: line-through; }
table.list td.actions { white-space: nowrap; text-align: right; }
table.list td.nowrap { white-space: nowrap; }
.feature-name { font-weight: 600; }
.feature-desc { color: var(--muted); margin-top: 3px; white-space: pre-wrap; max-width: 620px; }

/* ---- Dialogs --------------------------------------------------------------------------- */
dialog {
  border: 1px solid var(--border); border-radius: 10px; padding: 0; width: min(640px, 94vw);
  color: var(--text);
}
dialog::backdrop { background: rgba(20, 61, 34, .45); }
dialog form { padding: 20px; display: grid; gap: 14px; }
dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px 10px; margin: 0; }
legend { font-weight: 600; font-size: 12px; color: var(--muted); padding: 0 4px; }
.choices { display: flex; gap: 16px; flex-wrap: wrap; }
.check { display: flex; gap: 6px; align-items: center; font-weight: normal; color: var(--text); font-size: 14px; }
.note { background: var(--soft); border-radius: 6px; padding: 8px 10px; font-size: 12px; color: var(--muted); margin: 0; }

/* ---- Toast ----------------------------------------------------------------------------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: var(--brand-dark); color: #fff; padding: 10px 16px; border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2); max-width: 90vw;
}
.toast.error { background: var(--danger); }
