/* BE SMARTDEV · Pontaj proiecte — design tokens derived from the logo navy (#0B4278). */
:root {
  --brand: #0b4278;
  --brand-600: #0d4f8f;
  --brand-50: #eef3f9;
  --brand-100: #dbe6f2;
  --ink: #0f1b2d;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --off: #f1f4f8;
  --ok: #15803d;   --ok-bg: #ecfdf3;   --ok-line: #bbe5c8;
  --warn: #b45309; --warn-bg: #fff8eb; --warn-line: #f5d9a8;
  --err: #b91c1c;  --err-bg: #fef2f2;  --err-line: #f5c2c2;
  --info: var(--brand); --info-bg: var(--brand-50); --info-line: var(--brand-100);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 1px 3px rgba(15, 27, 45, .06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh;
       display: flex; flex-direction: column; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
small, .small { font-size: 12px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2;
        stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---------- App shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1440px; margin: 0 auto; height: 64px; padding: 0 28px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand .product { padding-left: 14px; border-left: 1px solid var(--line-2); font-size: 13px; font-weight: 500;
                  color: var(--muted); letter-spacing: .01em; line-height: 22px; }
.mainnav { display: flex; gap: 4px; flex: 1; height: 100%; }
.mainnav a { display: flex; align-items: center; padding: 0 12px; color: var(--ink-2); font-weight: 500;
             border-bottom: 2px solid transparent; margin-bottom: -1px; }
.mainnav a:hover { color: var(--brand); text-decoration: none; }
.mainnav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.usermenu { display: flex; align-items: center; gap: 10px; }
.usermenu .who { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.usermenu .who:hover { text-decoration: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-50); color: var(--brand);
          display: grid; place-items: center; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.usermenu .name { display: flex; flex-direction: column; line-height: 1.2; }
.usermenu .name strong { font-size: 13px; font-weight: 600; }
.usermenu .name span { font-size: 11px; color: var(--muted); }
.usermenu form { margin: 0; }

main { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 28px 40px; }
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { max-width: 1440px; margin: 0 auto; padding: 14px 28px; display: flex; justify-content: space-between;
                color: var(--muted); font-size: 12px; }

/* ---------- Page header ---------- */
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.pagehead .eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.pagehead .eyebrow a { color: var(--muted); }
.pagehead .sub { color: var(--muted); margin-top: 4px; }
.pagehead .tools { display: flex; gap: 10px; align-items: center; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; color: var(--ink-2); font-size: 13px; }
.meta span b { color: var(--muted); font-weight: 500; margin-right: 4px; }

.monthnav { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--radius-sm); box-shadow: var(--shadow); height: 36px; }
.monthnav a { display: grid; place-items: center; width: 36px; height: 100%; color: var(--ink-2); }
.monthnav a:hover { background: var(--off); color: var(--brand); text-decoration: none; }
.monthnav strong { padding: 0 14px; min-width: 150px; text-align: center; font-weight: 600; font-size: 13px;
                   border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 34px; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .card + .section, .section + .card { margin-top: 20px; }
.stats > .card, .split > .card, .reports > .card { margin-top: 0; }
form + .card, .card + form, form + .alert { margin-top: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px;
             border-bottom: 1px solid var(--line); }
.card-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-body { padding: 20px; }
.section { margin-top: 28px; }
.section > h2 { margin-bottom: 12px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 16px 20px; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Forms & buttons ---------- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 14px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2);
                          border-radius: var(--radius-sm); padding: 8px 10px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 66, 120, .12); }
label input:not([type=checkbox]):not([type=radio]), label select, label textarea { display: block; width: 100%; margin-top: 6px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
input.tiny { width: 64px; } input.short { width: 110px; } input.full { width: 100%; }

.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
               font: inherit; font-weight: 500; font-size: 13px; color: var(--ink); background: var(--surface);
               border: 1px solid var(--line-2); border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
               transition: background .15s, border-color .15s; }
.btn:hover, button:hover { background: var(--off); text-decoration: none; color: var(--ink); }
.btn.primary, button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover, button.primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn.danger, button.danger { color: var(--err); border-color: var(--err-line); }
.btn.danger:hover, button.danger:hover { background: var(--err-bg); }
.btn.sm, button.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn.ghost, button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover, button.ghost:hover { background: var(--off); color: var(--ink); }
.btn.block, button.block { width: 100%; height: 40px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.formats { display: inline-flex; gap: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar select, .toolbar input { height: 36px; padding-top: 0; padding-bottom: 0; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.choice { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px 16px; border: 1px solid var(--line-2);
          border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--brand); }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand); }
.choice input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--brand); }
.choice strong, .toggle strong { display: block; color: var(--ink); font-weight: 600; }
.choice small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }
label.toggle { align-items: flex-start; margin: 0; }
label.toggle input { margin-top: 3px; }
label.toggle small { display: block; font-weight: 400; margin-top: 2px; }
fieldset.funding { border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 14px 16px 0; margin: 4px 0 18px; }
fieldset.funding legend { padding: 0 6px; font-size: 12px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .05em; }
fieldset.funding[hidden] { display: none; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; }
.alert .icon { margin-top: 1px; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert.success { background: var(--ok-bg); border-color: var(--ok-line); color: #14532d; }
.alert.error { background: var(--err-bg); border-color: var(--err-line); color: #7f1d1d; }
.alert.warning { background: var(--warn-bg); border-color: var(--warn-line); color: #7c2d12; }
.alert.info, .alert.message { background: var(--info-bg); border-color: var(--info-line); color: #0b2e55; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
         font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--off); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.submitted { background: var(--warn-bg); color: var(--warn); }
.badge.approved { background: var(--ok-bg); color: var(--ok); }
.badge.rejected { background: var(--err-bg); color: var(--err); }
.badge.empty { background: transparent; border: 1px dashed var(--line-2); color: var(--muted); }
.badge.empty::before { display: none; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--brand-50); color: var(--brand);
       font-size: 11px; font-weight: 600; letter-spacing: .02em; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
                color: var(--muted); background: #fafbfc; padding: 10px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: #fafbfd; }
table.data tr.inactive td { color: var(--muted); }
table.data tfoot td { font-weight: 600; background: #fafbfc; border-top: 1px solid var(--line); padding: 10px 16px; }
table.data th.num, table.data td.num { text-align: right; }
table.data td .title { font-weight: 600; color: var(--ink); }
table.data td .desc { font-size: 12px; color: var(--muted); margin-top: 2px; max-width: 520px; }
table.data td.fit { width: 1%; white-space: nowrap; }
table.data input:not([type=checkbox]) { height: 32px; padding: 0 8px; }

.progress { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.progress .bar { flex: 1; height: 6px; background: var(--off); border-radius: 99px; overflow: hidden; }
.progress .bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.progress .bar span.over { background: var(--err); }
.hint-warn { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; font-size: 12px; color: var(--warn); max-width: 420px; }
.hint-warn .icon { width: 14px; height: 14px; margin-top: 1px; }
.progress small { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Timesheet grid ---------- */
.grid-card { overflow: hidden; }
.gridwrap { overflow-x: auto; }
table.grid { border-collapse: separate; border-spacing: 0; font-size: 12px; font-variant-numeric: tabular-nums; width: 100%; }
table.grid th, table.grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
                               text-align: center; padding: 0; min-width: 33px; height: 34px; }
table.grid thead th { background: #fafbfc; font-weight: 600; color: var(--ink-2); padding: 6px 2px; line-height: 1.2;
                      position: sticky; top: 0; z-index: 2; }
table.grid thead th small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; }
table.grid .label { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 0 14px;
                    min-width: 210px; max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
                    border-right: 1px solid var(--line-2); }
table.grid thead .label { z-index: 3; background: #fafbfc; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.grid .label .code { display: inline-block; min-width: 38px; font-weight: 600; color: var(--brand); }
table.grid .off { background: var(--off); }
table.grid thead th.off { background: #eef1f5; color: var(--muted); }
/* Today: only the day number is marked, so the column never looks like a weekend/holiday. */
table.grid thead th .daynum { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; }
table.grid thead th.today .daynum { background: var(--brand); color: #fff; }
table.grid thead th.today small { color: var(--brand); font-weight: 600; }
.legend .today-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--brand);
                     vertical-align: -2px; margin-right: 6px; }
table.grid input { width: 100%; min-width: 32px; height: 33px; border: 0; border-radius: 0; padding: 0; text-align: center;
                   background: transparent; font-size: 12px; font-variant-numeric: tabular-nums; }
table.grid input:hover { background: var(--brand-50); }
table.grid input:focus { background: #fff; box-shadow: inset 0 0 0 2px var(--brand); }
table.grid select { width: 100%; height: 33px; border: 0; border-radius: 0; padding: 0 2px; font-size: 11px; font-weight: 600;
                    background: transparent; text-align: center; text-align-last: center; color: var(--brand);
                    appearance: none; -webkit-appearance: none; cursor: pointer; }
table.grid select:hover { background: var(--brand-50); }
table.grid select:focus { box-shadow: inset 0 0 0 2px var(--brand); }
table.grid tr.group td.label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.grid tr.sum td { font-weight: 600; background: #f8fafc; }
table.grid tr.sum td.label { background: #f8fafc; }
table.grid tr.grand td { font-weight: 700; background: var(--brand-50); color: var(--brand); border-top: 1px solid var(--brand-100); }
table.grid tr.grand td.label { background: var(--brand-50); }
table.grid tr.readonly td { color: var(--muted); }
table.grid td.total, table.grid th.total { position: sticky; right: 0; min-width: 60px; font-weight: 700; background: #f8fafc;
                                           border-left: 1px solid var(--line-2); }
table.grid tr.grand td.total { background: var(--brand-100); }
table.grid td.over { background: var(--err-bg) !important; color: var(--err); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 20px; border-top: 1px solid var(--line);
          font-size: 12px; color: var(--muted); background: #fafbfc; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 6px;
            border: 1px solid var(--line-2); }

.reports { display: grid; gap: 14px; }
.report { padding: 16px 20px; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.report-head .hours { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.report-cols { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.report-cols label { margin: 0; }
.report dl { margin: 0; display: grid; grid-template-columns: 3fr 2fr; gap: 16px; }
.report dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.report dd { margin: 0; white-space: pre-line; }

.savebar { position: sticky; bottom: 0; z-index: 10; margin-top: 24px; background: rgba(255, 255, 255, .96);
           backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 -4px 16px rgba(15, 27, 45, .06);
           padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.savebar .summary { display: flex; gap: 24px; font-size: 13px; color: var(--muted); }
.savebar .summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.split.single { grid-template-columns: minmax(0, 1fr); }
.doclist { display: grid; gap: 0; }
.doc { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.doc:last-child { border-bottom: 0; }
.doc .doc-title { display: flex; gap: 12px; align-items: center; }
.doc .doc-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.doc .doc-title p { font-size: 12px; color: var(--muted); }
.doc .doc-title strong { font-weight: 600; }

/* ---------- Login ---------- */
.auth { flex: 1; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { background: linear-gradient(160deg, #0b4278 0%, #08335e 60%, #062847 100%); color: #dbe6f2; padding: 48px 56px;
              display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px;
                     border: 40px solid rgba(255, 255, 255, .04); transform: rotate(45deg); }
.auth-brand img { width: 190px; height: auto; }
.auth-brand h2 { color: #fff; font-size: 28px; font-weight: 600; line-height: 1.25; max-width: 460px; letter-spacing: -.02em; }
.auth-brand ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; max-width: 460px; }
.auth-brand li { display: flex; gap: 10px; font-size: 14px; }
.auth-brand li .icon { color: #8fb4dc; margin-top: 2px; }
.auth-brand .fine { font-size: 12px; color: #8fa9c7; }
.auth-form { display: grid; place-items: center; padding: 48px 24px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 360px; }
.auth-form h1 { font-size: 24px; margin-bottom: 6px; }
.auth-form .sub { color: var(--muted); margin-bottom: 28px; }
.auth-form .alert { margin-bottom: 20px; }
.auth-form .mobile-logo { display: none; }

@media (max-width: 1100px) {
  .split { grid-template-columns: 1fr; }
  .brand .product { display: none; }
}
@media (max-width: 860px) {
  .topbar-inner { height: auto; flex-wrap: wrap; gap: 8px 16px; padding: 10px 16px; }
  .mainnav { order: 3; flex: 1 0 100%; height: 40px; overflow-x: auto; margin: 0 -16px; padding: 0 4px; border-top: 1px solid var(--line); }
  .usermenu { margin-left: auto; }
  table.data td .desc { display: none; }
  .footer-inner { flex-direction: column; gap: 4px; padding: 14px 16px; }
  .usermenu .name { display: none; }
  main { padding: 20px 16px 32px; }
  .form-grid, .report-cols, .report dl, .choice-grid { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form .mobile-logo { display: block; width: 170px; margin: 0 0 28px; }
  .savebar { flex-direction: column; align-items: stretch; }
}
