/* Area E – home, dashboard, job report, settings pages. Owned by the area (docs/AREAS.md) – prefix classes with the page name, use only tokens from theme.css. */

/* ---------- shared: filter bar ---------- */
.of-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: var(--gap); }
.of-filters .seg { flex-wrap: wrap; }
.of-filters select.input { width: auto; min-width: 180px; max-width: 260px; height: 36px; font-size: var(--fs-sm); }
.of-filters .of-range { font-size: var(--fs-xs); color: var(--text-3); }
.of-filters [data-custom] input { height: 36px; }
@media (max-width: 600px) {
  .of-filters select.input { flex: 1 1 100%; max-width: none; }
  .of-filters [data-custom] { flex-wrap: wrap; }
  .of-filters [data-custom] input { width: 140px !important; }
}

/* ---------- shared look of home + dashboard (UI mockup 2): lists, photos – hero (.hero), icon chips (.ic-chip) and avatars (.avatar) are shared in components.css / app.css ---------- */
.of-sub { display: block; font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }
.of-warn { color: var(--warning); }
.of-more { padding: 10px 18px; font-size: var(--fs-xs); color: var(--text-3); border-top: 1px solid var(--border); }
.of-jobs li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.of-jobs li:last-child { border-bottom: 0; }
.of-job { min-width: 0; flex: 1; font-size: var(--fs-sm); }
.of-job > a, .of-job > span:first-child { color: inherit; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.of-job > a:hover { color: var(--primary); }
.of-job b { font-weight: 700; font-variant-numeric: tabular-nums; }
.of-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.of-photos a { position: relative; display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; background: var(--surface-3); }
.of-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.of-photos span { position: absolute; left: 6px; bottom: 6px; padding: 1px 7px; border-radius: var(--radius-pill); background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.of-photos + .of-sub { margin-top: 8px; font-size: var(--fs-sm); }
.db-card { display: flex; flex-direction: column; }
.db-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 16px 18px 6px; }
.db-card-head h2 { font-size: var(--fs-md); font-weight: 650; }
.db-card-head .of-sub { margin: 0; }
.db-card-head .right { margin-left: auto; }
.db-card > .card-body { padding-top: 10px; }
.db-row { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: var(--gap); margin-bottom: var(--gap); align-items: start; }
.db-row-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.db-row > .card { height: 100%; }
@media (max-width: 1000px) { .db-row, .db-row-even { grid-template-columns: 1fr; } }

/* ---------- home ---------- */
.home-hero { align-items: flex-end; }
.home-hero .hero-btn { margin-top: 18px; }
.home-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; flex: 0 1 430px; }
.home-row > .card { height: auto; }
.home-stat { display: flex; flex-direction: column; gap: 1px; padding: 12px 14px; border-radius: var(--radius); background: rgba(4, 38, 35, .34); color: #fff; text-decoration: none; min-width: 0;
  border: 1px solid rgba(255, 255, 255, .18); transition: background .15s; }
