:root {
  --navy: #0d1b4b;
  --navy-light: #16276b;
  --blue: #1e6ab0;
  --blue-light: #5ba4d4;
  --gold: #c9a84c;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(13, 27, 75, 0.08), 0 4px 12px rgba(13, 27, 75, 0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Raleway', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }
a { color: var(--blue); text-decoration: none; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy) 0%, #1a2f6e 60%, var(--blue) 100%); padding: 20px; }
.login-card { background: #fff; border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-card .logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.login-card .logo img { width: 240px; max-width: 80%; height: auto; }
.login-card h1 { color: var(--navy); font-size: 22px; text-align: center; font-weight: 800; }
.login-card .sub { text-align: center; color: var(--muted); margin: 6px 0 28px; }
.login-card label { display: block; font-weight: 600; margin: 14px 0 6px; color: var(--navy); font-size: 13px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 10px; }
.login-card input:focus { outline: none; border-color: var(--blue); }
.login-card .btn-primary { width: 100%; margin-top: 24px; padding: 13px; font-size: 15px; }
.login-error { background: #fef2f2; color: var(--red); padding: 10px 14px; border-radius: 8px; margin-top: 16px; font-size: 13px; display: none; }
.login-hint { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); line-height: 1.7; }
.quick-login { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.quick-login-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; text-align: center; margin-bottom: 12px; }
.quick-login-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-login-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; background: #f8f9fc; border: 1.5px solid var(--border); border-radius: 10px; transition: border-color .12s, background .12s; }
.quick-login-btn:hover { border-color: var(--blue); background: #eff6ff; }
.quick-login-btn .ql-name { font-weight: 700; font-size: 13px; color: var(--navy); }
.quick-login-btn .ql-sub { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.2; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: var(--navy); color: #fff; position: fixed; top: 0; bottom: 0; left: 0; display: flex; flex-direction: column; z-index: 20; }
.sidebar .brand { display: flex; align-items: center; justify-content: center; padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar .brand img { width: 170px; max-width: 100%; height: auto; }
.sidebar nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 1.2px; color: rgba(255,255,255,.45); margin: 16px 10px 6px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: rgba(255,255,255,.85); margin-bottom: 2px; font-weight: 500; }
.nav-item:hover { background: rgba(255,255,255,.08); }
.nav-item.active { background: var(--blue); color: #fff; font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; }
.sidebar .user-box { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.sidebar .user-box .name { font-weight: 700; }
.sidebar .user-box .role { color: var(--gold); font-size: 11px; margin: 2px 0 8px; }
.sidebar .user-box button { background: none; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: 6px; padding: 5px 12px; font-size: 12px; }
.sidebar .user-box button:hover { background: rgba(255,255,255,.1); }

.main { flex: 1; margin-left: 230px; display: flex; flex-direction: column; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 10; }
.topbar h2 { color: var(--navy); font-size: 19px; font-weight: 800; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.bell { position: relative; background: none; border: 1px solid var(--border); border-radius: 50%; width: 38px; height: 38px; font-size: 16px; }
.bell:hover { background: var(--bg); }
.bell .badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: 10px; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; padding: 0 4px; }
.notif-panel { position: absolute; right: 28px; top: 62px; width: 380px; max-height: 480px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.15); z-index: 50; }
.notif-panel .head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; color: var(--navy); }
.notif-panel .head button { background: none; border: none; color: var(--blue); font-size: 12px; font-weight: 600; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #eff6ff; }
.notif-item .t { font-weight: 600; font-size: 13px; color: var(--navy); }
.notif-item .b { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.notif-item .d { color: #9ca3af; font-size: 11px; margin-top: 4px; }

.content { padding: 26px 28px; max-width: 1280px; width: 100%; }

/* ---------- Components ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card h3 { color: var(--navy); font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat .v { font-size: 26px; font-weight: 800; color: var(--navy); }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 3px; font-weight: 500; }

.btn-primary { background: var(--blue); color: #fff; border: none; border-radius: 9px; padding: 9px 18px; font-weight: 700; font-size: 13px; }
.btn-primary:hover { background: #185a96; }
.btn-secondary { background: #fff; color: var(--navy); border: 1.5px solid var(--border); border-radius: 9px; padding: 8px 16px; font-weight: 600; font-size: 13px; }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: #fff; color: var(--red); border: 1.5px solid #fecaca; border-radius: 9px; padding: 8px 16px; font-weight: 600; font-size: 13px; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-link { background: none; border: none; color: var(--blue); font-weight: 600; font-size: 12.5px; padding: 4px; }
.btn-link.danger { color: var(--red); }

.badge-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.bp-green { background: #dcfce7; color: #15803d; }
.bp-blue { background: #dbeafe; color: #1d4ed8; }
.bp-amber { background: #fef3c7; color: #b45309; }
.bp-red { background: #fee2e2; color: #b91c1c; }
.bp-gray { background: #f3f4f6; color: #4b5563; }
.bp-navy { background: #e0e7ff; color: var(--navy); }
.bp-gold { background: #faf3e0; color: #8a6d1f; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--border); font-weight: 700; }
table.tbl td { padding: 10px; border-bottom: 1px solid #f1f5f9; font-size: 13px; vertical-align: middle; }
table.tbl tr:hover td { background: #fafbff; }
.tbl-actions { white-space: nowrap; text-align: right; }

.progress-track { background: #e8edf5; border-radius: 99px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-light)); border-radius: 99px; transition: width .4s; }
.progress-fill.gold { background: linear-gradient(90deg, var(--gold), #e0c878); }
.progress-fill.green { background: linear-gradient(90deg, #16a34a, #4ade80); }

/* project cards */
.proj-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; cursor: pointer; transition: transform .12s, box-shadow .12s; border-top: 3px solid var(--blue); }
.proj-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(13,27,75,.12); }
.proj-card .pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.proj-card h4 { color: var(--navy); font-size: 15px; font-weight: 700; }
.proj-card .meta { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.proj-card .pc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 12px; color: var(--muted); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab { background: none; border: none; padding: 10px 16px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -2px; font-size: 13.5px; }
.tab:hover { color: var(--navy); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab .cnt { background: var(--bg); border-radius: 99px; padding: 1px 7px; font-size: 11px; margin-left: 5px; }

/* milestones timeline */
.ms-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f1f5f9; }
.ms-item:last-child { border-bottom: none; }
.ms-dot { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; margin-top: 2px; }
.ms-dot.completed { background: #dcfce7; color: #15803d; }
.ms-dot.in_progress { background: #dbeafe; color: #1d4ed8; }
.ms-dot.pending { background: #f3f4f6; color: #9ca3af; }
.ms-body { flex: 1; min-width: 0; }
.ms-body .t { font-weight: 700; color: var(--navy); font-size: 13.5px; }
.ms-body .d { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.5; }
.ms-body .due { font-size: 11.5px; color: #9ca3af; margin-top: 4px; }

/* updates feed */
.upd-item { padding: 16px 0; border-bottom: 1px solid #f1f5f9; }
.upd-item:last-child { border-bottom: none; }
.upd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.upd-head .t { font-weight: 700; color: var(--navy); font-size: 14px; }
.upd-meta { color: #9ca3af; font-size: 12px; margin-top: 3px; }
.upd-body { margin-top: 8px; color: var(--text); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }

/* info requests */
.req-item { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.req-item.open { border-color: #fcd34d; background: #fffdf5; }
.req-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.req-head .t { font-weight: 700; color: var(--navy); font-size: 14px; }
.req-desc { color: var(--text); font-size: 13px; margin-top: 8px; line-height: 1.55; }
.req-response { background: #f0f7ff; border-radius: 9px; padding: 12px 14px; margin-top: 12px; font-size: 13px; line-height: 1.55; }
.req-response .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--blue); letter-spacing: .5px; margin-bottom: 4px; }
.req-note { background: #faf3e0; border-radius: 9px; padding: 12px 14px; margin-top: 10px; font-size: 13px; }
.req-note .lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #8a6d1f; letter-spacing: .5px; margin-bottom: 4px; }
.req-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; align-items: center; }
.req-item textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 9px; padding: 10px 12px; min-height: 80px; margin-top: 12px; resize: vertical; }
.req-item textarea:focus { outline: none; border-color: var(--blue); }

/* strategy */
.pillar { border: 1.5px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; background: #fff; }
.pillar-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; background: #fff; }
.pillar-head:hover { background: #fafbff; }
.pillar-num { width: 34px; height: 34px; border-radius: 9px; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0; }
.pillar-head .pt { font-weight: 700; color: var(--navy); font-size: 14.5px; }
.pillar-head .pd { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pillar-body { padding: 4px 18px 18px; border-top: 1px solid #f1f5f9; }
.obj { margin-top: 16px; }
.obj-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.obj-code { background: var(--gold); color: #fff; font-weight: 800; font-size: 11px; padding: 3px 8px; border-radius: 6px; }
.obj-title { font-weight: 700; color: var(--navy); font-size: 13.5px; flex: 1; }
.kpi-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.kpi-row .kn { flex: 1; font-size: 13px; min-width: 0; }
.kpi-row .kv { font-size: 12.5px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.kpi-row .progress-track { width: 130px; flex-shrink: 0; }
.kpi-row input.kpi-cur { width: 64px; padding: 4px 8px; border: 1.5px solid var(--border); border-radius: 7px; text-align: center; font-weight: 700; }
.tactic-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.tactic-row select { border: 1.5px solid var(--border); border-radius: 7px; padding: 3px 6px; font-size: 12px; }
.tactic-status { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ts-done { background: var(--green); }
.ts-in_progress { background: var(--blue); }
.ts-not_started { background: #d1d5db; }

.funnel-stage { display: flex; align-items: center; gap: 14px; padding: 9px 0; }
.funnel-stage .fn { width: 180px; font-weight: 600; font-size: 13px; }
.funnel-stage .fb { flex: 1; }
.funnel-stage .fv { width: 90px; text-align: right; font-weight: 700; color: var(--navy); font-size: 13px; }

/* modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(13,27,75,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; padding: 26px; }
.modal h3 { color: var(--navy); font-size: 17px; font-weight: 800; margin-bottom: 18px; }
.modal label { display: block; font-weight: 600; font-size: 12.5px; color: var(--navy); margin: 12px 0 5px; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 9px; }
.modal input:focus, .modal select:focus, .modal textarea:focus { outline: none; border-color: var(--blue); }
.modal textarea { min-height: 80px; resize: vertical; }
.modal .row { display: flex; gap: 12px; }
.modal .row > div { flex: 1; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .check { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--navy); }
.modal .check input { width: auto; }

/* toast */
#toast-root { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 13px; font-weight: 600; animation: slideIn .25s; }
.toast.error { background: var(--red); }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty { text-align: center; color: var(--muted); padding: 32px 16px; font-size: 13.5px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.section-head h3 { color: var(--navy); font-size: 16px; font-weight: 800; }
.filter-input { padding: 8px 14px; border: 1.5px solid var(--border); border-radius: 9px; width: 240px; }
.filter-input:focus { outline: none; border-color: var(--blue); }

@media (max-width: 800px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .content { padding: 16px; }
}
