:root {
  --bg: #f3f0ea;
  --bg2: #fbfaf7;
  --card: rgba(255,255,255,.88);
  --card-solid: #ffffff;
  --text: #111111;
  --muted: #77736b;
  --soft-muted: #a29d93;
  --border: rgba(20,20,20,.09);
  --black: #101010;
  --black2: #1b1b1b;
  --gold: #b08a3c;
  --gold2: #d8c28a;
  --cream: #f7f1e4;
  --shadow: 0 22px 50px rgba(20, 20, 20, .075);
  --shadow-soft: 0 12px 28px rgba(20, 20, 20, .055);
  --green-bg: #e8f7ee;
  --green: #14703c;
  --red-bg: #fff0f0;
  --red: #b4232a;
  --amber-bg: #fff6da;
  --amber: #8a5b00;
  --violet-bg: #f1edff;
  --violet: #6242a6;
  --blue-bg: #eaf2ff;
  --blue: #2457b8;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Inter, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(216,194,138,.32), transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(0,0,0,.06), transparent 24%),
    linear-gradient(180deg, #fbfaf7 0%, #f3f0ea 55%, #eeebe4 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input, textarea, select { font: inherit; }
h1, h2, h3, p { margin: 0; }

.app {
  min-height: 100vh;
  max-width: 1260px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 292px 1fr;
}

aside {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px;
  background: rgba(255,255,255,.58);
  backdrop-filter: blur(26px);
  border-right: 1px solid rgba(20,20,20,.08);
}

aside::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(176,138,60,.22);
  border-radius: 34px;
  pointer-events: none;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
  padding: 8px 4px 18px;
  border-bottom: 1px solid rgba(20,20,20,.08);
}

.logo {
  width: 54px;
  height: 54px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 32% 20%, #4a4a4a 0%, #171717 45%, #050505 100%);
  color: var(--gold2);
  display: grid;
  place-items: center;
  font-size: 25px;
  box-shadow: 0 16px 36px rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.16);
}

.brand h1 {
  font-size: 22px;
  letter-spacing: -.045em;
  font-weight: 920;
}

.muted, .brand p {
  color: var(--muted);
}

.brand p {
  margin-top: 3px;
  font-size: 13px;
  font-weight: 650;
}

nav {
  position: relative;
  display: grid;
  gap: 9px;
}

.navbtn {
  width: 100%;
  border: 0;
  background: transparent;
  color: #5f5a52;
  border-radius: 19px;
  padding: 14px 15px;
  text-align: left;
  cursor: pointer;
  font-weight: 820;
  letter-spacing: -.012em;
  transition: transform .14s ease, background .14s ease, color .14s ease, box-shadow .14s ease;
}

.navbtn:hover {
  background: rgba(255,255,255,.72);
  transform: translateY(-1px);
}

.navbtn.active {
  background:
    linear-gradient(135deg, #111 0%, #202020 100%);
  color: white;
  box-shadow: 0 16px 34px rgba(0,0,0,.18);
}

.navbtn.active::after {
  content: "";
  float: right;
  width: 7px;
  height: 7px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--gold2);
  box-shadow: 0 0 0 4px rgba(216,194,138,.17);
}

main {
  padding-bottom: 92px;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 24px 30px;
  background: rgba(243,240,234,.76);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(20,20,20,.07);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.title small {
  display: block;
  font-weight: 820;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.title h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4.2vw, 52px);
  letter-spacing: -.055em;
  line-height: .92;
  font-weight: 900;
}

.content {
  padding: 24px 30px 34px;
}

.grid {
  display: grid;
  gap: 16px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.card h3 {
  font-size: 20px;
  letter-spacing: -.025em;
}

.stat {
  position: relative;
  overflow: hidden;
}

.stat::after {
  content: "";
  position: absolute;
  width: 90px;
  height: 90px;
  right: -24px;
  bottom: -34px;
  border-radius: 999px;
  background: rgba(176,138,60,.12);
}

.stat .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.stat .value {
  margin-top: 10px;
  font-size: 40px;
  font-weight: 950;
  letter-spacing: -.055em;
  font-family: Georgia, "Times New Roman", serif;
}

.hero {
  background:
    radial-gradient(circle at top right, rgba(216,194,138,.30), transparent 30%),
    linear-gradient(135deg, #090909 0%, #1b1b1b 100%);
  color: white;
  border-radius: 36px;
  padding: 30px;
  box-shadow: 0 24px 58px rgba(0,0,0,.25);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,.12);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(216,194,138,.22);
  border-radius: 27px;
  pointer-events: none;
}

.hero h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  letter-spacing: -.045em;
  margin-top: 14px;
}

