:root {
  --cream: #ecc8af;
  --salmon: #e7ad99;
  --coral: #ce796b;
  --tan: #c18c5d;
  --slate: #495867;
  --text-dark: #33241a;
  --bg: #f7f3ee;
  --panel: #f2e2dc;
  --surface: #faf6f1;
  --on-slate: #fff;
  --on-coral: #fff;
  --panel-text: #4a3220;
  --panel-label: #8a5a3a;
  --panel-border: #dcb996;
}
* { box-sizing: border-box; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  margin: 0;
  color: var(--text-dark);
}
header {
  background: var(--slate);
  color: var(--on-slate);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header .brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-family: Georgia, 'Times New Roman', serif; }
header .brand img { height: 28px; width: auto; border-radius: 4px; }
header .user { font-size: 12px; color: #d6dbe0; display: flex; align-items: center; gap: 12px; }
header .user button { background: transparent; border: 1px solid #d6dbe0; color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 12px; cursor: pointer; }
main { padding: 20px; max-width: 1100px; margin: 0 auto; }

.auth-wrap { max-width: 380px; margin: 80px auto; background: #fff; border-radius: 12px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.auth-wrap h1 { font-family: Georgia, serif; font-size: 22px; color: var(--slate); margin: 0 0 6px; }
.auth-wrap p.lead { font-size: 13px; color: #999; margin: 0 0 20px; }
.auth-wrap label { font-size: 12px; color: #777; display: block; margin: 12px 0 4px; }
.auth-wrap input {
  width: 100%; padding: 9px 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
.auth-wrap .error { background: var(--salmon); color: #5c2a1e; border-radius: 6px; padding: 10px 12px; font-size: 12px; margin-top: 14px; display: none; }
.auth-wrap .toggle { text-align: center; margin-top: 18px; font-size: 13px; color: #999; }
.auth-wrap .toggle a { color: var(--coral); cursor: pointer; text-decoration: underline; }

button.primary {
  background: var(--coral); color: var(--on-coral); border: none; padding: 10px 18px;
  border-radius: 8px; font-size: 13px; cursor: pointer; width: 100%; margin-top: 18px;
}
button.primary:disabled { opacity: 0.6; cursor: default; }
button.secondary {
  background: transparent; border: 1px solid #ccc; padding: 6px 14px;
  border-radius: 8px; font-size: 12px; cursor: pointer; margin-left: 4px;
}

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.kpi { border-radius: 10px; padding: 14px 16px; }
.kpi .label { font-size: 12px; opacity: 0.75; margin-bottom: 4px; }
.kpi .value { font-size: 24px; font-weight: bold; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
th, td { text-align: left; padding: 10px 12px; font-size: 13px; border-bottom: 1px solid #eee; }
th { background: var(--panel); font-size: 11px; text-transform: uppercase; color: var(--panel-label); }
tr.completed td { color: #aaa; text-decoration: line-through; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11px; font-weight: bold; }
.row-actions i { cursor: pointer; margin-right: 10px; color: #999; font-style: normal; }
.row-actions i:hover { color: var(--coral); }

.modal-overlay {
  display: none; position: fixed; top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.4); align-items: center; justify-content: center; z-index: 10;
}
.modal { background: #fff; border-radius: 12px; padding: 24px; width: 380px; max-width: 90%; }
.modal-view { width: 420px; }
.modal-goal { width: 440px; }
.modal h3 { margin-top: 0; }
.modal label { font-size: 12px; color: #777; display: block; margin: 10px 0 4px; }
.modal input:not([type="checkbox"]), .modal select, .modal textarea {
  width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 13px; font-family: inherit;
}
.modal input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
}
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.loading { text-align: center; padding: 40px; color: #999; font-size: 13px; }
