/* Employee Tools — brand stylesheet (from Go Projects). Poppins from /assets/fonts, navy #25265E, accent green.
   Mobile-first: single column; two-column layouts switch on at 700px. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('/assets/fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/poppins-latin-700-normal.woff2') format('woff2'); }

:root {
  --navy: #25265E;
  --navy-dark: #1a1b45;
  --navy-soft: #e9e9f3;
  --green: #2E9E5B;
  --green-dark: #23804a;
  --green-soft: #e4f4ea;
  --amber: #d97706;
  --amber-soft: #fef3e2;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --grey-1: #f6f7fa;
  --grey-2: #e5e7ee;
  --grey-3: #9a9db2;
  --text: #1f2033;
  --muted: #6b6e85;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(37, 38, 94, .08), 0 4px 14px rgba(37, 38, 94, .06);
  --font: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
[data-teams-theme="dark"] {
  --grey-1: #1f1f22; --grey-2: #34343a; --grey-3: #7d7f92; --text: #f0f0f4; --muted: #b3b5c6;
  --card: #292929; --navy-soft: #2f3060; --green-soft: #1e3a2a; --amber-soft: #3d2a10; --red-soft: #3d1a1a;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--text); background: var(--grey-1); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--fg-navy, var(--navy)); margin: 0 0 .5rem; font-weight: 600; line-height: 1.25; }
[data-teams-theme="dark"] h1, [data-teams-theme="dark"] h2, [data-teams-theme="dark"] h3, [data-teams-theme="dark"] h4 { color: var(--text); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
a { color: var(--fg-navy, var(--navy)); }
[data-teams-theme="dark"] a { color: #9fb6ff; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.right { text-align: right; } .center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.nowrap { white-space: nowrap; }

/* layout */
.page { max-width: 1100px; margin: 0 auto; padding: 12px; }
.page.narrow { max-width: 760px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; flex-wrap: wrap; }
.topbar .logo { height: 28px; }
.topbar .spacer { flex: 1; }
.topbar nav a { margin-right: 12px; text-decoration: none; font-weight: 500; color: var(--fg-navy, var(--navy)); }
.topbar nav a.active { border-bottom: 2px solid var(--green); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.section { margin: 18px 0; }
.section-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.section-title .count { color: var(--muted); font-weight: 500; }
@media (min-width: 700px) {
  .page { padding: 20px; }
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.side { grid-template-columns: 2fr 1fr; }
}

/* cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.card.flat { box-shadow: none; border: 1px solid var(--grey-2); }
.card .title { font-weight: 600; margin-bottom: 4px; }
.card .meta { color: var(--muted); font-size: .85rem; display: flex; gap: 10px; flex-wrap: wrap; }
.card .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.card.rework { border-left: 4px solid var(--amber); }
.card.overdue { border-left: 4px solid var(--red); }
.card.approved { border-left: 4px solid var(--green); }
.code { font-weight: 600; color: var(--fg-navy, var(--navy)); font-variant-numeric: tabular-nums; }
[data-teams-theme="dark"] .code { color: #c9d1ff; }

/* progress bar */
.bar { height: 8px; background: var(--grey-2); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--green); border-radius: 4px; transition: width .2s; }
.bar.warn > span { background: var(--amber); }
.bar.over > span { background: var(--red); }

/* buttons */
.btn { font: inherit; font-weight: 500; border: 1px solid var(--bd-navy, var(--navy)); background: var(--card); color: var(--fg-navy, var(--navy));
  padding: 8px 14px; border-radius: 8px; cursor: pointer; line-height: 1.2; min-height: 36px; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { background: var(--navy-soft); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); }