a.home-stat:hover { background: rgba(4, 38, 35, .5); text-decoration: none; } .home-card:hover, .home-card:hover * { text-decoration: none; }
.home-stat .val { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.home-stat .lbl { font-size: var(--fs-xs); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-stat .hint { font-size: 11px; color: rgba(255, 255, 255, .9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.home-card { display: flex; flex-direction: column; gap: 3px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; min-width: 0; }
.home-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.home-card .ic-chip { margin-bottom: 8px; }
.home-card b { font-size: var(--fs-md); } .home-card small { font-size: var(--fs-xs); color: var(--text-3); }
.home-side .todo { display: flex; justify-content: space-between; width: 100%; color: inherit; text-decoration: none; gap: 10px; }
.home-side .todo:hover span:first-child { color: var(--primary); }
.home-side .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.home-side > .list-plain > li { padding: 10px 18px; }
@media (max-width: 1100px) { .home-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-stats { max-width: none; } }
@media (max-width: 600px) { .home-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .home-card { padding: 14px; } .of-jobs li { padding: 10px 14px; } }

/* ---------- dashboard ---------- */
.db-page { --db-bar-past: color-mix(in srgb, var(--brand-400) 40%, var(--surface)); }
.db-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.db-kpi { display: flex; align-items: center; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: inherit; text-decoration: none; min-width: 0; transition: border-color .15s; }
.db-kpi:hover { border-color: var(--primary); text-decoration: none; } .db-kpi:hover * { text-decoration: none; }
.db-kpi-txt { display: flex; flex-direction: column; min-width: 0; }
.db-kpi .lbl { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-kpi .val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.db-kpi .hint { font-size: var(--fs-xs); color: var(--text-3); }
.db-kpi .hint.tone-warn { color: var(--warning); } .db-kpi .hint.tone-amber { color: var(--st-progress); } .db-kpi .hint.tone-danger { color: var(--danger); }
.db-pills { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.db-pills small { font-weight: 500; opacity: .8; }
.db-donut { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.db-donut-c { position: relative; width: 132px; height: 132px; flex: none; }
.db-donut-c > span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.db-donut-c b { font-size: 22px; font-variant-numeric: tabular-nums; } .db-donut-c small { font-size: var(--fs-xs); color: var(--text-3); }
.db-attn .db-card-head h2 { display: flex; align-items: center; gap: 8px; }
.db-count { font-size: var(--fs-xs); font-weight: 650; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--warning-bg); color: var(--warning); }
.db-info { margin-left: auto; color: var(--text-3); cursor: help; } .db-info .icon { stroke: var(--text-3); }
.db-attn > ul { max-height: 300px; overflow-y: auto; }
.db-attn li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 18px; font-size: var(--fs-sm); border-bottom: 0; }
.db-attn li > div { min-width: 0; flex: 1; }
.db-attn li a { font-weight: 600; color: inherit; }
.db-tag { flex: none; min-width: 64px; text-align: center; padding: 2px 9px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 650; margin-top: 1px; }
.db-tag.tone-danger { background: var(--danger-bg); color: var(--danger); } .db-tag.tone-warn { background: var(--warning-bg); color: var(--warning); }
.db-tag.tone-amber { background: var(--st-progress-bg); color: var(--st-progress); }
.db-attn-photos { margin-top: auto; padding: 12px 18px 18px; }
.db-attn-photos h3 { font-size: var(--fs-sm); font-weight: 550; color: var(--text-2); margin: 0 0 8px; }
.db-ok { display: flex; align-items: center; gap: 10px; padding: 12px 18px; color: var(--text-3); font-size: var(--fs-sm); }
.db-ok .icon { stroke: var(--success); }
.db-meter { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin: 6px 0 2px; display: flex; gap: 2px; max-width: 260px; }
.db-meter span { display: block; height: 100%; background: var(--warning); }
.db-meter span.plan { opacity: .4; }
.db-meter.over span { background: var(--danger); }
.db-pva-sum { display: flex; gap: 22px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 10px; }
.db-pva-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.db-legend-line { display: inline-block; width: 14px; height: 0; border-top: 2px dashed var(--text-3); margin-right: 5px; vertical-align: 3px; }
.db-recent li { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.db-recent li:last-child { border-bottom: 0; }
.db-recent li .main { min-width: 0; flex: 1; } .db-recent li .main a { color: inherit; }
.db-recent-st { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.db-recent .when { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.db-ln { display: flex; gap: 6px; align-items: baseline; min-width: 0; } .db-ln a { flex: none; font-weight: 600; color: inherit; }
.db-ln .ellipsis { min-width: 0; color: var(--text-2); }
.db-data { margin-top: 10px; font-size: var(--fs-sm); }
.db-data summary { cursor: pointer; color: var(--text-3); font-size: var(--fs-xs); }
@media (max-width: 1100px) { .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .db-kpis { gap: 8px; } .db-kpi { padding: 12px; gap: 10px; } .db-kpi .val { font-size: 22px; }
  .db-kpi .lbl { white-space: normal; font-size: var(--fs-xs); } .db-attn li, .db-recent li { padding: 9px 14px; } }

/* ---------- job report ---------- */
.tbl tr:has(.jr-flag) td { background: color-mix(in srgb, var(--warning-bg) 65%, transparent); }
.jr-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--warning); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.jr-flag .icon { stroke: var(--warning); width: 14px; height: 14px; }
.jr-pct { display: flex; flex-direction: column; gap: 4px; min-width: 84px; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.jr-pct .progress { height: 5px; }
.jr-pct .progress span.low { background: var(--warning); }
.jr-hours { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: var(--fs-sm); }
.jr-hours .v { font-size: var(--fs-xs); margin-left: 4px; } .jr-hours .v.up { color: var(--warning); } .jr-hours .v.down { color: var(--success); }
.jr-prop { display: block; min-width: 170px; } .jr-prop + .jr-sub { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .jr-emp { display: block; min-width: 90px; }
.jr-page .tbl th, .jr-page .tbl td { padding-left: 8px; padding-right: 8px; } .jr-page .tbl td:first-child, .jr-page .tbl th:first-child { padding-left: 16px; }
.jr-page .jr-pct { min-width: 64px; }
.jr-sub { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.jr-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--fs-xs); color: var(--text-3); margin: -6px 0 12px; }

/* ---------- settings landing ---------- */
.settings-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.settings-tiles .tile { min-height: 170px; }
.settings-tiles .tile .st-line { margin-top: auto; font-size: var(--fs-xs); color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.settings-tiles .tile .st-line { flex-wrap: wrap; } .settings-tiles .tile .st-line .progress { flex: 1 1 100%; height: 5px; }
@media (max-width: 1100px) { .settings-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .settings-tiles { grid-template-columns: 1fr; } .settings-tiles .tile { min-height: 0; } }

/* ---------- my company: e-mail template preview ---------- */
.co-mail-prev { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: var(--fs-sm); line-height: 1.5; }
.co-mail-prev b { display: block; margin-bottom: 6px; }

/* ---------- user management ---------- */
.um-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.um-bar .search-in { max-width: 320px; flex: 1 1 200px; height: 38px; }
