:root {
  --bg: #f4f7fb;
  --sidebar: #fbfcfe;
  --card: #ffffff;
  --text: #1c2434;
  --muted: #8b95a7;
  --line: #e8edf4;
  --navy: #1c2434;
  --blue: #7db7ff;
  --orange: #f3b56b;
  --green: #22c55e;
  --pink: #ff5b7a;
  --shadow: 0 12px 30px rgba(28, 36, 52, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 70% -10%, #eef4ff 0%, transparent 55%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
}
a { color: var(--navy); text-decoration: none; }
.app { display: block; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 236px;
  background: linear-gradient(180deg, #fcfdff 0%, #f7f9fc 100%);
  border-right: 1px solid #eef2f7;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.brand b { font-size: 20px; letter-spacing: -0.03em; }
.logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #4b7cf3;
  background: #eef3ff;
  border: 1.5px solid #c9d8ff;
  font-weight: 800;
}
.nav-label {
  margin: 18px 8px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b7385;
  padding: 11px 12px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
}
.sidebar nav a svg { width: 18px; height: 18px; flex: none; }
.sidebar nav a.active {
  background: #eef1f6;
  color: var(--navy);
}
.sidebar nav a:hover { background: #f3f5f9; color: var(--navy); }
.badge {
  margin-left: auto;
  background: var(--pink);
  color: #fff;
  border-radius: 999px;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.side-foot {
  margin-top: auto;
  padding: 12px;
  background: #fff;
  border: 1px solid #e8edf4;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(28, 36, 52, 0.04);
}
a.account {
  color: inherit;
  text-decoration: none;
  border-radius: 14px;
  padding: 4px;
  margin: -4px -4px 8px;
  transition: background .15s ease;
}
a.account:hover, a.account.on { background: #f4f6fa; }
.account { display: flex; align-items: center; gap: 10px; }
.account > div { flex: 1; min-width: 0; }
.account-go { width: 18px; height: 18px; color: #a0a8b8; flex: none; }
.account .mark {
  position: relative;
  width: 40px;
  height: 40px;
  margin: 0;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
  background: #fff3e8;
  color: #e8893a;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mark i {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
}
.account b { display: block; font-size: 14px; letter-spacing: -0.02em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.profile-card {
  max-width: 520px;
  margin: 0 auto 24px;
  padding: 28px 24px 24px;
}
.profile-photo { display: grid; place-items: center; margin-bottom: 22px; }
.profile-avatar {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 36px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #fff3e8;
  color: #e8893a;
  font-size: 42px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(28, 36, 52, 0.08);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-avatar em {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 8px 6px;
  background: rgba(28, 36, 52, 0.62);
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}
.profile-fields { display: grid; gap: 4px; }
.profile-fields .grid2 { margin-bottom: 4px; }
.profile-fields button[type="submit"] { width: 100%; margin-top: 10px; }
.bot-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #d0d5dd; }
.bot-status.on { color: #16a34a; }
.bot-status.on .dot { background: #22c55e; }
.bot-status.off { color: var(--pink); }
.bot-status.off .dot { background: var(--pink); }
.logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  height: 40px;
  border-radius: 12px;
  background: #f4f6fa;
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
}
.logout svg { width: 16px; height: 16px; flex: none; }
.logout:hover { background: #eef1f6; }
.content {
  margin-left: 236px;
  padding: 28px 36px 48px;
  width: calc(100% - 236px);
  max-width: calc(100vw - 236px);
  overflow-x: hidden;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}
.topbar h1 { margin: 0; font-size: 32px; letter-spacing: -0.04em; }
.sub { margin: 6px 0 0; color: var(--muted); }
.sub:empty { display: none; }
.date-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.date-chip svg { width: 18px; height: 18px; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.kpi {
  background: #fff;
  border-radius: 22px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #f4f6fa;
  color: #6b7385;
  display: grid;
  place-items: center;
}
.kpi-icon svg { width: 22px; height: 22px; }
.kpi span { display: block; color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi strong { display: block; font-size: 28px; letter-spacing: -0.04em; margin-top: 2px; }
.report {
  margin: 4px 0 28px;
}
.report-chart svg { width: 100%; height: 180px; display: block; }
.chart-plot { position: relative; }
.chart-values { position: absolute; inset: 0; pointer-events: none; }
.chart-point {
  position: absolute;
  transform: translate(-50%, calc(-100% + 5px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.chart-point b {
  font-size: 13px;
  font-weight: 800;
  color: #3d7dff;
  line-height: 1;
}
.chart-point i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #7db7ff;
}
.chart-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 4px; }
.card {
  background: #fff;
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.table-card { padding: 18px 8px 8px; overflow: hidden; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 4px 16px 12px;
}
.card-head h2 { margin: 0; font-size: 18px; }
.head-tools { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f8fb;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
}
.search svg { width: 16px; height: 16px; }
.search input {
  border: 0;
  background: transparent;
  outline: none;
  width: 140px;
  padding: 0;
}
.ghost {
  background: #f6f8fb;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 13px;
}
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f4f8;
  vertical-align: middle;
  white-space: nowrap;
}
th { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.mono { color: var(--muted); font-weight: 600; }
.col-student {
  max-width: 260px;
  width: 260px;
}
.person {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 260px;
}
.person-meta {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.person b,
.person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.person small { color: var(--muted); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #eef3ff;
  color: #4b7cf3;
  display: grid;
  place-items: center;
  font-weight: 700;
  flex: none;
}
.empty { color: var(--muted); padding: 24px; }
.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 12px;
  color: #5b6577;
  font-weight: 600;
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.chip span {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef1f6;
  color: #5b6577;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}
.chip.new, .chip.pink { color: #be123c; }
.chip.seen, .chip.blue { color: #3b6de0; }
.chip.done, .chip.green { color: #15803d; }
.chip.cancelled, .chip.gray { color: #6b7385; }
.chip.orange { color: #c2410c; }
.chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.chip.active span {
  background: rgba(255,255,255,.16);
  color: #fff;
}
.form { padding: 22px; }
.form label { display: block; margin: 0 0 8px; font-weight: 700; }
.form label small { display: block; font-weight: 500; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.span2 { grid-column: 1 / -1; }
input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}
textarea { min-height: 88px; resize: vertical; }
button[type="submit"]:not(.link) {
  font: inherit;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  margin-top: 16px;
  cursor: pointer;
  font-weight: 700;
}
.check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-weight: 600; }
.check input { width: auto; }
.actions { display: flex; gap: 12px; align-items: center; }
.actions form { margin: 0; }
.link, .danger {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: auto;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.danger { color: var(--pink); }
.dim { opacity: .45; }
.status-form { margin: 0; }
.status {
  width: auto;
  min-width: 128px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
}
.status.new, .status.pink { background: #fff1f3; color: var(--pink); border-color: transparent; }
.status.seen, .status.blue { background: #eef3ff; color: #4b7cf3; border-color: transparent; }
.status.done, .status.green { background: #ecfdf3; color: #16a34a; border-color: transparent; }
.status.cancelled, .status.gray { background: #f4f6fa; color: #6b7385; border-color: transparent; }
.status.orange { background: #fff7ed; color: #c2410c; border-color: transparent; }
.muted-inline { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 500; }
.flash { padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: #ecfdf3; color: #166534; }
.flash.error { background: #fff1f3; color: #be123c; }
.auth .content { margin: 0; padding: 0; width: 100%; max-width: none; }
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.login-brand { margin-bottom: 18px; }
.login-card h1 { margin: 0; font-size: 28px; }
.login-card p, .login-card small { color: var(--muted); }
.login-card button { width: 100%; }
.login-card label { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 700; }
.add-btn {
  font: inherit;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
body.modal-open { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  background: rgba(28, 36, 52, 0.38);
  padding: 24px;
}
.modal.open { display: grid; }
.modal-card {
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  background: #fff;
  border-radius: 24px;
  padding: 22px 22px 18px;
  box-shadow: 0 24px 60px rgba(28, 36, 52, 0.18);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.modal-title { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.modal-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 12px;
  background: #f4f6fa;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  color: #6b7385;
}
.modal .form { padding: 0; box-shadow: none; margin: 0; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal-actions .ghost {
  border: 0;
  cursor: pointer;
  font: inherit;
}
.modal-actions [type="submit"] { margin-top: 0; }
.modal-actions { align-items: center; }
.modal .modal-actions > button { margin: 0; height: 44px; padding: 0 20px; border-radius: 14px; font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1; }
.modal-actions > .ghost { background: #f4f6fa; color: var(--navy); }
.modal-actions > .ghost:hover { background: #e9edf3; }
.board {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 8px;
}
.column {
  flex: 0 0 280px;
  background: #eef1f6;
  border-radius: 18px;
  padding: 12px;
}
.column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 4px 10px;
}
.column h2 { margin: 0; font-size: 15px; letter-spacing: -0.02em; }
.column header span {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.task-card {
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  margin: 0 0 8px;
  box-shadow: var(--shadow);
}
.task-card.done a { color: var(--muted); text-decoration: line-through; }
.check-task {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}
.check-task input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #16a34a;
  flex: none;
}
.check-task span { display: block; min-width: 0; }
.check-task small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.task-card .late { color: var(--pink); font-style: normal; }
.add-task-btn {
  width: 100%;
  height: 44px;
  margin-top: 4px;
  border: 1px dashed #cfd6e2;
  border-radius: 14px;
  background: transparent;
  color: #6b7385;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.add-task-btn:hover { background: #fff; color: var(--navy); }
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.ticket-head a { color: inherit; text-decoration: none; }
.ticket-head a:hover { text-decoration: underline; }
.ticket-actions { display: flex; gap: 8px; margin-top: 16px; }
.ticket-actions > * { font: inherit; flex: 1; display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 12px; border: 0; border-radius: 12px; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-pay { background: #f4f6fa; color: var(--navy); }
.btn-pay:hover { background: #e9edf3; }
.btn-soft { background: #f4f6fa; color: var(--navy); }
.btn-soft:hover { background: #e9edf3; }
.ticket {
  display: block;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--shadow);
  color: inherit;
  padding: 18px 22px 16px;
}
.ticket:hover { box-shadow: 0 14px 34px rgba(28, 36, 52, 0.09); }
.ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket-head b { font-size: 18px; letter-spacing: -0.03em; }
.ticket-who { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.ticket-line { margin: 8px 0 0; font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.ticket-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f1f4f8;
}
.ticket-facts span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.ticket-facts b { display: block; margin-top: 3px; font-size: 14px; letter-spacing: -0.02em; }
.meter { height: 8px; margin-top: 14px; background: #e7edf4; border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: #1c2434; border-radius: 999px; }
.meter.pay { display: flex; background: #ff8fa3; }
.meter.pay i { background: #22c55e; border-radius: 999px 0 0 999px; }
.meter.pay i[style*="100%"] { border-radius: 999px; }
.meter-note { margin: 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.forecast-title { margin: 18px 0 12px; font-size: 15px; letter-spacing: -0.02em; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.chart-card { margin-bottom: 18px; }
.chart-card .card-head { padding: 0 0 4px; }
.chart-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.legend { display: flex; gap: 16px; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.swatch.in { background: #1c2434; }
.swatch.out { background: #ff8fa3; }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; }
.bar-pair { height: 180px; padding-top: 20px; display: flex; align-items: flex-end; justify-content: center; gap: 12px; border-bottom: 1px solid #e6e9ef; background: repeating-linear-gradient(to top, transparent 0 44px, #f1f3f7 44px 45px); }
.bar { width: 22px; border-radius: 7px 7px 3px 3px; background: #1c2434; position: relative; }
.bar.out { background: #ff8fa3; }
.bar b { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); font-size: 10px; line-height: 1; white-space: nowrap; }
.bar.out b { color: #be123c; }
.bar-col { text-align: center; }
.bar-col > span { display: block; margin-top: 10px; font-size: 13px; font-weight: 700; }
.unit { color: var(--muted); font-size: 12px; font-weight: 700; }
.bar-col small { display: block; font-size: 11px; font-weight: 700; line-height: 1.35; }
.bar-col small.out { color: #be123c; }
.hbar { display: grid; grid-template-columns: minmax(120px, 180px) 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; }
.hbar span { font-weight: 700; font-size: 14px; }
.hbar-track { height: 10px; background: #f4f6fa; border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; min-width: 4px; background: #1c2434; border-radius: 999px; }
.hbar b { font-size: 13px; white-space: nowrap; }
.neg { color: #be123c; }
.kpi strong { font-size: 22px; white-space: nowrap; }
.fc-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.fc-sum div, .fc-facts div { background: #f8fafc; border-radius: 16px; padding: 12px 14px; }
.fc-sum span, .fc-facts span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.fc-sum b { display: block; margin-top: 4px; font-size: 17px; letter-spacing: -0.02em; white-space: nowrap; }
.fc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.fc-facts b { display: block; margin-top: 3px; font-size: 14px; white-space: nowrap; }
.bars-5 { grid-template-columns: repeat(5, 1fr); }
.bar.in { overflow: visible; }
.bar-new { position: absolute; left: 0; right: 0; top: 0; background: #7db7ff; border-radius: 6px 6px 0 0; }
.swatch.new { background: #7db7ff; }
.bar-col small.muted { color: var(--muted); }
.fc-chart { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.fc-bars { height: 220px; padding-top: 22px; display: flex; align-items: flex-end; justify-content: center; gap: 8px; border-bottom: 1px solid #e6e9ef; background: repeating-linear-gradient(to top, transparent 0 54px, #f1f3f7 54px 55px); }
.fc-bar { width: 34px; border-radius: 8px 8px 3px 3px; background: #1c2434; position: relative; }
.fc-bar.out { background: #ff8fa3; }
.fc-bar b { position: absolute; left: 50%; bottom: calc(100% + 5px); transform: translateX(-50%); font-size: 12px; white-space: nowrap; }
.fc-bar.out b { color: #be123c; }
.fc-bar .bar-new { border-radius: 8px 8px 0 0; }
.fc-col { text-align: center; }
.fc-col > span { display: block; margin-top: 10px; font-size: 13px; font-weight: 700; }
.fc-col em { display: inline-block; margin-top: 6px; padding: 3px 9px; border-radius: 999px; background: #eef5ff; color: #2f6fd6; font-size: 11px; font-style: normal; font-weight: 700; }
.fc-table { margin-top: 22px; }
.pie-wrap { display: flex; align-items: center; gap: 28px; padding-top: 6px; }
.pie { flex: 0 0 180px; height: 180px; border-radius: 50%; display: grid; place-items: center; }
.pie > div { width: 112px; height: 112px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.pie span { color: var(--muted); font-size: 11px; font-weight: 700; }
.pie b { margin-top: 2px; font-size: 13px; white-space: nowrap; }
.pie-legend { flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; }
.pie-legend li { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid #f1f3f7; font-size: 13px; }
.pie-legend li:last-child { border-bottom: 0; }
.pie-legend i { width: 10px; height: 10px; border-radius: 3px; }
.pie-legend span { font-weight: 700; }
.pie-legend em { color: var(--muted); font-style: normal; font-weight: 700; font-size: 12px; }
.pie-legend b { white-space: nowrap; }
.hbar-fill.out { background: #ff8fa3; }
.tag { margin-left: 6px; padding: 2px 7px; border-radius: 999px; font-style: normal; font-size: 11px; font-weight: 700; }
.tag.hi { background: #fff1f3; color: #e11d48; }
.tag.lo { background: #ecfdf3; color: #16a34a; }
.block-title { margin: 6px 0 12px; font-size: 18px; letter-spacing: -0.02em; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  display: block;
  background: #fff;
  border-radius: 22px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  color: inherit;
  border: 1.5px solid transparent;
}
.stat:hover { box-shadow: 0 14px 34px rgba(28, 36, 52, 0.09); }
.stat.on { border-color: #1c2434; }
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: #f4f6fa;
  color: #6b7385;
}
.stat-icon svg { width: 20px; height: 20px; }
.stat-icon.green { background: #ecfdf3; color: #16a34a; }
.stat-icon.pink { background: #fff1f3; color: #e11d48; }
.stat-icon.blue { background: #eef3ff; color: #4b7cf3; }
.stat span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.stat strong { display: block; margin-top: 4px; font-size: 22px; letter-spacing: -0.03em; white-space: nowrap; }
.stat small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.table-card { max-width: 100%; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.back-link svg { width: 18px; height: 18px; }
.back-link:hover { color: var(--navy); }
.pd-about { padding: 18px 20px; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.pd-meta > span { color: var(--muted); font-size: 13px; font-weight: 700; }
.pd-hero { padding: 22px 22px 20px; }
.pd-label { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
.pd-main { display: block; margin-top: 4px; font-size: 36px; letter-spacing: -0.04em; line-height: 1.1; }
.pd-hint { margin: 8px 0 0; color: #5b6577; font-size: 14px; line-height: 1.45; }
.pd-split { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.pd-split span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.pd-split b { display: block; margin-top: 4px; font-size: 18px; letter-spacing: -0.03em; white-space: nowrap; }
.pd-next {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f4f6fa;
}
.pd-next.late { background: #fff1f3; }
.pd-next span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.pd-next.late span { color: #e11d48; }
.pd-next b { display: block; margin-top: 3px; font-size: 14px; letter-spacing: -0.02em; }
.pd-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #eef0f4;
}
.pd-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pd-row:first-of-type { padding-top: 4px; }
.pd-row-main b, .pd-row-sum b { display: block; font-size: 15px; letter-spacing: -0.02em; }
.pd-row-main small, .pd-row-sum small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 600; }
.pd-row-sum { text-align: right; }
.pd-row .status { justify-self: end; }
.p-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.p-facts div { background: #f8fafc; border-radius: 16px; padding: 12px 14px; }
.p-facts span, .p-sums span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.p-facts b { display: block; margin-top: 4px; font-size: 14px; }
.p-desc { margin: 12px 0 0; color: #5b6577; font-size: 14px; line-height: 1.5; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-style: normal; font-size: 12px; font-weight: 700; }
.pill.green { background: #ecfdf3; color: #16a34a; }
.pill.orange { background: #fff7ed; color: #c2410c; }
.pill.gray { background: #eef1f6; color: #6b7385; }
.p-money .card-head { padding: 0 0 12px; }
.p-sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.p-sums b { display: block; margin-top: 4px; font-size: 22px; letter-spacing: -0.03em; white-space: nowrap; }
.pos { color: #16a34a; }
.filters:has(.period) { overflow: visible; align-items: center; }
.period { position: relative; }
.period-btn { font: inherit; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); color: var(--navy); font-weight: 600; cursor: pointer; white-space: nowrap; }
.period-btn svg { width: 18px; height: 18px; }
.period.open .period-btn { border-color: var(--navy); }
.period-pop { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: 320px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 18px 40px rgba(28, 36, 52, .12); }
.period.open .period-pop { display: block; }
.period-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 14px; background: #f4f6fa; border-radius: 12px; }
.period-tabs button { font: inherit; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #5b6577; font-size: 13px; font-weight: 700; cursor: pointer; }
.period-tabs button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(28, 36, 52, .08); }
.period-year { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.period-year b { font-size: 15px; }
.period-year button { font: inherit; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.period-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.period-months button { font: inherit; height: 40px; border: 0; border-radius: 10px; background: #f8fafc; color: var(--navy); font-weight: 700; cursor: pointer; }
.period-months button:hover { background: #eef1f6; }
.period-months button.on { background: var(--navy); color: #fff; }
.period-pane[hidden] { display: none; }
form.period-pane { display: grid; gap: 10px; }
form.period-pane label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
form.period-pane .add-btn { width: 100%; justify-content: center; }
.kpi-box { padding: 14px; border-radius: 16px; background: #f8fafc; }
.kpi-head, .kpi-line { display: grid; grid-template-columns: 1fr 160px 36px; gap: 8px; align-items: center; }
.kpi-head { margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi-line + .kpi-line { margin-top: 8px; }
.kpi-line input, .kpi-line select { background: #fff; }
.kpi-del { width: 36px; height: 36px; border: 0; border-radius: 10px; background: #fff; color: var(--muted); font-size: 18px; cursor: pointer; }
.kpi-add { margin-top: 10px; padding: 8px 12px; border: 1px dashed #cfd6e1; border-radius: 12px; background: transparent; color: var(--navy); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.kpi-inline { display: grid; grid-template-columns: 1fr 180px auto; gap: 8px; padding: 12px 16px 6px; }
.kpi-inline button[type="submit"] { margin: 0; }
.link-btn, button.link-btn[type="submit"] { padding: 0; margin: 0; border: 0; border-radius: 0; background: none; color: var(--pink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; margin: 0; border: 0; border-radius: 10px; background: #f4f6fa; color: var(--text); cursor: pointer; }
.icon-btn:hover { background: #e9edf4; }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cell-edit { padding: 0; margin: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-bottom: 1px dashed #c3c9d4; }
.hist-list { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.hist-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #eef0f4; }
.hist-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.hist-list li span { display: grid; gap: 2px; }
.hist-list small { color: var(--muted); font-size: 12px; }
.row-actions .btn-soft { height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: #f4f6fa; color: var(--navy); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.row-actions .btn-soft:hover { background: #e9edf4; }
.perm-grid { display: grid; gap: 10px; }
.perm-block { background: #f6f8fb; border-radius: 16px; padding: 12px 14px; }
.perm-block h3 { margin: 0 0 8px; font-size: 14px; }
.perm-block .checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.form .perm-block .check { display: flex; margin: 0; font-size: 13px; font-weight: 600; }
.form .perm-scope { margin: 10px 0 0; }
.perm-note { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.fin-hero { text-align: center; padding: 26px 20px 20px; }
.fin-label { color: var(--muted); font-size: 13px; font-weight: 700; }
.fin-net { display: block; margin-top: 6px; font-size: 40px; font-weight: 800; letter-spacing: -0.04em; white-space: nowrap; }
.fin-spark { display: block; width: min(360px, 100%); height: 56px; margin: 12px auto 0; }
.fin-spark polyline { fill: none; stroke: #22c55e; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.fin-spark.down polyline { stroke: #f43f5e; }
.fin-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.fin-split a { display: block; padding: 12px; border-radius: 16px; background: #f8fafc; color: inherit; text-decoration: none; }
.fin-split a:hover { background: #f1f4f8; }
.fin-split span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.fin-split b { display: block; margin-top: 3px; font-size: 16px; white-space: nowrap; }
.fin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 6px; }
.fin-tabs { display: inline-flex; gap: 2px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.fin-tabs a { padding: 7px 14px; border-radius: 10px; color: #5b6577; font-size: 13px; font-weight: 700; text-decoration: none; }
.fin-tabs a.on { background: var(--navy); color: #fff; }
.fin-day { display: flex; justify-content: space-between; gap: 12px; padding: 16px 8px 8px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.fin-day b { white-space: nowrap; }
.fin-list { padding: 6px; margin-bottom: 4px; }
.fin-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; }
.fin-row.tap { cursor: pointer; }
.fin-row.tap:hover, .fin-row.tap:focus-visible { background: #f8fafc; outline: none; }
.fin-row.dim .fin-amt { text-decoration: line-through; }
.fin-ico { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-style: normal; }
.fin-ico svg { width: 20px; height: 20px; }
.c-project_payment { background: #ecfdf3; color: #16a34a; }
.c-other { background: #eef5ff; color: #2f6fd6; }
.c-salary { background: #f3efff; color: #7c3aed; }
.c-bonus { background: #fff7e6; color: #d97706; }
.c-ads { background: #fff1f3; color: #e11d48; }
.c-software { background: #eef5ff; color: #2563eb; }
.c-office { background: #fff3e8; color: #e8893a; }
.c-transport { background: #e8f7f5; color: #0d9488; }
.c-project { background: #f1f5f9; color: #475569; }
.c-other_expense, .c-custom { background: #f4f6fa; color: #6b7385; }
.settings-cat-note { margin: 0 0 14px; }
.settings-cats { margin: 0 0 16px; }
.settings-cat-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 700; }
.settings-cats .fin-ico { flex-basis: 28px; width: 28px; height: 28px; border-radius: 50%; }
.settings-cats .fin-ico svg { width: 15px; height: 15px; }
.settings-cat-del { display: inline-flex; margin: 0 0 0 2px; }
.settings-cat-del button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: #f4f6fa; color: #6b7385; font: inherit; font-size: 16px; line-height: 1; cursor: pointer; }
.settings-cat-del button:hover { background: #ffe4e8; color: #e11d48; }
.settings-cat-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 0; padding-top: 4px; border-top: 1px solid var(--line); }
.settings-cat-form label { flex: 1 1 220px; margin: 0; }
.settings-cat-form button { flex: 0 0 auto; height: 42px; }
.fin-main { flex: 1; min-width: 0; }
.fin-main b, .fin-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-main b { font-size: 14px; }
.fin-main small { margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.fin-amt { font-size: 15px; font-weight: 800; white-space: nowrap; }
.fin-amt.pos, .fin-day b.pos { color: #16a34a; }
.fab { position: fixed; right: 32px; bottom: 28px; z-index: 60; height: 52px; padding: 0 24px; border: 0; border-radius: 16px; background: var(--navy); color: #fff; font: inherit; font-size: 15px; font-weight: 700; box-shadow: 0 12px 28px rgba(28, 36, 52, .28); cursor: pointer; }
.fab:hover { background: #2a3447; }
body:has(.fab) .content { padding-bottom: 100px; }
.fin-kind { display: inline-flex; padding: 4px; background: #f4f6fa; border-radius: 12px; }
.fin-kind label { position: relative; margin: 0; }
.fin-kind input, .fin-cats input { position: absolute; opacity: 0; pointer-events: none; }
.fin-kind span { display: block; padding: 8px 18px; border-radius: 9px; color: #5b6577; font-size: 14px; font-weight: 700; cursor: pointer; }
.fin-kind input:checked + span { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(28, 36, 52, .08); }
.form .fin-amount { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 6px 0 18px; }
.fin-amount input { max-width: 340px; padding: 6px 4px; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent; font-size: 38px; font-weight: 800; letter-spacing: -0.03em; text-align: center; outline: none; }
.fin-amount input:focus { border-bottom-color: var(--navy); }
.fin-amount span { color: var(--muted); font-size: 18px; font-weight: 700; }
.fin-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.form .fin-cats label { position: relative; margin: 0; }
.fin-cats span { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
.fin-cats .fin-ico { flex-basis: 28px; width: 28px; height: 28px; border-radius: 50%; }
.fin-cats .fin-ico svg { width: 15px; height: 15px; }
.fin-cats input:checked + span { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.form .fin-field { display: grid; gap: 6px; margin-bottom: 14px; }
.fin-cats[hidden], .form .fin-field[hidden] { display: none; }
button[type="submit"].fin-save { width: 100%; height: 50px; font-size: 15px; }
button[type="submit"].fin-danger { margin-top: 0; background: #e11d48; }
@media (max-width: 720px) {
  .fab { right: auto; left: 50%; bottom: 18px; transform: translateX(-50%); }
  .fin-net { font-size: 34px; }
  .fin-modal { padding: 0; place-items: end center; }
  .fin-modal .modal-card { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; }
  .fin-modal .grid2 { grid-template-columns: 1fr 1fr; }
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.m-head, .tabbar, .m-val { display: none; }
@media (max-width: 900px) {
  .content { padding: 24px 22px 40px; }
  .kpi-row { gap: 12px; }
  .kpi { padding: 16px; }
  .kpi strong { font-size: 19px; }
  .chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }
  input, select, textarea { font-size: 16px; }
  .sidebar { display: none; }
  .m-head { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(247, 249, 252, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid #eef2f7; }
  .m-head b { flex: 1; font-size: 18px; letter-spacing: -0.03em; }
  .m-profile { display: grid; place-items: center; }
  .m-head .mark { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: #fff3e8; color: #e8893a; font-weight: 800; overflow: hidden; }
  .m-head .mark i { display: none; }
  .m-out { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--navy); }
  .profile-card { max-width: none; padding: 22px 16px 18px; margin-bottom: 18px; }
  .profile-avatar { width: 96px; height: 96px; border-radius: 30px; font-size: 34px; }
  .profile-fields .grid2 { grid-template-columns: 1fr; }
  .m-out svg { width: 17px; height: 17px; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid #e8edf4; }
  .tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; color: #8b95a7; font-size: 10.5px; font-weight: 700; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a.active { color: var(--navy); }
  .tabbar a.active svg { stroke-width: 2.2; }
  .content { margin-left: 0; width: 100%; max-width: 100vw; padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
  body:has(.fab) .content { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  .topbar { align-items: center; margin-bottom: 16px; gap: 10px; }
  .topbar h1 { font-size: 24px; }
  .topbar > div:first-child { min-width: 0; }
  .sub { font-size: 13px; }
  .date-chip { display: none; }
  .period-btn { padding: 9px 12px; font-size: 13px; }
  .period-pop { position: fixed; top: auto; left: 12px; right: 12px; width: auto; bottom: calc(80px + env(safe-area-inset-bottom)); }

  .card { border-radius: 20px; padding: 16px; margin-bottom: 14px; }
  .table-card { padding: 12px 0 4px; }
  .card-head { padding: 2px 16px 10px; flex-wrap: wrap; }
  .card-head h2 { font-size: 17px; }
  .chart-card .card-head { padding: 0 0 4px; }

  .kpi-row { grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
  .kpi { padding: 14px 16px; border-radius: 18px; }
  .kpi-icon { width: 42px; height: 42px; border-radius: 14px; }
  .kpi strong { font-size: 22px; }
  .kpi-tasks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .kpi-tasks .kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .kpi-tasks .kpi-icon { width: 32px; height: 32px; border-radius: 10px; }
  .kpi-tasks .kpi-icon svg { width: 17px; height: 17px; }
  .kpi-tasks .kpi span { font-size: 11px; line-height: 1.25; }
  .kpi-tasks .kpi strong { font-size: 22px; }

  .bars { gap: 4px; }
  .bar-pair { height: 150px; padding-top: 6px; gap: 3px; background: repeating-linear-gradient(to top, transparent 0 36px, #f1f3f7 36px 37px); }
  .bar { width: min(14px, 38%); border-radius: 5px 5px 2px 2px; }
  .bar b, .fc-bar b { display: none; }
  .bar-col > span, .fc-col > span { margin-top: 8px; font-size: 12px; }
  .m-val { display: block; font-size: 10.5px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
  .m-val.out { color: #be123c; }
  .m-val:empty { display: none; }
  .fc-chart { gap: 4px; }
  .fc-bars { height: 170px; padding-top: 6px; gap: 3px; background: repeating-linear-gradient(to top, transparent 0 41px, #f1f3f7 41px 42px); }
  .fc-bar { width: min(18px, 40%); border-radius: 6px 6px 2px 2px; }
  .fc-col > span { font-size: 11px; line-height: 1.3; }
  .fc-col em { padding: 2px 6px; font-size: 10px; white-space: nowrap; }
  .legend { flex-wrap: wrap; gap: 8px 14px; }
  .pie-wrap { flex-direction: column; align-items: stretch; gap: 18px; }
  .pie { margin: 0 auto; flex-basis: 170px; width: 170px; height: 170px; }

  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; min-width: 0; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 12px 16px; border-bottom: 1px solid #f1f4f8; }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { padding: 4px 0; border: 0; white-space: normal; text-align: right; font-size: 14px; overflow-wrap: anywhere; }
  .table-wrap td::before { content: attr(data-label); float: left; margin-right: 12px; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 20px; }
  .table-wrap td:first-child { text-align: left; font-size: 15px; padding-bottom: 6px; }
  .table-wrap td:first-child::before, .table-wrap td[data-label=""]::before, .table-wrap td.empty::before { display: none; }
  .table-wrap td.empty { text-align: center; }
  .table-wrap td .muted-inline { margin-top: 2px; }
  .table-wrap td.row-actions, .table-wrap td[data-label=""] { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
  .table-wrap .actions { justify-content: flex-end; flex-wrap: wrap; }
  .table-wrap .status { min-width: 0; }
  .icon-btn { width: 40px; height: 40px; border-radius: 12px; }

  .filters { flex-wrap: wrap; }
  .search { flex: 1; min-width: 0; }
  .search input { width: 100%; }
  .add-btn { height: 40px; }
  .project-list { grid-template-columns: 1fr; gap: 12px; }
  .ticket { padding: 16px; border-radius: 20px; }
  .ticket-actions { flex-wrap: wrap; }
  .ticket-actions > * { flex: 1 1 auto; height: 42px; }

  .board { gap: 10px; margin: 0 -14px; padding: 0 14px 8px; scroll-snap-type: x mandatory; scroll-padding: 0 14px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .board::-webkit-scrollbar { display: none; }
  .column { flex: 0 0 84%; scroll-snap-align: start; }
  .task-card { padding: 12px; }
  .check-task input { width: 20px; height: 20px; }

  .grid2, .stat-grid, .fc-sum, .p-sums, .chart-grid, .kpi-inline { grid-template-columns: 1fr; gap: 10px; }
  .grid2 { gap: 0 12px; }
  .grid2 > label { margin-bottom: 12px; }
  .ticket-facts { grid-template-columns: 1fr 1fr; }
  .p-sums b, .stat strong { font-size: 20px; }
  .pd-main { font-size: 30px; }
  .pd-split { grid-template-columns: 1fr; gap: 10px; }
  .pd-split > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; background: #f8fafc; border-radius: 12px; }
  .pd-split b { margin: 0; font-size: 16px; }
  .pd-row { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .pd-row .status { grid-column: 1 / -1; justify-self: start; }
  .topbar .add-btn { height: 40px; padding: 0 12px; font-size: 13px; }
  .p-facts { grid-template-columns: 1fr 1fr; }
  .hbar { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .hbar-track { grid-column: 1 / -1; grid-row: 2; }
  .kpi-head, .kpi-line { grid-template-columns: 1fr 120px 36px; }

  .modal { padding: 0; place-items: end center; }
  .modal-card { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
  .modal-card[style] { width: 100% !important; }
  .modal-actions { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); margin: 14px -16px calc(-16px - env(safe-area-inset-bottom)); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #f1f4f8; }
  .modal .modal-actions > button { flex: 1; height: 48px; }
  .fin-modal .grid2 { grid-template-columns: 1fr 1fr; }

  .fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .fin-bar { flex-wrap: wrap; }
  .fin-hero { padding: 20px 14px 16px; }
  .fin-amount input { font-size: 32px; }

  .login-card { width: 100%; padding: 26px 22px; }
  .flash { font-size: 14px; }
}
@media (max-width: 380px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .topbar h1 { font-size: 22px; }
  .kpi strong { font-size: 20px; }
  .tabbar a { font-size: 9.5px; }
}
