* { box-sizing: border-box; }
body {
  margin: 0; font-family: "Segoe UI", system-ui, sans-serif;
  background: #faf7f0; color: #3a3325;
}
main { max-width: 900px; margin: 0 auto; padding: 16px; }
a { color: #8a6d1a; }
h2 { margin: 12px 0 16px; } h3 { margin: 24px 0 10px; }

.topbar {
  background: #fff; border-bottom: 2px solid #e8a21c;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #7a6520; font-size: 17px; }
.brand img { height: 36px; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.topbar nav a { text-decoration: none; color: #5f5433; padding: 4px 2px; }
.topbar nav a.btn-new { background: #e8a21c; color: #fff; border-radius: 6px; padding: 6px 12px; }
.topbar nav a.nav-profile {
  font-family: Georgia, 'Times New Roman', serif; font-style: italic;
  color: #fff; background: #8a9a46; border-radius: 999px; padding: 5px 14px;
}
.topbar nav a.nav-profile:hover { background: #77863b; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash-ok { background: #eef4dc; color: #3b5a12; border: 1px solid #97c459; }
.flash-error { background: #fcebeb; color: #791f1f; border: 1px solid #f09595; }

.card { background: #fff; border: 1px solid #e6dfc8; border-radius: 12px; padding: 16px; margin-bottom: 16px; }

.login-wrap { max-width: 380px; margin: 6vh auto 0; text-align: center; }
.login-logo { height: 110px; margin-bottom: 8px; }
.login-logo-wide { height: auto; width: 100%; max-width: 340px; }
.login-brand h1 { margin: 4px 0 0; color: #7a6520; letter-spacing: 3px; }
.tagline { margin: 2px 0 0; color: #8a9a46; font-style: italic; font-size: 17px; }
.subtitle { color: #a2946b; font-size: 13px; margin-top: 6px; }
.login-card { text-align: left; margin-top: 20px; }

label { display: block; font-size: 14px; color: #6b5f3d; margin-bottom: 12px; }
input, select, textarea {
  width: 100%; padding: 10px; margin-top: 4px; font-size: 16px;
  border: 1px solid #d6cdb0; border-radius: 8px; background: #fffdf8;
}
small { color: #a2946b; display: block; margin-top: 4px; }
button {
  background: #e8a21c; color: #fff; font-size: 16px; border: 0;
  border-radius: 8px; padding: 10px 20px; cursor: pointer;
}
button:hover { background: #d3920f; }
.btn-good { background: #639922; } .btn-good:hover { background: #527e1c; }
.btn-plain { background: #fff; color: #6b5f3d; border: 1px solid #d6cdb0; }
.btn-plain:hover { background: #f4efe0; }
.btn-small { font-size: 13px; padding: 5px 10px; }
.btn-danger { background: #fff; color: #a32d2d; border: 1px solid #f09595; }
.btn-danger:hover { background: #fcebeb; }

.stats { display: flex; flex-wrap: wrap; gap: 10px; }
.stat {
  flex: 1 1 100px; background: #fff; border: 1px solid #e6dfc8;
  border-radius: 12px; padding: 12px; text-align: center; font-size: 13px; color: #6b5f3d;
}
.stat .num { display: block; font-size: 26px; font-weight: 600; color: #7a6520; }
.stat-bad { border-color: #f09595; } .stat-bad .num { color: #a32d2d; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fff; border: 1px solid #e6dfc8; border-radius: 999px; padding: 5px 12px; font-size: 14px; }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  background: #fff; border: 1px solid #e6dfc8; border-radius: 10px;
  padding: 10px 14px; text-decoration: none; color: inherit;
}
.task-row:hover { border-color: #e8a21c; }
.task-row.overdue { border-left: 4px solid #e24b4a; }
.task-title { font-weight: 600; }
.task-num { color: #b8860b; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn-link { text-decoration: none; display: inline-block; padding: 6px 12px; border: 1px solid #d6cdb0; border-radius: 8px; color: #6b5f3d; background: #fff; }
.btn-link:hover { background: #f4efe0; }
.task-meta { font-size: 13px; color: #a2946b; flex-basis: 100%; }

.badge { font-size: 12px; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.badge-assigned { background: #faeeda; color: #854f0b; }
.badge-in_progress { background: #e6f1fb; color: #185fa5; }
.badge-done { background: #eaf3de; color: #3b6d11; }
.badge-verified { background: #f1efe8; color: #5f5e5a; }

.prio-high, .prio-urgent { color: #a32d2d; font-weight: 600; font-style: normal; }
.prio-low { color: #888780; font-style: normal; }
.prio-normal { font-style: normal; }
.overdue-text { color: #a32d2d; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { text-decoration: none; color: #6b5f3d; padding: 6px 14px; border-radius: 999px; border: 1px solid #d6cdb0; background: #fff; }
.tabs a.active { background: #e8a21c; color: #fff; border-color: #e8a21c; }

.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e6dfc8; border-radius: 12px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #f0ead6; font-size: 14px; }
.table th { background: #f7f2e3; color: #6b5f3d; }
.table tr.inactive td { color: #b6ac8f; }
.row-actions form { display: flex; gap: 6px; flex-wrap: wrap; }
.dept-form { display: flex; gap: 6px; align-items: center; }
.dept-form select { width: auto; margin-top: 0; padding: 5px 8px; font-size: 13px; }
.linked { color: #3b6d11; }

.task-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.task-head h2 { margin: 8px 0; }
.task-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 0; }
.task-facts dt { font-size: 12px; color: #a2946b; } .task-facts dd { margin: 2px 0 0; }
.task-desc { border-top: 1px solid #f0ead6; margin-top: 14px; padding-top: 12px; white-space: pre-wrap; }

.action-card input { margin-bottom: 10px; }
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.timeline { list-style: none; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid #f0ead6; font-size: 14px; }
.timeline .when { color: #a2946b; font-size: 12px; margin-right: 8px; }

.form-grid button { justify-self: start; }
.form-inline { display: flex; gap: 10px; align-items: center; }
.form-inline input { margin-top: 0; }
.form-inline button { white-space: nowrap; }
.hint { background: #fdf6e3; border: 1px solid #f0dfae; border-radius: 8px; padding: 10px 14px; font-size: 14px; }
.mic { background: #fff; border: 1px solid #d6cdb0; border-radius: 999px; padding: 3px 10px; font-size: 15px; cursor: pointer; margin-left: 6px; }
.mic.listening { background: #e24b4a; border-color: #e24b4a; }
.voice-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.voice-bar label { margin-bottom: 0; }
.voice-bar select { width: auto; }
.voice-bar .hint { flex: 1 1 240px; margin: 0; }
.empty { color: #a2946b; }

@media (max-width: 600px) {
  .topbar { padding: 10px 12px; }
  .brand span { font-size: 15px; }
  .task-meta { flex-basis: 100%; }
}