.btn-accent { background: var(--green); border-color: var(--green); color: #fff; }
.btn-accent:hover { background: var(--green-dark); }
.btn-danger { background: var(--card); border-color: var(--red); color: var(--fg-red, var(--red)); }
.btn-danger:hover { background: var(--red-soft); }
.btn-ghost { border-color: transparent; }
.btn-sm { padding: 4px 10px; min-height: 28px; font-size: .85rem; }
.btn:disabled, .btn.busy { opacity: .55; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-weight: 500; font-size: .85rem; color: var(--muted); }
.field .help { font-size: .8rem; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--grey-2); border-radius: 8px; padding: 8px 10px; min-height: 36px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; }
.check { display: flex; align-items: center; gap: 8px; }
.form-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 700px) { .form-row { grid-template-columns: 1fr 1fr; } .form-row.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--grey-2); border-radius: 8px; overflow: hidden; }
.stepper button { font: inherit; border: 0; background: var(--grey-1); width: 34px; min-height: 34px; cursor: pointer; color: var(--fg-navy, var(--navy)); font-weight: 600; }
.stepper input { width: 64px; border: 0; border-radius: 0; text-align: center; min-height: 34px; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.data th, table.data td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--grey-2); vertical-align: top; }
table.data th { background: var(--navy); color: #fff; font-weight: 500; font-size: .8rem; letter-spacing: .02em; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--navy-soft); }
table.data .align-right { text-align: right; font-variant-numeric: tabular-nums; }
table.data .align-center { text-align: center; }
table.data tfoot td { font-weight: 600; background: var(--grey-1); }
table.compact th, table.compact td { padding: 4px 8px; font-size: .85rem; }

/* status badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--grey-2); color: var(--text); white-space: nowrap; }
.badge-not-started, .badge-draft, .badge-proposed { background: var(--grey-2); color: var(--muted); }
.badge-in-progress, .badge-active, .badge-submitted, .badge-pending-approval { background: var(--navy-soft); color: var(--fg-navy, var(--navy)); }
[data-teams-theme="dark"] .badge-in-progress, [data-teams-theme="dark"] .badge-active, [data-teams-theme="dark"] .badge-submitted { color: #dfe2ff; }
.badge-approved, .badge-sent, .badge-complete, .badge-green { background: var(--green-soft); color: var(--fg-green-dark, var(--green-dark)); }
.badge-rework, .badge-on-hold, .badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-closed, .badge-withdrawn, .badge-failed, .badge-red, .badge-overdue { background: var(--red-soft); color: var(--fg-red, var(--red)); }
.badge-high { background: var(--red-soft); color: var(--fg-red, var(--red)); } .badge-low { background: var(--grey-2); color: var(--muted); }

/* banners, toasts, empty states */
.banner { padding: 10px 14px; border-radius: 8px; margin: 8px 0; font-weight: 500; white-space: pre-wrap; }
.banner-error { background: var(--red-soft); color: var(--fg-red, var(--red)); }
.banner-info { background: var(--navy-soft); color: var(--fg-navy, var(--navy)); }
.banner-ok { background: var(--green-soft); color: var(--fg-green-dark, var(--green-dark)); }
.banner-warn { background: var(--amber-soft); color: var(--amber); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .2s; z-index: 50; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--red); } .toast-ok { background: var(--green-dark); }
.empty { padding: 24px; text-align: center; color: var(--muted); background: var(--card); border-radius: var(--radius); border: 1px dashed var(--grey-2); }
.loading { color: var(--muted); padding: 12px 0; }
.loading::after { content: '…'; }

