/* Building Services Console — matches demo palette */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: #f4f5f6; color: #1f2937; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: 2px solid #2f6f4e; outline-offset: 0; border-color: #2f6f4e; }
button:focus-visible { outline: 2px solid #2f6f4e; outline-offset: 2px; }
a { color: #2f6f4e; }

.app-header { display: flex; justify-content: space-between; align-items: center; padding: 13px 20px; background: #fff; border-bottom: 1px solid #e3e5e8; }
.logo-box { width: 34px; height: 34px; border-radius: 8px; background: #2f6f4e; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.brand { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 12px; color: #6b7280; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.bell-link { position: relative; padding: 4px; text-decoration: none; color: #4b5563; display: inline-flex; }
.bell-badge { position: absolute; top: -2px; right: -2px; background: #e0533a; color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
.btn-logout { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid #e3e5e8; padding: 7px 12px; border-radius: 8px; font-size: 13px; color: #4b5563; text-decoration: none; }

.tab-bar { background: #fff; border-bottom: 1px solid #e3e5e8; overflow-x: auto; }
.tab-inner { max-width: 960px; margin: 0 auto; display: flex; gap: 2px; padding: 0 12px; }
.tab { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 13px 13px; font-size: 13.5px; color: #6b7280; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tab.active { color: #2f6f4e; font-weight: 600; border-bottom-color: #2f6f4e; }

.body { max-width: 960px; margin: 0 auto; padding: 22px 18px 70px; }
.h2 { font-size: 18px; font-weight: 700; margin: 0; }
.muted { font-size: 13px; color: #6b7280; margin: 3px 0 0; }
.panel { background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 15px 17px; margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #6b7280; }
.count-pill { font-size: 12px; font-weight: 700; background: #eef0f2; color: #4b5563; padding: 2px 9px; border-radius: 20px; }

.money-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.money-card { background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 15px 16px; text-align: left; text-decoration: none; color: inherit; display: block; }
.money-card.border-green { border-color: #cfe6d8; }
.money-card.border-red { border-color: #f2d6cf; }
.money-label { font-size: 12px; color: #6b7280; margin-bottom: 6px; }
.money-value { font-size: 22px; font-weight: 700; }
.money-value.green { color: #2f6f4e; }
.money-value.red { color: #c0492f; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 12px; }
.stat-card { background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 16px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-label { font-size: 12.5px; color: #6b7280; }

.alert-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fafbfb; border: 1px solid #eef0f2; border-radius: 10px; margin-bottom: 8px; }
.sev-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.alert-text { font-size: 13.5px; font-weight: 600; }
.alert-meta { font-size: 11.5px; color: #8a8f97; margin-top: 1px; }
.tag { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; flex-shrink: 0; }
.tag-ppm { background: #eef7f1; color: #2f6f4e; }
.tag-contract { background: #eef0fc; color: #4a54b8; }
.tag-invoice { background: #fdecea; color: #c0492f; }

.list-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.primary-btn { display: inline-flex; align-items: center; gap: 7px; background: #2f6f4e; color: #fff; border: none; padding: 9px 15px; border-radius: 8px; font-size: 13.5px; font-weight: 600; text-decoration: none; }
.primary-btn:hover { background: #285f43; color: #fff; }
.small-btn { background: #f2f8f4; color: #2f6f4e; border: 1px solid #cfe6d8; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.ghost-btn { background: #fff; color: #6b7280; border: 1px solid #d5d8dc; padding: 8px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }

.row-card { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.row-title { font-size: 14.5px; font-weight: 600; }
.card-meta { font-size: 12.5px; color: #6b7280; margin: 3px 0; }
.chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; display: inline-block; }
.cat-tag { font-size: 11px; font-weight: 600; color: #4b5563; background: #eef0f2; padding: 2px 8px; border-radius: 6px; }
.contact-row { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #6b7280; margin-top: 4px; }
.contract-mini { font-size: 11.5px; color: #6b7280; text-align: right; line-height: 1.5; flex-shrink: 0; min-width: 120px; }
.back-btn { background: none; border: none; color: #2f6f4e; font-size: 13.5px; font-weight: 600; padding: 0; margin-bottom: 14px; text-decoration: none; display: inline-block; }
.back-btn:hover { text-decoration: underline; }
.sub-nav { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.sub-nav a { font-size: 13px; padding: 7px 12px; border-radius: 8px; border: 1px solid #e3e5e8; text-decoration: none; color: #4b5563; background: #fff; }
.sub-nav a.active { background: #f2f8f4; border-color: #2f6f4e; color: #2f6f4e; font-weight: 600; }
.row-card-link { text-decoration: none; color: inherit; display: flex; align-items: center; gap: 12px; width: 100%; }
.row-card-link:hover { border-color: #cfe6d8; }
.inactive-badge { font-size: 10px; font-weight: 700; color: #6b7280; background: #eef0f2; padding: 2px 7px; border-radius: 6px; margin-left: 6px; }
.req-id { font-size: 12px; font-weight: 700; color: #2f6f4e; letter-spacing: .3px; }
.action-dot { width: 8px; height: 8px; border-radius: 50%; background: #e0533a; display: inline-block; }
.mini-tracker { display: flex; gap: 3px; margin-top: 6px; }
.mini-seg { height: 4px; border-radius: 2px; flex: 1; background: #e3e5e8; }
.mini-seg.done { background: #2f6f4e; }
.tracker { display: flex; align-items: center; background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 16px 14px; margin-bottom: 16px; overflow-x: auto; }
.track-step { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 74px; }
.track-dot { width: 30px; height: 30px; border-radius: 50%; background: #eef0f2; color: #9aa0a6; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.track-dot.done { background: #2f6f4e; color: #fff; }
.track-label { font-size: 11px; color: #9aa0a6; text-align: center; line-height: 1.2; }
.track-label.active { color: #1f2937; font-weight: 600; }
.track-line { height: 2px; flex: 1; background: #e3e5e8; min-width: 12px; }
.track-line.done { background: #2f6f4e; }
.detail-text { font-size: 14px; line-height: 1.6; margin: 0; color: #374151; }
.kv { display: flex; justify-content: space-between; font-size: 13.5px; padding: 6px 0; border-bottom: 1px solid #f0f1f2; }
.kv span { color: #6b7280; }
.hint { font-size: 12px; color: #8a8f97; line-height: 1.5; margin-top: 8px; }
.cta-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 14px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cta-row.success { background: #eef7f0; border-color: #cfe8d6; }
.cta-text { font-size: 13.5px; color: #374151; flex: 1; min-width: 200px; }
.waiting { display: flex; align-items: center; gap: 8px; background: #f7f8f9; border: 1px dashed #d5d8dc; border-radius: 12px; padding: 13px 16px; font-size: 13px; color: #6b7280; margin-bottom: 14px; }
.form-card { background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 17px 18px; margin-bottom: 14px; }
.freq-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: #4b5563; background: #eef0f2; padding: 2px 8px; border-radius: 6px; }
.form-card-title { font-size: 14.5px; font-weight: 700; margin-bottom: 8px; }

.label { display: block; font-size: 12px; font-weight: 600; color: #4b5563; margin: 10px 0 5px; }
.input { width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid #d5d8dc; font-size: 13.5px; background: #fff; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 180px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; }
.flash-success { background: #eef7f1; border: 1px solid #cfe6d8; color: #2f6f4e; }
.flash-error { background: #fdecea; border: 1px solid #f2d6cf; color: #c0492f; }
.empty { font-size: 13px; color: #8a8f97; margin: 0; }

.filter-bar { display: flex; gap: 8px; margin: 18px 0 14px; flex-wrap: wrap; }
.filter-pill { font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 20px; border: 1px solid #e3e5e8; background: #fff; color: #4b5563; text-decoration: none; }
.filter-pill.active { background: #f2f8f4; border-color: #2f6f4e; color: #2f6f4e; }
.pay-panel { border-color: #cfe6d8; background: #f8fbf9; }
.pay-method-fields { display: none; margin-top: 12px; }
.pay-method-fields.active { display: block; }

.report-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.report-stat { background: #fff; border: 1px solid #e3e5e8; border-radius: 12px; padding: 14px 15px; }
.report-stat-label { font-size: 11.5px; color: #6b7280; margin-bottom: 5px; }
.report-stat-val { font-size: 20px; font-weight: 700; line-height: 1.2; }
.report-stat-val.green { color: #2f6f4e; }
.report-stat-val.red { color: #c0492f; }
.split-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: #eef0f2; margin-top: 8px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12.5px; color: #4b5563; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.bar-list { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.bar-item { width: 100%; }
.bar-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.bar-name { font-weight: 600; color: #374151; }
.bar-val { color: #6b7280; white-space: nowrap; }
.bar-track { height: 8px; background: #eef0f2; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; min-width: 2px; }
.report-table-wrap { overflow-x: auto; margin-top: 8px; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th, .report-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.report-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; }
.report-table tbody tr:hover { background: #fafbfb; }
.muted-inline { color: #8a8f97; font-size: 12px; }
.contractor-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f1f2; flex-wrap: wrap; }
.contractor-amts { display: flex; gap: 12px; font-size: 13px; flex-wrap: wrap; }
.green-text { color: #2f6f4e; font-weight: 600; }
.red-text { color: #c0492f; font-weight: 600; }

.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 10px; }
.chart-card { background: #fafbfb; border: 1px solid #eef0f2; border-radius: 12px; padding: 14px 14px 10px; min-height: 280px; display: flex; flex-direction: column; }
.chart-card-wide { grid-column: 1 / -1; }
.chart-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 10px; }
.chart-canvas-wrap { position: relative; flex: 1; min-height: 220px; }
.chart-canvas-tall { min-height: 260px; }
.chart-empty-msg { font-size: 12px; color: #8a8f97; text-align: center; margin: auto 0; padding: 20px; }
.multi-row { margin-bottom: 8px; }
.shift-block { border: 1px solid #eef0f2; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: #fafbfb; }
.staff-add-form { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #d5d8dc; }

.email-preview-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; margin-top: 12px; }
.email-template-list { display: flex; flex-direction: column; gap: 4px; }
.email-template-group { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #6b7280; margin: 12px 0 4px; }
.email-template-group:first-child { margin-top: 0; }
.email-template-link { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: #374151; font-size: 13px; border: 1px solid transparent; }
.email-template-link:hover { background: #fafbfb; border-color: #eef0f2; }
.email-template-link.active { background: #f2f8f4; border-color: #2f6f4e; color: #2f6f4e; font-weight: 600; }
.email-preview-pane { min-width: 0; }
.email-preview-meta { font-size: 13px; margin-bottom: 10px; line-height: 1.6; }
.email-preview-frame { width: 100%; height: 520px; border: 1px solid #e3e5e8; border-radius: 12px; background: #fff; }
.email-test-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { background: #fff; border: 1px solid #e3e5e8; border-radius: 16px; padding: 34px 28px; max-width: 430px; width: 100%; text-align: center; }
.logo-box-lg { width: 54px; height: 54px; border-radius: 12px; background: #2f6f4e; color: #fff; display: grid; place-items: center; margin: 0 auto 14px; font-size: 22px; font-weight: 700; }
.login-title { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.login-sub { font-size: 13px; color: #6b7280; line-height: 1.55; margin: 0 0 22px; }
.login-error { background: #fdecea; color: #c0492f; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.login-form { text-align: left; }

.settings-grid { display: grid; gap: 14px; }
.smtp-card { border: 1px solid #e3e5e8; border-radius: 12px; padding: 14px 16px; background: #fff; }
.smtp-card.default { border-color: #2f6f4e; background: #f8fbf9; }
.smtp-meta { font-size: 12px; color: #6b7280; margin-top: 4px; }
.smtp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

@media (max-width: 640px) {
  .money-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card-wide { grid-column: auto; }
  .email-preview-layout { grid-template-columns: 1fr; }
}

.public-schedule-card { max-width: 480px; }
.public-schedule-card-wide { max-width: 620px; text-align: left; }
.public-schedule-card-wide .login-title,
.public-schedule-card-wide .login-sub { text-align: left; }
.public-schedule-card-wide .public-schedule-brand { text-align: left; }
.public-schedule-brand { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: #2f6f4e; margin-bottom: 8px; }
.public-schedule-ref { font-size: 13px; font-weight: 700; color: #2f6f4e; }
.public-schedule-title { font-size: 15px; font-weight: 600; margin: 6px 0 0; }
.public-schedule-summary { background: #f8fbf9; border: 1px solid #cfe6d8; border-radius: 10px; padding: 14px 16px; margin: 16px 0 20px; }
.public-schedule-kv { margin: 12px 0 0; }
.public-schedule-kv div { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid #eef0f2; font-size: 13px; }
.public-schedule-kv dt { width: 38%; color: #6b7280; margin: 0; }
.public-schedule-kv dd { margin: 0; font-weight: 600; flex: 1; }
.public-schedule-confirmed { margin-top: 18px; padding: 14px 16px; background: #eaf6ee; border: 1px solid #cfe6d8; border-radius: 10px; }
.public-schedule-confirmed span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #6b7280; letter-spacing: .3px; }
.public-schedule-confirmed strong { display: block; margin-top: 6px; font-size: 18px; color: #2f6f4e; }
.public-schedule-form { text-align: left; }
.public-schedule-form .label { margin-top: 14px; display: block; }
.public-schedule-form .label:first-of-type { margin-top: 0; }
.public-schedule-picker {
  width: 100%;
  min-height: 44px;
  cursor: pointer;
  color-scheme: light;
}
.public-schedule-existing {
  margin: 16px 0;
  padding: 14px 16px;
  background: #fff8ef;
  border: 1px solid #f0dcc0;
  border-radius: 10px;
  text-align: left;
}
.public-schedule-existing-day {
  margin-top: 12px;
  background: #fdecea;
  border-color: #f2d6cf;
}
.public-schedule-existing-title {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #8a5a00;
}
.public-schedule-existing-day .public-schedule-existing-title { color: #c0492f; }
.public-schedule-existing-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #6b7280;
  line-height: 1.5;
}
.public-schedule-existing-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.public-schedule-existing-list li {
  padding: 10px 0;
  border-top: 1px solid #f0dcc0;
  font-size: 13px;
  line-height: 1.45;
}
.public-schedule-existing-list li:first-child { border-top: none; padding-top: 0; }
.public-schedule-existing-list strong { display: block; color: #1f2937; font-size: 14px; }
.public-schedule-existing-list span { display: block; color: #4b5563; margin-top: 2px; }
.public-schedule-existing-unit { color: #6b7280 !important; font-size: 12px !important; }
.schedule-help { margin: 0 0 10px; font-size: 12.5px; color: #6b7280; line-height: 1.45; }
.schedule-selection { margin: 8px 0 18px; font-size: 13px; font-weight: 600; color: #2f6f4e; }
.schedule-date-grid,
.schedule-time-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}
.schedule-date-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
.schedule-time-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.schedule-slot {
  border: 1px solid #d5d8dc;
  background: #fff;
  color: #1f2937;
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}
.schedule-slot:hover:not(:disabled) { border-color: #2f6f4e; background: #f2f8f4; }
.schedule-slot.is-selected { border-color: #2f6f4e; background: #2f6f4e; color: #fff; }
.schedule-slot.is-blocked {
  border-color: #e3e5e8;
  background: #f4f5f6;
  color: #9ca3af;
  cursor: not-allowed;
  text-decoration: line-through;
}