.hero p {
  margin-top: 10px;
  color: #c7c3ba;
  max-width: 650px;
  line-height: 1.45;
}

.btn {
  border: 0;
  background:
    linear-gradient(135deg, #111 0%, #242424 100%);
  color: white;
  padding: 12px 17px;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  box-shadow: 0 12px 26px rgba(0,0,0,.13);
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(0,0,0,.16);
}

.btn.light {
  background: white;
  color: var(--black);
  box-shadow: 0 12px 26px rgba(255,255,255,.15);
}

.btn.soft {
  background: rgba(255,255,255,.82);
  color: #151515;
  border: 1px solid rgba(20,20,20,.08);
  box-shadow: none;
}

.btn.full {
  width: 100%;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.list {
  display: grid;
  gap: 13px;
}

.item {
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(20,20,20,.08);
  border-radius: 27px;
  padding: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,.038);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(176,138,60,.26);
}

.item strong {
  display: block;
  font-size: 17px;
  letter-spacing: -.018em;
}

.item span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
  line-height: 1.35;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: .01em;
  border: 1px solid rgba(0,0,0,.05);
}

.pill.green { background: var(--green-bg); color: var(--green); }
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.violet { background: var(--violet-bg); color: var(--violet); }
.pill.blue { background: var(--blue-bg); color: var(--blue); }

.next-step {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  color: #6b4a00;
  background: rgba(255, 247, 214, .92);
  border: 1px solid rgba(176, 112, 0, .16);
  border-radius: 16px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 900;
}

.next-step .muted {
  color: #8a6a17;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  align-items: center;
}

.search {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(20,20,20,.08);
  border-radius: 20px;
  padding: 15px 17px;
  box-shadow: 0 10px 26px rgba(0,0,0,.035);
  outline: 1px solid transparent;
  transition: outline-color .14s ease, background .14s ease, box-shadow .14s ease;
}

.search:focus {
  outline-color: rgba(176,138,60,.72);
  background: white;
  box-shadow: 0 14px 30px rgba(0,0,0,.06);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.calendar-swipe {
  touch-action: pan-y;
}

.dayhead {
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  padding: 7px;
  text-transform: uppercase;
}

.day {
  min-height: 122px;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(20,20,20,.08);
  border-radius: 22px;
  padding: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}

.day:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0,0,0,.07);
  border-color: rgba(176,138,60,.35);
  background: white;
}

.day.out {
  opacity: .42;
}

.daynum {
  font-size: 13px;
  font-weight: 950;
  color: #524d44;
  margin-bottom: 8px;
}

.eventchip {
  display: block;
  width: 100%;
  border: 0;
  text-align: left;
  background: #f4f1eb;
  color: #171717;
  border-radius: 13px;
  padding: 7px 8px;
  margin-top: 6px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 740;
  border-left: 3px solid var(--gold);
}

.eventchip.done { background: var(--green-bg); color: var(--green); border-left-color: var(--green); }
.eventchip.cancelled { background: var(--red-bg); color: var(--red); border-left-color: var(--red); }
.eventchip.pending { background: var(--amber-bg); color: var(--amber); border-left-color: var(--amber); }

.bottomnav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(22px);
  border-top: 1px solid rgba(20,20,20,.08);
  padding: 7px 8px max(8px, env(safe-area-inset-bottom));
}

.bottomnav .inner {
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
}

.tab {
  border: 0;
  background: transparent;
  padding: 9px 4px;
  border-radius: 16px;
  color: #6c675f;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.tab.active {
  color: #111;
  background: #f0ebe1;
  box-shadow: inset 0 0 0 1px rgba(176,138,60,.16);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,.46);
  backdrop-filter: blur(10px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
}

.modal.open {
  display: flex;
}

.sheet {
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  overflow: auto;
  background: #fbfaf7;
  border-radius: 34px;
  box-shadow: 0 28px 80px rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.36);
}

.sheethead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 19px 21px;
  border-bottom: 1px solid rgba(20,20,20,.08);
  position: sticky;
  top: 0;
  background: rgba(251,250,247,.94);
  backdrop-filter: blur(18px);
  z-index: 2;
}

.sheethead h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  letter-spacing: -.025em;
}

.sheetbody {
  padding: 21px;
}

label {
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin: 13px 0 7px;
  text-transform: uppercase;
  letter-spacing: .045em;
  color: #4e493f;
}

input, textarea, select {
  width: 100%;
  border: 1px solid rgba(20,20,20,.10);
  border-radius: 18px;
  padding: 13px 14px;
  background: rgba(255,255,255,.74);
  outline: none;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease;
}

