/* talQen Weekly Command Deck — deep navy + teal, compact CEO dashboard */
:root {
  --navy-900: #071a30;
  --navy-800: #0a2540;
  --navy-700: #0d3155;
  --navy-100: #e8eef5;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-100: #ccf2ee;
  --ink: #16283b;
  --muted: #5b6b7d;
  --line: #d9e2ec;
  --bg: #f4f7fa;
  --card: #ffffff;
  --red: #c0392b;
  --amber: #b7791f;
  --green: #1e7e34;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 14px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 21px; margin: 0 0 4px; color: var(--navy-800); }
h2 { font-size: 16px; margin: 22px 0 8px; color: var(--navy-800); }
h3 { font-size: 14px; margin: 14px 0 6px; color: var(--navy-700); }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: 208px; flex: none; background: var(--navy-800); color: #cfe0ef; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 18px 16px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { background: var(--teal-500); color: var(--navy-900); font-weight: 800; border-radius: 8px; padding: 4px 8px; font-size: 15px; }
.brand-chip { background: #fff; border-radius: 8px; padding: 4px 8px; display: inline-flex; align-items: center; }
.brand-chip img { height: 20px; width: auto; display: block; }
.login-logo { display: block; margin: 0 auto 12px; height: 44px; width: auto; }
.brand-name { font-weight: 600; color: #fff; letter-spacing: .2px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 1.5px; color: #8fa8bd; }
.sidebar nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; }
.sidebar nav a { color: #b8cde0; padding: 8px 12px; border-radius: 7px; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--teal-600); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.mini-label { text-transform: uppercase; letter-spacing: .6px; font-size: 10px; color: #7f97ac; }
.mini-value { color: #fff; margin: 2px 0 10px; }
.logout { color: #7f97ac; }
.main { flex: 1; min-width: 0; padding: 22px 26px 80px; max-width: 1240px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .sub { color: var(--muted); font-size: 13px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

.btn { display: inline-block; background: var(--navy-800); color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-weight: 600; font-size: 13px; cursor: pointer; }
.btn:hover { background: var(--navy-700); text-decoration: none; color: #fff; }
.btn-teal { background: var(--teal-600); }
.btn-teal:hover { background: var(--teal-500); }
.btn-ghost { background: transparent; color: var(--navy-800); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--navy-100); color: var(--navy-800); }
.btn-danger { background: var(--red); }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.stat { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--teal-500); box-shadow: 0 2px 8px rgba(13,148,136,.18); }
.stat .num { font-size: 24px; font-weight: 700; color: var(--navy-800); }
.stat .lbl { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat.alert .num { color: var(--red); }
.stat.warn .num { color: var(--amber); }
.stat.good .num { color: var(--teal-600); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.panel-title { font-weight: 700; color: var(--navy-800); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 13px; }
.tbl th { background: var(--navy-800); color: #dce8f2; text-align: left; padding: 7px 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.tbl td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: #f0f6f9; }
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }

.chip { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.chip-NOT_STARTED { background: #e7ecf1; color: #51637a; }
.chip-IN_PROGRESS { background: #d8ecfb; color: #135d96; }
.chip-WAITING { background: #f4ebd4; color: #8a6d1a; }
.chip-BLOCKED, .chip-OPEN, .chip-AWAITING_DECISION, .chip-FAILED { background: #fadbd5; color: #a63325; }
.chip-COMPLETED, .chip-RESOLVED, .chip-SENT, .chip-CONFIRMED { background: #d6f0e2; color: #196c3d; }
.chip-CANCELLED, .chip-CLOSED, .chip-POSTPONED { background: #e3e3e3; color: #666; }
.chip-PLANNED { background: #ddeafa; color: #2b5d92; }
.chip-LOW { background: #e7ecf1; color: #51637a; }
.chip-MEDIUM { background: #ddeafa; color: #2b5d92; }
.chip-HIGH { background: #f4e3cd; color: #935710; }
.chip-CRITICAL { background: #f6cfc9; color: #9c2413; }
.chip-carried { background: #efe0f7; color: #6b2f91; }
.chip-overdue { background: var(--red); color: #fff; }
.chip-needsdate { background: #fff3cd; color: #7a5b00; border: 1px dashed #c7a500; }

.progress { background: #e6ecf2; border-radius: 6px; height: 8px; min-width: 60px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--teal-500); }

form.stack p { margin: 0 0 12px; }
form.stack label { display: block; font-weight: 600; font-size: 12.5px; color: var(--navy-700); margin-bottom: 3px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: #fff; color: var(--ink);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal-500); outline-offset: 0; border-color: var(--teal-500); }
.helptext { color: var(--muted); font-size: 12px; display: block; margin-top: 2px; }
.errorlist { color: var(--red); margin: 2px 0 0; padding-left: 16px; font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 800px) { .form-grid { grid-template-columns: 1fr; } }
.form-grid p.full { grid-column: 1 / -1; }
.checkbox-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 7px; padding: 8px; }
.checkbox-list div { display: flex; gap: 6px; align-items: center; }
.checkbox-list input, form.stack input[type=checkbox] { width: auto; }
form.stack li { list-style: none; }
form.stack ul { padding: 0; margin: 0; }

.messages { margin-bottom: 14px; }
.msg { padding: 9px 14px; border-radius: 8px; margin-bottom: 6px; font-weight: 500; }
.msg-success { background: #d6f0e2; color: #196c3d; }
.msg-error { background: #fadbd5; color: #a63325; }
.msg-warning { background: #fdf2d0; color: #7a5b00; }
.msg-info { background: #ddeafa; color: #2b5d92; }

.warn-box { background: #fdf6e3; border: 1px solid #e7cf8c; border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
.warn-box ul { margin: 4px 0 0; padding-left: 18px; }
.suggest-box { background: #eaf7f5; border: 1px solid #9fd8d0; border-radius: 8px; padding: 10px 14px; margin: 10px 0; }

.timeline { border-left: 2px solid var(--teal-500); margin: 8px 0 0 6px; padding-left: 16px; }
.timeline .entry { margin-bottom: 14px; position: relative; }
.timeline .entry::before { content: ""; position: absolute; left: -22px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal-500); }
.timeline .meta { font-size: 12px; color: var(--muted); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.filters select, .filters input { width: auto; min-width: 140px; }

.kv { display: grid; grid-template-columns: 180px 1fr; gap: 4px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(150deg, var(--navy-900), var(--navy-700)); }
.login-card { background: #fff; border-radius: 14px; padding: 34px 36px; width: 360px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.login-card h1 { margin-bottom: 2px; }
.login-card .sub { color: var(--muted); margin-bottom: 18px; font-size: 13px; }

.mobile-bar { display: none; }
.mobile-topbar { display: none; }
.nav-backdrop { display: none; }
@media (max-width: 860px) {
  .mobile-topbar { display: flex; align-items: center; gap: 10px; background: var(--navy-800); padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); position: sticky; top: 0; z-index: 50; }
  .nav-toggle { background: none; border: none; color: #fff; font-size: 22px; padding: 2px 6px; cursor: pointer; line-height: 1; }
  .topbar-title { color: #8fa8bd; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; }
  .mobile-topbar .brand-chip img { height: 16px; }
  /* Sidebar becomes an off-canvas slide-out panel */
  .sidebar { position: fixed; top: 0; bottom: 0; left: -250px; width: 240px; height: 100vh; z-index: 70; transition: left .22s ease; box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .sidebar.open { left: 0; }
  .sidebar nav { flex-direction: column; }
  .nav-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(7,26,48,.5); z-index: 60; }
  .main { padding: 14px 14px 90px; }
  .mobile-bar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy-800); justify-content: space-around; padding: 10px 6px calc(10px + env(safe-area-inset-bottom)); z-index: 40; }
  .mobile-bar a { color: #fff; font-weight: 700; font-size: 13px; }
  .kv { grid-template-columns: 1fr; }
}
/* Weekly review dot grid */
.week-dots { display: flex; flex-wrap: wrap; gap: 10px 14px; padding: 4px 0; }
.wdot-btn { background: none; border: none; padding: 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wdot { display: inline-block; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0,0,0,.18); }
.dot-legend .wdot { width: 11px; height: 11px; vertical-align: -1px; margin: 0 3px 0 10px; }
.wdot-green { background: #27ae60; }
.wdot-orange { background: #e67e22; }
.wdot-red { background: #c0392b; }
.wdot-grey { background: #c3ccd6; }
.wdot-active { outline: 2px solid var(--teal-500); outline-offset: 2px; }
.wdot-btn:hover .wdot { transform: scale(1.18); }
.wdot-lbl { font-size: 10px; color: var(--muted); }
.dot-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.dot-modal[hidden] { display: none; }
.dot-modal-backdrop { position: absolute; inset: 0; background: rgba(7, 26, 48, .55); }
.dot-modal-card { position: relative; background: #fff; border-radius: 12px; padding: 18px 20px; width: min(560px, 92vw); max-height: 86vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dot-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dot-modal-head .wdot { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.dot-modal-x { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }

.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mt0 { margin-top: 0; }
.inline-form { display: inline; }