/* today strip and week grid */
.strip { display: grid; grid-template-columns: 1fr; gap: 8px; }
.strip .line { display: grid; grid-template-columns: 1fr; gap: 6px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
@media (min-width: 700px) { .strip .line { grid-template-columns: 2fr auto 3fr auto; } }
.weekgrid { display: grid; grid-template-columns: minmax(140px, 2fr) repeat(7, minmax(44px, 1fr)) minmax(56px, auto); gap: 2px; align-items: stretch; min-width: 620px; }
.weekgrid .cell { background: var(--card); border: 1px solid var(--grey-2); border-radius: 6px; padding: 6px 4px; text-align: center; min-height: 40px; cursor: pointer; font-variant-numeric: tabular-nums; }
.weekgrid .cell.draft { background: var(--grey-2); } .weekgrid .cell.submitted { background: var(--navy-soft); }
.weekgrid .cell.approved { background: var(--green-soft); } .weekgrid .cell.rework { background: var(--amber-soft); }
.weekgrid .cell.locked { opacity: .55; cursor: default; }
.weekgrid .head { font-weight: 600; font-size: .8rem; color: var(--muted); text-align: center; padding: 4px; }
.weekgrid .total { font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* heatmap (resourcing) */
.heat { font-variant-numeric: tabular-nums; }
.heat td.h0 { background: var(--card); } .heat td.h1 { background: var(--bg-eef7f1, #eef7f1); } .heat td.h2 { background: var(--bg-cfeadb, #cfeadb); }
.heat td.h3 { background: var(--bg-a7d9bd, #a7d9bd); } .heat td.h4 { background: var(--amber-soft); } .heat td.h5 { background: var(--red-soft); color: var(--fg-red, var(--red)); font-weight: 600; }

/* dialogs (task, review, report pages opened as Teams dialogs) */
.dialog { padding: 12px; max-width: 900px; margin: 0 auto; }
.dialog .dialog-head { position: sticky; top: 0; background: var(--grey-1); padding: 8px 0; z-index: 2; }
.dialog .dialog-foot { position: sticky; bottom: 0; background: var(--grey-1); padding: 8px 0; display: flex; gap: 8px; justify-content: flex-end; z-index: 2; }
.diary .entry { padding: 10px 0; border-top: 1px solid var(--grey-2); }
.diary .entry:first-child { border-top: 0; }
.diary .comments { background: var(--amber-soft); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.dropzone { border: 2px dashed var(--grey-2); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); }
.dropzone.over { border-color: var(--green); background: var(--green-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--grey-2); border-radius: 999px; padding: 2px 10px; font-size: .8rem; }

/* WBS outline */
.outline .heading { font-weight: 600; background: var(--navy-soft); }
.outline .task { padding-left: 24px; }

@media print {
  .topbar, .btn, .toast, .banner { display: none !important; }
  body { background: var(--bg-fff, #fff); }
  .card, table.data { box-shadow: none; }
}

/* ---- Employee Tools: buttons, upload box, file viewer, filter chips (My Receipts, My Docs) */
.btn { font: inherit; font-weight: 600; border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; min-height: 38px; background: var(--green); color: #fff; }
.btn:hover, .btn:focus-visible { background: var(--green-dark); }
.btn.ghost { background: var(--card); border: 1px solid var(--grey-2); color: var(--fg-navy, var(--navy)); }
.btn.ghost:hover, .btn.ghost:focus-visible { background: var(--card); border-color: var(--bd-navy, var(--navy)); }
.btn.danger { background: var(--red-soft); color: var(--fg-red, var(--red)); }
.btn.sm { padding: 5px 12px; min-height: 30px; font-size: .85rem; }
.btn:disabled, .btn.busy { opacity: .55; cursor: default; }
[data-teams-theme="dark"] .btn.ghost { color: var(--text); }
.card + .card { margin-top: 14px; }
.card > h2 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.note { font-size: .85rem; color: var(--muted); margin: 0 0 10px; }
.fields { display: grid; grid-template-columns: 1fr; gap: 10px 14px; }
@media (min-width: 700px) { .fields { grid-template-columns: 1fr 1fr; } .fields .wide { grid-column: 1 / -1; } }
.fields label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: .85rem; color: var(--muted); }
.fields input, .fields select { font: inherit; padding: 8px 10px; border: 1px solid var(--grey-2); border-radius: 8px; background: var(--card); color: var(--text); min-height: 38px; }

.dropzone { border: 2px dashed var(--grey-3); border-radius: var(--radius); padding: 18px 14px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; background: var(--card); }
.dropzone.over { border-color: var(--green); background: var(--green-soft); }
.dz-title { font-weight: 600; color: var(--fg-navy, var(--navy)); }
[data-teams-theme="dark"] .dz-title { color: var(--text); }
.upload-list { margin-top: 8px; }
.upload-row { display: flex; gap: 10px; justify-content: space-between; align-items: baseline; padding: 6px 10px; border-radius: 8px; font-size: .9rem; }
.upload-row .fname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.upload-row .state { color: var(--muted); text-align: right; flex: none; max-width: 65%; }
.upload-row.working .state::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid var(--grey-3); border-top-color: var(--bd-navy, var(--navy)); border-radius: 50%; animation: et-spin .8s linear infinite; vertical-align: -1px; }
.upload-row.done { background: var(--green-soft); } .upload-row.done .state { color: var(--fg-green-dark, var(--green-dark)); }
.upload-row.failed { background: var(--red-soft); } .upload-row.failed .state { color: var(--fg-red, var(--red)); white-space: normal; }
@keyframes et-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upload-row.working .state::before { animation: none; } }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.chip { font: inherit; font-size: .85rem; font-weight: 500; border: 1px solid var(--grey-2); background: var(--card); color: var(--text); border-radius: 999px; padding: 5px 12px; cursor: pointer; min-height: 32px; }
.chip .n { color: var(--muted); margin-left: 4px; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--bd-navy, var(--navy)); color: #fff; }
.chip[aria-pressed="true"] .n { color: #d8d9ee; }
.chip:focus-visible { outline: 3px solid var(--bd-93c5fd, #93c5fd); outline-offset: 2px; }

.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(15, 16, 40, .6); display: flex; flex-direction: column; padding: 12px; }
.viewer[hidden] { display: none; }
.viewer .bar { flex: none; min-height: 50px; display: flex; gap: 8px; align-items: center; background: var(--card); border-radius: 10px 10px 0 0; padding: 8px 12px; }
.viewer .bar .name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer .stage { flex: 1; min-height: 0; background: var(--bg-fff, #fff); border-radius: 0 0 10px 10px; overflow: auto; display: flex; justify-content: center; align-items: flex-start; }
.viewer .stage iframe { width: 100%; height: 100%; border: none; }
.viewer .stage img { max-width: 100%; height: auto; }