input:focus, textarea:focus, select:focus {
  background: white;
  border-color: rgba(176,138,60,.75);
  box-shadow: 0 0 0 4px rgba(176,138,60,.12);
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.formgrid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 11px;
}

.toast {
  position: fixed;
  z-index: 80;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: white;
  border-radius: 999px;
  padding: 12px 17px;
  box-shadow: 0 16px 42px rgba(0,0,0,.28);
  display: none;
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.12);
}

.toast.show {
  display: block;
}

.error {
  color: var(--red);
  font-weight: 900;
}

@media (max-width: 880px) {
  .app { display: block; }
  aside { display: none; }
  header { padding: 19px 16px; }
  .content { padding: 16px; }
  .stats, .two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { display: block; padding: 24px; }
  .hero .btn { margin-top: 18px; width: 100%; }
  .bottomnav { display: block; }
  .calendar { gap: 5px; }
  .day { min-height: 90px; border-radius: 15px; padding: 7px; }
  .eventchip { font-size: 10px; padding: 5px 6px; }
}

@media (max-width: 520px) {
  .stats, .two { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .item { align-items: flex-start; flex-direction: column; }
  .formgrid { grid-template-columns: 1fr; }
  .title h2 { font-size: 34px; }
  .content { padding: 14px; }
  .card { border-radius: 24px; padding: 18px; }
  .stat .value { font-size: 36px; }
}
  
.monthly-report-modal {
  max-width: 980px;
}

.monthly-report h1 {
  font-size: 34px;
  margin-bottom: 4px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.report-card {
  border: 1px solid rgba(17,17,17,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  padding: 16px;
}

.report-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: .04em;
}

.report-value {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 900;
  margin-top: 8px;
}

.monthly-report table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 14px;
}

.monthly-report th,
.monthly-report td {
  border-bottom: 1px solid rgba(17,17,17,.08);
  padding: 10px 8px;
  text-align: left;
  font-size: 14px;
}

.monthly-report th {
  background: rgba(17,17,17,.06);
  font-weight: 900;
}

@media (max-width: 900px) {
  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-value {
    font-size: 24px;
  }
}


  
.invoice-items-modal {
  max-width: 1040px;
}

.invoice-item-row input {
  margin-bottom: 8px;
}

.grid.four {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* 2026 design refresh: cleaner, denser, more operational UI. */
:root {
  --bg: #f6f7fb;
  --bg2: #ffffff;
  --card: #ffffff;
  --card-solid: #ffffff;
  --text: #15171c;
  --muted: #68707d;
  --soft-muted: #9aa3af;
  --border: #dde2ea;
  --black: #171a21;
  --black2: #242936;
  --gold: #176b87;
  --gold2: #4fb3bf;
  --cream: #eef8f8;
  --shadow: 0 18px 44px rgba(31, 41, 55, .10);
  --shadow-soft: 0 8px 24px rgba(31, 41, 55, .07);
  --green-bg: #e7f8ef;
  --green: #0d7a47;
  --red-bg: #fff1f2;
  --red: #be123c;
  --amber-bg: #fff7df;
  --amber: #9a5b00;
  --violet-bg: #eef4ff;
  --violet: #2557a7;
  --blue-bg: #e7f7f7;
  --blue: #08757f;
  --radius-xl: 14px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --serif: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Inter, sans-serif;
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 1440px;
  grid-template-columns: 248px 1fr;
}

aside {
  padding: 18px 16px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  box-shadow: 1px 0 0 rgba(255,255,255,.75);
}

aside::before,
.hero::before,
.stat::after {
  display: none;
}

.brand {
  gap: 12px;
  margin-bottom: 18px;
  padding: 2px 2px 16px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #176b87, #0f766e);
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, .22);
}

.brand h1 {
  font-size: 19px;
  letter-spacing: 0;
  font-weight: 850;
}

.brand p {
  font-size: 12px;
  font-weight: 700;
}

nav {
  gap: 5px;
}

.navbtn {
  border-radius: 10px;
  padding: 11px 12px;
  color: #4b5563;
  font-weight: 780;
  letter-spacing: 0;
}

.navbtn:hover {
  background: #f3f6fa;
  transform: none;
}

.navbtn.active {
  background: #17202a;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(23, 32, 42, .16);
}

.navbtn.active::after {
  width: 6px;
  height: 6px;
  margin-top: 6px;
  background: #4fb3bf;
  box-shadow: none;
}

main {
  min-width: 0;
  padding-bottom: 80px;
}

header {
  padding: 18px 28px;
  background: rgba(246,247,251,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.title small {
  margin-bottom: 4px;
  color: #6b7280;
  font-size: 12px;
  letter-spacing: .04em;
}

.title h2 {
  font-family: var(--serif);
  font-size: clamp(27px, 3.2vw, 40px);
  letter-spacing: -.025em;
  line-height: 1;
  font-weight: 860;
}

.content {
  padding: 22px 28px 34px;
}

.grid {
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: none;
}

.card h3 {
  font-size: 18px;
  letter-spacing: -.015em;
  font-weight: 850;
}

.stat {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-top: 4px solid #176b87;
}

.stat:nth-child(2) { border-top-color: #0d7a47; }
.stat:nth-child(3) { border-top-color: #b45309; }
.stat:nth-child(4) { border-top-color: #2557a7; }

.stat .label {
  color: #647084;
  font-size: 12px;
  letter-spacing: .035em;
}

.stat .value {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(27px, 3vw, 36px);
  letter-spacing: -.035em;
  line-height: 1;
  overflow-wrap: anywhere;
}

.hero {
  background: linear-gradient(135deg, #17202a 0%, #176b87 100%);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 18px 42px rgba(23, 32, 42, .18);
  border: 0;
}

.hero h3 {
  font-family: var(--serif);
  font-size: clamp(25px, 3.1vw, 34px);
  letter-spacing: -.025em;
  margin-top: 12px;
  line-height: 1.05;
}

.hero p {
  color: rgba(255,255,255,.78);
  max-width: 720px;
}

.btn {
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 14px;
  background: #17202a;
  box-shadow: 0 8px 18px rgba(23, 32, 42, .14);
  font-weight: 820;
  letter-spacing: 0;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(23, 32, 42, .18);
}

.btn.light {
  background: #ffffff;
  color: #17202a;
  box-shadow: 0 8px 18px rgba(0,0,0,.12);
}

.btn.soft {
  background: #f8fafc;
  color: #263141;
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.soft:hover {
  background: #eef4f8;
  box-shadow: none;
}

.btn.danger {
  background: #fff4f2;
  color: #a23a2e;
  border: 1px solid rgba(162, 58, 46, .22);
  box-shadow: none;
}

.invoice-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.invoice-action-panel {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.invoice-more {
  position: relative;
}

.invoice-more summary {
  list-style: none;
}

.invoice-more summary::-webkit-details-marker {
  display: none;
}

.invoice-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  display: grid;
  gap: 6px;
  width: 210px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(31, 41, 55, .14);
}

.invoice-more-menu .btn {
  width: 100%;
  justify-content: flex-start;
  min-height: 38px;
  padding: 8px 10px;
}

.item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: none;
}

.item:hover {
  transform: none;
  box-shadow: 0 8px 22px rgba(31, 41, 55, .08);
  border-color: #b9c6d6;
}

.item strong {
  font-size: 16px;
  letter-spacing: -.01em;
}

.item span {
  color: #667085;
  font-size: 13px;
}

.pill {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  letter-spacing: .02em;
  border: 1px solid rgba(17,24,39,.08);
}

.toolbar {
  gap: 9px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search,
input,
textarea,
select {
  border-radius: 10px;
  border-color: var(--border);
  background: #ffffff;
  box-shadow: none;
}

.search {
  padding: 12px 13px;
}

input:focus,
textarea:focus,
select:focus,
.search:focus {
  border-color: #4fb3bf;
  outline: none;
  box-shadow: 0 0 0 4px rgba(79,179,191,.16);
}

.calendar {
  gap: 6px;
}

.dayhead {
  padding: 6px;
  font-size: 11px;
  color: #778191;
}

.day {
  min-height: 112px;
  border-radius: 10px;
  background: #ffffff;
  border-color: var(--border);
}

.day:hover {
  transform: none;
  border-color: #9eb4c4;
  box-shadow: 0 8px 22px rgba(31, 41, 55, .08);
}

.eventchip {
  border-radius: 8px;
  background: #eef4f8;
  border-left-color: #176b87;
  font-weight: 760;
}

.sheet {
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--border);
}

.sheethead {
  padding: 16px 18px;
  background: rgba(255,255,255,.96);
}

.sheethead h3 {
  font-family: var(--serif);
  font-size: 22px;
}

.sheetbody {
  padding: 18px;
}

label {
  color: #4b5563;
  letter-spacing: .035em;
}

.report-card {
  border-color: var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.report-value {
  font-family: var(--serif);
}

.bottomnav {
  background: rgba(255,255,255,.94);
  border-top: 1px solid var(--border);
}

.bottomnav .inner {
  max-width: 720px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tab {
  border-radius: 10px;
  font-size: 11px;
  color: #596273;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab.active {
  color: #17202a;
  background: #e7f7f7;
  box-shadow: inset 0 0 0 1px rgba(23,107,135,.18);
}

@media (max-width: 880px) {
  header {
    padding: 15px 14px;
  }

  .content {
    padding: 14px;
  }

  .hero {
    padding: 20px;
  }

  .day {
    min-height: 86px;
  }
}

@media (max-width: 520px) {
  header {
    align-items: flex-start;
  }

  header .btn {
    padding-inline: 12px;
  }

  .title h2 {
    font-size: 30px;
  }

  .content {
    padding: 12px;
  }

  .card {
    border-radius: 12px;
    padding: 15px;
  }

  .stat {
    min-height: 104px;
  }

  .stat .value {
    font-size: 31px;
  }

  .bottomnav {
    overflow-x: hidden;
  }

  .bottomnav .inner {
    min-width: 0;
    gap: 3px;
  }

  .tab {
    font-size: 10px;
    padding-inline: 2px;
  }

  .invoice-actions,
  .invoice-action-panel {
    justify-content: flex-start;
    width: 100%;
  }

  .invoice-more-menu {
    left: 0;
    right: auto;
  }
}

/* Agenda mobile refresh: closer to Google Calendar month view. */
@media (max-width: 720px) {
  body {
    background: #f8fafc;
  }

  header {
    background: rgba(248,250,252,.96);
  }

  .content {
    padding-inline: 10px;
  }

  .toolbar {
    gap: 8px;
    margin-bottom: 10px;
  }

  .toolbar .search {
    flex: 1 0 100%;
    order: -1;
    min-height: 42px;
  }

  .toolbar .btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    padding: 9px 10px;
  }

  .toolbar .btn:not(:last-child) {
    background: #ffffff;
    color: #263141;
    border: 1px solid #d8e0ea;
    box-shadow: none;
  }

  .card:has(.calendar) {
    margin-inline: -10px;
    padding: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    overflow: hidden;
  }

  .card:has(.calendar) > h3 {
    position: static;
    padding: 13px 14px 10px;
    background: rgba(255,255,255,.96);
    border-bottom: 1px solid #e5e9f0;
    font-size: 18px;
  }

  .calendar {
    gap: 0;
    margin-top: 0 !important;
    background: #e5e9f0;
    border-top: 1px solid #e5e9f0;
  }

  .dayhead {
    position: static;
    display: grid;
    place-items: center;
    min-height: 30px;
    padding: 0;
    background: rgba(255,255,255,.98);
    color: #6b7280;
    border-bottom: 1px solid #e5e9f0;
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
  }

  .day {
    min-height: 104px;
    border: 0;
    border-right: 1px solid #e5e9f0;
    border-bottom: 1px solid #e5e9f0;
    border-radius: 0;
    padding: 5px 3px 4px;
    background: #ffffff;
    box-shadow: none;
  }

  .day:nth-child(7n + 7) {
    border-right: 0;
  }

  .day:hover {
    border-color: #e5e9f0;
    box-shadow: none;
    background: #f8fbff;
  }

  .day.out {
    background: #f8fafc;
    opacity: 1;
  }

  .day.out .daynum,
  .day.out .eventchip,
  .day.out .muted {
    opacity: .42;
  }

  .daynum {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    margin: 0 auto 4px;
    border-radius: 999px;
    color: #2f3a4a;
    font-size: 12px;
    font-weight: 800;
  }

  .eventchip {
    min-height: 18px;
    margin-top: 3px;
    padding: 3px 4px;
    border: 0;
    border-radius: 4px;
    background: #dff3f6;
    color: #0f6270;
    font-size: 10px;
    line-height: 1.15;
    font-weight: 760;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .eventchip.done {
    background: #dff7e8;
    color: #0d6a3f;
  }

  .eventchip.cancelled {
    background: #ffe4e6;
    color: #a41435;
    text-decoration: line-through;
  }

  .eventchip.pending {
    background: #fff0c2;
    color: #815100;
  }

  .day .muted {
    text-align: center;
    font-size: 10px !important;
    margin-top: 4px !important;
  }
}

@media (max-width: 430px) {
  .content {
    padding-inline: 8px;
  }

  .card:has(.calendar) {
    margin-inline: -8px;
  }

  .calendar {
    font-size: 10px;
  }

  .day {
    min-height: 92px;
    padding-inline: 2px;
  }

  .daynum {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .eventchip {
    font-size: 9px;
    padding-inline: 3px;
  }
}
