:root {
  color-scheme: light;
  --paper: #f6f5f1;
  --white: #fff;
  --ink: #24231f;
  --muted: #96948d;
  --line: #e9e7e0;
  --accent: #a7795a;
  --accent-soft: #f2e9e1;
  --green: #5c826c;
  --red: #a94f43;
  --sans: "Montserrat", sans-serif;
  --serif: "Bebas Neue", Impact, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 13px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(370px, 44%) 1fr; background: #fbfaf7; }
.login-card { align-self: center; justify-self: center; width: min(390px, calc(100% - 56px)); padding: 58px 0; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #d9d5cc; border-radius: 50%; color: var(--ink); font: 500 16px var(--serif); text-decoration: none; }
.brand-mark-large { width: 52px; height: 52px; margin-bottom: 54px; font-size: 20px; }
.eyebrow { margin: 0 0 10px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.login-card h1 { margin: 0; font: 500 clamp(40px, 5vw, 57px)/1.12 var(--serif); letter-spacing: -.04em; }
.login-card h1 em, .tip-panel h3 em { color: var(--accent); font-weight: 500; }
.login-description { max-width: 320px; margin: 20px 0 30px; color: #77746e; line-height: 1.8; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; border: 1px solid #dedbd4; border-radius: 5px; background: var(--white); font-weight: 600; cursor: pointer; transition: border-color .2s, transform .2s; }
.google-button:hover { transform: translateY(-1px); border-color: #aaa59a; }
.google-button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.google-button svg { width: 18px; height: 18px; }
.setup-hint { margin: 16px 0 0; padding: 12px; border-radius: 4px; background: #fbf0e8; color: #755339; font-size: 11px; line-height: 1.6; }
.setup-hint code { font-family: monospace; }
.login-error { margin: 16px 0 0; padding: 13px; border: 1px solid #ead4c8; border-radius: 4px; background: #fcf2ed; color: #79523d; font-size: 11px; line-height: 1.7; }
.login-error a { display: inline-block; margin-top: 5px; color: #71472f; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.privacy-note { margin: 20px 0 0; color: #aaa69e; font-size: 10px; text-align: center; }
.login-art { position: relative; min-height: 580px; background: linear-gradient(180deg,rgba(22,20,17,.03),rgba(22,20,17,.6)), url("./login-casamento.jpg") center 44%/cover; }
.art-caption { position: absolute; right: 42px; bottom: 30px; left: 42px; display: flex; justify-content: space-between; color: rgba(255,255,255,.75); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 2; inset: 0 auto 0 0; display: flex; flex-direction: column; width: 238px; padding: 28px 18px 18px; overflow-y: auto; border-right: 1px solid var(--line); background: #fbfaf7; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 40px; color: inherit; text-decoration: none; }
.brand-name { font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.brand-name small { display: block; margin-top: 4px; color: var(--muted); font-size: 7px; letter-spacing: .13em; }
.sidebar-label { padding: 0 10px 12px; color: #aaa79f; font-size: 8px; font-weight: 700; letter-spacing: .16em; }
.main-nav { display: grid; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 11px; border: 0; border-radius: 4px; background: transparent; color: #77746d; text-align: left; cursor: pointer; }
.nav-link:hover, .nav-link.active { background: #f0eee8; color: var(--ink); }
.nav-link.active { font-weight: 700; }
.nav-icon { width: 18px; color: var(--accent); font-size: 16px; text-align: center; }
.sidebar-bottom { margin-top: auto; }
.support-note { margin: 0 4px 17px; padding: 15px 14px 13px; border: 1px solid var(--line); border-radius: 5px; }
.note-icon { color: var(--accent); font-size: 16px; }
.support-note p { margin: 8px 0 0; color: #79766f; font: 500 14px/1.45 var(--serif); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 13px 7px 0; border-top: 1px solid var(--line); }
.avatar { flex: none; width: 31px; height: 31px; border-radius: 50%; background: #e7e3dc; object-fit: cover; }
.user-name { overflow: hidden; flex: 1; color: #605e58; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { display: inline-grid; flex: none; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 4px; background: transparent; color: #77746e; font-size: 20px; cursor: pointer; }
.icon-button:hover { background: #f0eee8; color: var(--ink); }
.workspace { max-width: 1600px; min-height: 100vh; margin-left: 238px; padding: 0 clamp(28px, 5.2vw, 78px); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 35px 0 26px; border-bottom: 1px solid var(--line); }
.topbar .eyebrow { margin-bottom: 6px; }
.topbar h1 { margin: 0; font: 500 30px var(--serif); letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.sync-status { display: flex; align-items: center; gap: 7px; color: #89867e; font-size: 10px; }
.sync-status i { width: 6px; height: 6px; border-radius: 50%; background: #75a17e; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 38px; padding: 0 15px; border: 1px solid transparent; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; transition: background .18s, transform .18s; }
.button:hover { transform: translateY(-1px); }
.button-dark { background: var(--ink); color: white; }
.button-dark:hover { background: #413e38; }
.button-dark span { font-size: 16px; font-weight: 400; }
.button-quiet { border-color: var(--line); background: white; color: #69665f; }
.button-danger { border: 0; background: transparent; color: var(--red); }
.view-section { padding: 30px 0 0; }
.welcome-row, .section-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.welcome-row h2, .section-intro h2 { margin: 0 0 5px; font: 500 24px var(--serif); letter-spacing: -.02em; }
.welcome-row p, .section-intro p { margin: 0; color: var(--muted); font-size: 11px; }
.wave { color: var(--accent); font: 20px var(--sans); }
.text-button { padding: 5px 0; border: 0; background: none; color: #77746e; font-size: 10px; cursor: pointer; }
.text-button span { margin-left: 5px; color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 13px; }
.stat-card { min-height: 118px; padding: 17px 18px 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #7d7a73; font-size: 10px; }
.stat-icon { color: var(--accent); font-size: 17px; }
.stat-card strong { display: block; margin: 8px 0 2px; font: 500 31px/1 var(--serif); }
.stat-card small { color: #aaa69e; font-size: 9px; }
.content-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 13px; margin-top: 13px; }
.panel { border: 1px solid var(--line); border-radius: 5px; background: var(--white); }
.upcoming-panel, .tip-panel { min-height: 248px; padding: 19px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.panel-heading h3, .calendar-heading h3 { margin: 0; font: 500 19px var(--serif); }
.event-list { margin-top: 16px; }
.event-card { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #f0eee9; }
.event-date { display: grid; flex: none; place-content: center; width: 41px; height: 43px; border-radius: 4px; background: #f5f2ed; text-align: center; }
.event-date strong { font: 500 18px/1 var(--serif); }
.event-date span { margin-top: 3px; color: #929087; font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.event-meta { overflow: hidden; flex: 1; }
.event-meta strong { display: block; overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.event-meta small { display: block; margin-top: 4px; color: #96938b; font-size: 9px; }
.status-pill { flex: none; padding: 5px 7px; border-radius: 20px; background: #f2eee8; color: #7e6a57; font-size: 8px; }
.status-pill.confirmado { background: #edf3ee; color: #59765f; }
.status-pill.concluido { background: #f0efed; color: #807d76; }
.tip-panel { position: relative; overflow: hidden; background: #f3eee8; }
.tip-panel .eyebrow { color: #8c7561; }
.tip-art { position: absolute; top: 12px; right: 18px; color: rgba(167,121,90,.18); font: 90px/1 var(--serif); transform: rotate(-14deg); }
.tip-panel h3 { position: relative; margin: 22px 0 12px; font: 500 26px/1.2 var(--serif); }
.tip-panel > p:last-child { max-width: 205px; color: #827b72; font-size: 10px; line-height: 1.65; }
.recent-panel { margin-top: 13px; padding: 18px 19px; }
.client-strip { display: flex; gap: 9px; overflow-x: auto; margin-top: 15px; }
.client-chip { display: flex; align-items: center; gap: 9px; min-width: 170px; padding: 8px 11px; border: 1px solid #efede8; border-radius: 4px; }
.client-initial { display: grid; flex: none; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: #8f684d; font: 500 13px var(--serif); }
.client-chip strong { display: block; max-width: 125px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.client-chip small { display: block; margin-top: 3px; color: #9a978f; font-size: 8px; }
.empty-state { padding: 22px 12px; color: #96938b; font-size: 10px; line-height: 1.6; text-align: center; }
.section-intro { align-items: center; margin: 4px 0 21px; }
.section-intro h2 { font-size: 27px; }
.agenda-layout { display: grid; grid-template-columns: minmax(320px, 1.1fr) minmax(290px, .9fr); gap: 14px; }
.calendar-panel, .day-panel { padding: 20px; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 5px; }
.calendar-weekdays { margin-bottom: 8px; color: #a09d95; font-size: 8px; font-weight: 700; text-align: center; }
.calendar-weekdays span { padding: 5px 0; }
.calendar-day { position: relative; display: grid; place-items: center; min-height: 38px; border: 0; border-radius: 4px; background: transparent; color: #4b4943; font-size: 10px; cursor: pointer; }
.calendar-day:hover { background: #f4f1eb; }
.calendar-day.outside { color: #c7c4bc; }
.calendar-day.today::after { content: ""; position: absolute; bottom: 4px; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); }
.calendar-day.has-event::before { content: ""; position: absolute; top: 4px; right: 7px; width: 4px; height: 4px; border-radius: 50%; background: #729079; }
.calendar-day.selected { background: var(--ink); color: white; }
.calendar-day.selected::before, .calendar-day.selected::after { background: white; }
.calendar-legend { display: flex; align-items: center; gap: 7px; margin-top: 15px; color: #9b988f; font-size: 9px; }
.calendar-legend i { width: 5px; height: 5px; border-radius: 50%; background: #729079; }
.day-panel { min-height: 290px; }
.day-panel .event-list { margin-top: 14px; }
.all-events-panel, .clients-panel { margin-top: 14px; padding: 19px; }
.compact-search { max-width: 245px; }
.search-field { display: flex; align-items: center; gap: 7px; width: 100%; max-width: 300px; min-height: 35px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; color: #a39f96; }
.search-field > span { font-size: 17px; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 10px; }
.search-field input::placeholder { color: #aaa79f; }
.table-list { margin-top: 16px; }
.table-event { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto auto; align-items: center; gap: 14px; min-height: 50px; border-top: 1px solid #f0eee9; font-size: 10px; }
.table-event strong { font-weight: 600; }
.table-event span { color: #89867e; }
.table-event .icon-button { justify-self: end; }
.clients-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 18px; }
.client-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid #efede8; border-radius: 4px; background: white; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color .2s; }
.client-card:hover { border-color: #c9b9a8; }
.client-card .client-initial { width: 38px; height: 38px; font-size: 15px; }
.client-card-content { overflow: hidden; flex: 1; }
.client-card-content strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.client-card-content small { display: block; overflow: hidden; margin-top: 4px; color: #96938b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.client-card-content p { display: -webkit-box; overflow: hidden; margin: 9px 0 0; color: #77746e; font-size: 9px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.workspace-footer { display: flex; justify-content: space-between; padding: 26px 0 20px; color: #aaa69f; font-size: 9px; }

.record-dialog { width: min(520px, calc(100% - 28px)); max-height: min(88vh, 800px); padding: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 7px; background: #fbfaf7; color: var(--ink); box-shadow: 0 22px 70px rgba(34,31,26,.18); }
.record-dialog::backdrop { background: rgba(31,29,25,.48); backdrop-filter: blur(2px); }
.record-dialog form { padding: 24px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.dialog-heading h2 { margin: 0; font: 500 26px var(--serif); }
.form-fields { display: grid; gap: 13px; }
.form-fields label { display: grid; gap: 6px; color: #67645d; font-size: 10px; font-weight: 600; }
.form-fields input, .form-fields select, .form-fields textarea { width: 100%; min-height: 38px; padding: 9px 10px; border: 1px solid #e5e2da; border-radius: 4px; outline: 0; background: white; color: var(--ink); font-size: 11px; font-weight: 400; }
.form-fields textarea { resize: vertical; }
.form-fields input:focus, .form-fields select:focus, .form-fields textarea:focus { border-color: #b38d70; box-shadow: 0 0 0 2px rgba(167,121,90,.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.dialog-actions { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.dialog-actions > span { flex: 1; }
.form-error { margin: 12px 0 0; color: var(--red); font-size: 10px; }
.toast { position: fixed; z-index: 5; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 44px)); padding: 12px 16px; border-radius: 5px; background: var(--ink); color: white; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (min-width: 1500px) { .workspace { margin-right: auto; } }
@media (max-width: 1040px) {
  .sidebar { width: 205px; }
  .workspace { margin-left: 205px; padding-right: 28px; padding-left: 28px; }
  .content-grid { grid-template-columns: 1.3fr 1fr; }
  .agenda-layout { grid-template-columns: minmax(290px, 1fr) minmax(260px, .9fr); }
}
@media (max-width: 760px) {
  body { overflow-x: hidden; padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 10; width: 100%; height: calc(62px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); overflow: hidden; border: 0; border-top: 1px solid var(--line); background: #0d0f10; }
  .sidebar > .brand, .sidebar > .sidebar-label, .sidebar > .sidebar-bottom { display: none; }
  .main-nav { display: flex; flex: 1; gap: 2px; width: 100%; height: 100%; margin: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-link { display: flex; flex: 0 0 58px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 5px 2px; font-size: 8px; scroll-snap-align: center; }
  .nav-link.active { box-shadow: inset 0 -2px var(--accent); }
  .nav-icon { width: auto; font-size: 16px; line-height: 1; }
  .workspace { width: 100%; min-height: 100vh; margin: 0; padding: 0 16px calc(18px + env(safe-area-inset-bottom)); }
  .topbar { align-items: center; gap: 8px; padding: 17px 0 14px; }
  .topbar .eyebrow { max-width: 190px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar h1 { font-size: 30px; line-height: 1; }
  .topbar-actions { flex: none; gap: 6px; }
  .topbar-actions .button { min-height: 38px; padding: 0 9px; font-size: 9px; }
  .topbar-actions .button span { font-size: 14px; }
  .view-section { padding-top: 18px; }
  .section-intro { align-items: flex-start; gap: 12px; margin-bottom: 16px; }
  .section-intro > div { min-width: 0; }
  .section-intro h2 { font-size: clamp(19px, 6vw, 24px); line-height: 1.1; }
  .section-intro p { font-size: 10px; line-height: 1.5; }
  .section-intro > .button { flex: none; min-height: 40px; padding: 0 10px; font-size: 9px; white-space: nowrap; }
  .section-intro > .button span { font-size: 14px; }
  .calendar-panel { padding: 15px 12px 12px; }
  .calendar-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 8px; margin-bottom: 12px; }
  .calendar-toolbar .calendar-month-control { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }
  .calendar-toolbar .calendar-month-control h3 { min-width: 0; font-size: 24px; white-space: nowrap; }
  .calendar-toolbar .calendar-month-control .icon-button { width: 38px; height: 38px; }
  .calendar-views { grid-column: 1; width: max-content; max-width: 100%; }
  .calendar-view-button { min-height: 36px; padding: 0 11px; font-size: 10px; }
  .calendar-toolbar .calendar-selection { grid-column: 2; grid-row: 2; max-width: 155px; }
  .calendar-selection strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-selection .eyebrow { font-size: 7px; }
  .calendar-selection #selected-day-count { font-size: 8px; }
  .calendar-toolbar .calendar-search { grid-column: 1 / -1; grid-row: 3; justify-self: stretch; width: 100%; max-width: none; min-height: 42px; }
  .calendar-toolbar .calendar-search input { min-height: 40px; font-size: 16px; }
  .calendar-scroll { overflow: visible; }
  .calendar-scroll > .calendar-grid { min-width: 0; }
  .calendar-weekdays { font-size: 7px; }
  .calendar-weekdays span { padding: 7px 0 8px; text-align: center; }
  .calendar-day { position: relative; min-height: 60px; padding: 6px 2px 12px; border-right: 0; border-top-color: #292e2f; text-align: center; }
  .calendar-day:nth-child(7n + 1) { border-left: 1px solid #222626; }
  .calendar-date { justify-content: center; min-height: 30px; padding: 0; }
  .calendar-date span { font: 400 18px/1 var(--serif); }
  .calendar-event-list { position: absolute; right: 2px; bottom: 5px; left: 2px; display: flex; justify-content: center; gap: 2px; margin: 0; overflow: hidden; }
  .calendar-event { display: block; flex: 0 0 5px; width: 5px; height: 5px; padding: 0; border: 0; border-radius: 50%; font-size: 0; }
  .calendar-event > * { display: none; }
  .calendar-more { display: none; }
  .calendar-day.selected { box-shadow: inset 0 0 0 1px #c6a06b77; }
  .calendar-day.week-day { display: block; min-height: 60px; }
  #calendar-days.week-view { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  #calendar-days.week-view .calendar-day { min-height: 72px; }
  .agenda-list-view { padding-top: 0; }
  .agenda-event-row, .agenda-event-row.compact { grid-template-columns: minmax(72px, .7fr) minmax(0, 1.5fr); gap: 7px 10px; min-height: 76px; padding: 12px 4px; }
  .agenda-event-date, .agenda-event-time { font-size: 9px; }
  .agenda-event-main strong { font-size: 10px; }
  .agenda-event-main small { font-size: 8px; }
  .agenda-event-row .agenda-event-main { grid-column: 2; grid-row: 1; }
  .agenda-event-row .agenda-event-time { grid-column: 1; grid-row: 2; }
  .agenda-event-row .process-status { grid-column: 2; grid-row: 2; padding: 4px 6px; font-size: 8px; }
  .all-events-panel, .clients-panel { padding: 13px; }
  .all-events-panel .panel-heading, .clients-panel .panel-heading { align-items: flex-start; flex-direction: column; }
  .all-events-panel .panel-heading h3, .clients-panel .panel-heading h3 { font-size: 23px; }
  .all-events-panel .search-field, .clients-panel .search-field { min-height: 40px; }
  .all-events-panel .search-field input, .clients-panel .search-field input { min-height: 38px; font-size: 16px; }
  .table-event { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 10px 0; }
  .table-event > span:nth-of-type(2), .table-event .status-pill { display: none; }
  .table-event > span:first-of-type { grid-column: 1; grid-row: 2; }
  .table-event .icon-button { grid-column: 2; grid-row: 1 / span 2; }
  .clients-grid { grid-template-columns: 1fr; }
  .workflow-row { flex-wrap: wrap; min-height: 64px; gap: 8px; padding: 10px 7px; }
  .workflow-row-main { flex-basis: 55%; }
  .workflow-row-main strong { font-size: 10px; }
  .workflow-row-main small { font-size: 8px; }
  .workflow-amount, .priority-dot { font-size: 9px; }
  .works-timeline-panel { padding: 13px; }
  .works-timeline-panel .panel-heading h3 { font-size: 24px; }
  .work-timeline-heading { flex-wrap: wrap; }
  .work-timeline-info { flex-basis: 55%; }
  .work-timeline { min-width: 0; grid-template-columns: repeat(7, minmax(78px, 1fr)); margin-right: -4px; padding-top: 16px; }
  .timeline-label { font-size: 8px; }
  .record-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin: auto; overscroll-behavior: contain; }
  .record-dialog form { padding: 17px; }
  .form-fields { gap: 12px; }
  .form-fields input, .form-fields select, .form-fields textarea { min-height: 44px; font-size: 16px; }
  .form-fields textarea { min-height: 90px; }
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .dialog-actions { position: sticky; bottom: -17px; padding: 10px 0 max(8px, env(safe-area-inset-bottom)); background: #111314; }
  .dialog-actions .button { min-height: 42px; }
  .toast { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); left: 12px; width: auto; max-width: none; }
  .workspace-footer { gap: 10px; font-size: 8px; }
  .workspace-footer > :last-child { text-align: right; }
}

@media (max-width: 380px) {
  .workspace { padding-right: 12px; padding-left: 12px; }
  .sidebar { padding-right: 4px; padding-left: 4px; }
  .nav-link { flex-basis: 54px; }
  .calendar-toolbar .calendar-month-control h3 { font-size: 21px; }
  .calendar-view-button { padding-right: 9px; padding-left: 9px; }
  .calendar-toolbar .calendar-selection { max-width: 135px; }
  .section-intro > .button { padding: 0 8px; font-size: 8px; }
}

@media (max-width: 760px) {
  body { overflow-x: hidden; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { position: fixed; inset: auto 0 0; z-index: 10; display: flex; flex-direction: row; width: 100%; height: calc(62px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); overflow: hidden; border: 0; border-top: 1px solid var(--line); background: #0d0f10; }
  .sidebar > .brand, .sidebar > .sidebar-label, .sidebar > .sidebar-bottom { display: none; }
  .main-nav { display: flex; flex: 1; gap: 2px; width: 100%; height: 100%; margin: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .main-nav::-webkit-scrollbar { display: none; }
  .sidebar .nav-link { display: flex; flex: 0 0 54px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 5px 2px; font-size: 8px; white-space: normal; scroll-snap-align: center; }
  .sidebar .nav-link.active { box-shadow: inset 0 -2px var(--accent); }
  .sidebar .nav-icon { width: auto; font-size: 16px; line-height: 1; }
  .workspace { width: 100%; min-height: 100vh; margin: 0; padding: 0 14px calc(18px + env(safe-area-inset-bottom)); }
  .topbar { align-items: center; gap: 8px; padding: 16px 0 13px; }
  .topbar .eyebrow { max-width: 190px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .topbar h1 { font-size: 30px; line-height: 1; }
  .topbar-actions { display: none; }
  .view-section { padding-top: 17px; }
  .section-intro { align-items: flex-start; gap: 10px; margin-bottom: 15px; }
  .section-intro > div { min-width: 0; }
  .section-intro h2 { font-size: clamp(19px, 5.8vw, 23px); line-height: 1.1; }
  .section-intro p { font-size: 10px; line-height: 1.5; }
  .section-intro > .button { flex: none; min-height: 40px; padding: 0 9px; font-size: 8px; white-space: nowrap; }
  .section-intro > .button span { font-size: 14px; }
  .stat-grid { grid-template-columns: 1fr; gap: 7px; }
  .stat-card { display: grid; grid-template-columns: 1fr auto; align-items: center; min-height: 74px; padding: 10px 13px; }
  .stat-top { grid-column: 1; grid-row: 1; }
  .stat-card strong { grid-column: 2; grid-row: 1 / span 2; margin: 0; font-size: 24px; }
  .stat-card small { grid-column: 1; grid-row: 2; }
  .calendar-panel { padding: 14px 11px 11px; }
  .calendar-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 9px 7px; margin-bottom: 11px; }
  .calendar-toolbar .calendar-month-control { grid-column: 1 / -1; justify-self: stretch; justify-content: center; }
  .calendar-toolbar .calendar-month-control h3 { min-width: 0; font-size: 22px; white-space: nowrap; }
  .calendar-toolbar .calendar-month-control .icon-button { width: 38px; height: 38px; }
  .calendar-views { grid-column: 1; width: max-content; max-width: 100%; }
  .calendar-view-button { min-height: 36px; padding: 0 10px; font-size: 10px; }
  .calendar-toolbar .calendar-selection { grid-column: 2; grid-row: 2; max-width: 145px; }
  .calendar-selection strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-selection .eyebrow { font-size: 7px; }
  .calendar-selection #selected-day-count { font-size: 8px; }
  .calendar-toolbar .calendar-search { grid-column: 1 / -1; grid-row: 3; justify-self: stretch; width: 100%; max-width: none; min-height: 42px; }
  .calendar-toolbar .calendar-search input { min-height: 40px; font-size: 16px; }
  .calendar-scroll { overflow: visible; }
  #calendar-days { min-width: 0; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .calendar-weekdays { font-size: 7px; }
  .calendar-weekdays span { padding: 7px 0 8px; text-align: center; }
  #calendar-days .calendar-day { position: relative; min-width: 0; min-height: 56px; padding: 5px 1px 11px; border-right: 0; border-top-color: #292e2f; text-align: center; }
  #calendar-days .calendar-day:nth-child(7n + 1) { border-left: 1px solid #222626; }
  #calendar-days .calendar-date { justify-content: center; min-height: 30px; padding: 0; }
  #calendar-days .calendar-date span { font: 400 18px/1 var(--serif); }
  #calendar-days .calendar-weekday-name { display: none; }
  #calendar-days .calendar-day.week-day { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: start; min-height: 66px; padding: 5px 0; text-align: left; }
  #calendar-days.week-view .calendar-date { grid-column: 1; grid-row: 1; flex-direction: column; gap: 3px; min-height: 48px; }
  #calendar-days.week-view .calendar-date span { font-size: 17px; }
  #calendar-days.week-view .calendar-weekday-name { display: block; color: #919793; font: 600 8px var(--sans); text-transform: uppercase; }
  #calendar-days.week-view .calendar-event-list { position: static; grid-column: 2; grid-row: 1; display: grid; justify-content: stretch; gap: 4px; margin: 0; overflow: visible; }
  #calendar-days.week-view .calendar-event { display: grid; flex: initial; grid-template-columns: 43px minmax(0, 1fr); gap: 1px 5px; width: 100%; height: auto; min-height: 40px; padding: 4px 6px; border-left: 2px solid #626966; border-radius: 2px; font-size: 8px; text-align: left; }
  #calendar-days.week-view .calendar-event > span { display: block; grid-row: 1 / span 2; align-self: start; font-size: 8px; }
  #calendar-days.week-view .calendar-event > strong { display: block; grid-column: 2; font-size: 8px; }
  #calendar-days.week-view .calendar-event > small { display: block; grid-column: 2; font-size: 7px; }
  #calendar-days.week-view .calendar-more { display: block; }
  .calendar-scroll.week-view > .calendar-weekdays { display: none; }
  .calendar-scroll.week-view > #calendar-days { display: grid; grid-template-columns: minmax(0, 1fr); }
  .calendar-day.outside .calendar-event-list { opacity: .6; }
  .calendar-event { display: block; flex: 0 0 5px; width: 5px; height: 5px; padding: 0; border: 0; border-radius: 50%; font-size: 0; }
  .calendar-event > * { display: none; }
  .calendar-more { display: none; }
  .calendar-day.selected, .calendar-day:has(.calendar-date[aria-pressed="true"]) { background: #191c1c; box-shadow: inset 0 0 0 1px #c6a06b77; }
  .calendar-day.selected .calendar-date span { color: var(--accent); }
  .agenda-event-row, .agenda-event-row.compact { grid-template-columns: minmax(72px, .7fr) minmax(0, 1.5fr); gap: 7px 10px; min-height: 76px; padding: 12px 4px; }
  .agenda-event-date, .agenda-event-time { font-size: 9px; }
  .agenda-event-main strong { font-size: 10px; }
  .agenda-event-main small { font-size: 8px; }
  .agenda-event-row .agenda-event-main { grid-column: 2; grid-row: 1; }
  .agenda-event-row .agenda-event-time { grid-column: 1; grid-row: 2; }
  .agenda-event-row .process-status { grid-column: 2; grid-row: 2; padding: 4px 6px; font-size: 8px; }
  .all-events-panel, .clients-panel { padding: 12px; }
  .all-events-panel .panel-heading, .clients-panel .panel-heading { align-items: flex-start; flex-direction: column; }
  .all-events-panel .panel-heading h3, .clients-panel .panel-heading h3 { font-size: 22px; }
  .all-events-panel .search-field, .clients-panel .search-field { min-height: 42px; }
  .all-events-panel .search-field input, .clients-panel .search-field input { min-height: 40px; font-size: 16px; }
  .table-event { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 10px 0; }
  .table-event > span:nth-of-type(2), .table-event .status-pill { display: none; }
  .table-event > span:first-of-type { grid-column: 1; grid-row: 2; }
  .table-event .icon-button { grid-column: 2; grid-row: 1 / span 2; }
  .clients-grid { grid-template-columns: 1fr; }
  .workflow-row { flex-wrap: wrap; min-height: 64px; gap: 8px; padding: 10px 7px; }
  .workflow-row-main { flex-basis: 55%; }
  .workflow-row-main strong { font-size: 10px; }
  .workflow-row-main small { font-size: 8px; }
  .workflow-amount, .priority-dot { font-size: 9px; }
  .works-timeline-panel { padding: 12px; }
  .works-timeline-panel .panel-heading h3 { font-size: 23px; }
  .work-timeline-heading { flex-wrap: wrap; }
  .work-timeline-info { flex-basis: 55%; }
  .work-timeline { min-width: 0; grid-template-columns: repeat(7, minmax(78px, 1fr)); margin-right: -4px; padding-top: 16px; }
  .timeline-label { font-size: 8px; }
  .record-dialog { width: calc(100% - 24px); max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin: auto; overscroll-behavior: contain; }
  .record-dialog form { padding: 17px; }
  .form-fields { gap: 12px; }
  .form-fields input, .form-fields select, .form-fields textarea { min-height: 44px; font-size: 16px; }
  .form-fields textarea { min-height: 90px; }
  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .dialog-actions { position: sticky; bottom: -17px; padding: 10px 0 max(8px, env(safe-area-inset-bottom)); background: #111314; }
  .dialog-actions .button { min-height: 42px; }
  .toast { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); left: 12px; width: auto; max-width: none; }
  .workspace-footer { gap: 10px; font-size: 8px; }
  .workspace-footer > :last-child { text-align: right; }
}

@media (max-width: 380px) {
  .workspace { padding-right: 11px; padding-left: 11px; }
  .sidebar { padding-right: 4px; padding-left: 4px; }
  .sidebar .nav-link { flex-basis: 52px; }
  .calendar-toolbar .calendar-month-control h3 { font-size: 20px; }
  .calendar-view-button { padding-right: 8px; padding-left: 8px; }
  .calendar-toolbar .calendar-selection { max-width: 132px; }
  .section-intro > .button { padding: 0 7px; font-size: 8px; }
}

:root {
  color-scheme: dark;
  --paper: #0a0b0c;
  --white: #111314;
  --ink: #ecece9;
  --muted: #858987;
  --line: #272a2b;
  --accent: #c6a06b;
  --accent-soft: #242019;
  --green: #a0ad9e;
  --red: #bd8077;
}

body { background: var(--paper); color: var(--ink); }
.login-screen { background: #0b0d0e; }
.login-card h1 { color: #f2f1ed; }
.login-description, .privacy-note { color: #929795; }
.brand-mark { border-color: #373b39; color: #f2f1ed; }
.google-button { border-color: #363b3b; background: #151819; color: #eeefec; }
.google-button:hover { border-color: #82745e; }
.setup-hint, .login-error { border-color: #493b2b; background: #211c15; color: #e1c49d; }
.login-error a { color: #e7c28e; }
.sidebar { border-color: var(--line); background: #101213; }
.brand-name, .sidebar-label { color: #e5e7e4; }
.brand-name small, .sidebar-label { color: #747c7a; }
.nav-link { color: #999f9d; }
.nav-link:hover, .nav-link.active { background: #1c2020; color: #f2f2ef; }
.nav-link.active { box-shadow: inset 2px 0 #d2a96f; }
.nav-icon, .stat-icon, .note-icon { color: var(--accent); }
.support-note { border-color: #2c3030; background: #141718; }
.support-note p { color: #c4c7c2; }
.user-card { border-color: #292e2f; }
.user-name { color: #c4c8c4; }
.icon-button { color: #9ca29f; }
.icon-button:hover { background: #242828; color: #fff; }
.avatar { background: #292e2f; }
.topbar { border-color: var(--line); }
.topbar h1, .welcome-row h2, .section-intro h2, .panel-heading h3, .calendar-heading h3 { color: #f0f1ed; }
.eyebrow, .welcome-row p, .section-intro p { color: #818887; }
.sync-status { color: #8d9691; }
.sync-status i { background: #72bd91; box-shadow: 0 0 10px #72bd9150; }
.button-dark { background: var(--accent); color: #17130d; }
.button-dark:hover { background: #e1bd86; }
.button-quiet { border-color: #343a39; background: #181c1d; color: #c6cbc6; }
.button-quiet:hover { background: #232828; }
.text-button { color: #b1b6b1; }
.text-button:hover { color: #f2f1ed; }
.stat-card, .panel { border-color: #292e2f; background: #141718; box-shadow: 0 12px 36px #00000012; }
.stat-card { background: linear-gradient(140deg,#181c1c,#121515 78%); }
.stat-top { color: #9ba19e; }
.stat-card strong { color: #f1f1ed; }
.stat-card small, .client-chip small { color: #7e8783; }
.event-card { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.event-card:hover, .workflow-row:hover, .client-card:hover { border-color: #575041; background: #1a1e1e; }
.event-date, .client-initial { background: #28231b; color: #e2bd88; }
.event-meta strong, .client-chip strong, .client-card-content strong { color: #eeefeb; }
.event-meta small, .client-card-content small { color: #89918e; }
.status-pill { background: #29261f; color: #d1b98f; }
.status-pill.confirmado, .status-pill.entregue, .status-pill.concluida, .status-pill.pago { background: #1c2b23; color: #8ac49d; }
.status-pill.em-andamento, .status-pill.em-edição, .status-pill.pronta, .status-pill.proposta, .status-pill.pendente { background: #2c271e; color: #d9bc83; }
.status-pill.cancelado { background: #33211f; color: #dd948b; }
.status-pill.concluido { background: #1c2b23; color: #8ac49d; }
.tip-panel { border-color: #3c3325; background: radial-gradient(circle at 100% 0,#322719 0,transparent 40%),linear-gradient(145deg,#201c16,#171817 75%); }
.tip-panel .eyebrow { color: #b49a70; }
.tip-panel h3 { color: #f0eee8; }
.tip-panel > p:last-child { color: #a09b90; }
.tip-art { color: #d2a96f19; }
.client-chip, .client-card { border-color: #292e2f; background: #171a1b; color: inherit; }
.empty-state { color: #858d89; }
.calendar-day { color: #c8ccc8; }
.calendar-day:hover { background: #242827; }
.calendar-day.outside { color: #545b59; }
.calendar-day.selected { background: var(--accent); color: #17130d; }
.calendar-day.selected::before, .calendar-day.selected::after { background: #17130d; }
.table-event { border-color: #292e2f; color: #c8ccc8; }
.table-event span { color: #929996; }
.search-field { border-color: #323837; background: #111414; color: #919895; }
.search-field input { color: #ecede9; }
.search-field input::placeholder { color: #737c78; }
.record-dialog { border-color: #343a39; background: #141718; color: #f0f1ed; box-shadow: 0 22px 70px #0009; }
.record-dialog::backdrop { background: #050606b8; }
.dialog-heading h2 { color: #f1f1ed; }
.form-fields label { color: #bdc2bd; }
.form-fields input, .form-fields select, .form-fields textarea { border-color: #343a39; background: #0d1010; color: #eef0ed; }
.form-fields input::placeholder, .form-fields textarea::placeholder { color: #747c79; }
.form-fields input:focus, .form-fields select:focus, .form-fields textarea:focus { border-color: #b99665; box-shadow: 0 0 0 2px #d2a96f1c; }
.button-quiet { background: #1b1f20; }
.button-danger { color: #e18b80; }
.form-error { color: #e39287; }
.workspace-footer { color: #737b78; }
.toast { background: #e5b97d; color: #17130d; }
.workflow-row { border-color: #292e2f; background: transparent; color: #edf0ec; }
.workflow-row-main small { color: #8b938f; }
.delivery-row { border-top: 1px solid #292e2f; }
.delivery-row .workflow-row { border-top: 0; }
.delivery-link { display: inline-block; margin: 0 0 11px 12px; color: #d2a96f; font-size: 10px; text-decoration: none; }
.delivery-link:hover { color: #ebc992; text-decoration: underline; text-underline-offset: 3px; }
.delivery-link-warning { display: inline-block; margin: 0 0 11px 12px; color: #e09084; font-size: 10px; }
.workflow-amount { color: #e9e6dc; }
.workflow-amount.positive { color: #8bc69b; }
.workflow-amount.negative { color: #e09084; }
.priority-dot { color: #b3b8b3; }
.priority-dot.alta { color: #e3b675; }
.priority-dot.urgente { color: #e28a7e; }
.row-arrow { color: #a98b60; }
.finance-stats { margin-bottom: 13px; }
.dashboard-lower { margin-top: 13px; }
.quick-actions { display: flex; gap: 8px; }
.calendar-legend { color: #89918e; }
.calendar-legend i { background: #78b68d; }
.table-event strong { color: #eceeea; }
.workspace { max-width: none; }
.workflow-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 11px 12px; border: 0; border-top: 1px solid #292e2f; border-radius: 3px; background: transparent; color: #edf0ec; text-align: left; cursor: pointer; transition: background .18s; }
.workflow-row-main { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
.workflow-row-main strong { overflow: hidden; color: #edf0ec; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.workflow-row-main small { overflow: hidden; color: #8b938f; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.workflow-amount { flex: none; color: #e9e6dc; font-size: 10px; font-weight: 600; white-space: nowrap; }
.priority-dot { flex: none; color: #b3b8b3; font-size: 9px; white-space: nowrap; }
.priority-dot.alta { color: #e3b675; }
.priority-dot.urgente { color: #e28a7e; }
@media (max-width: 760px) {
  .sidebar { background: #101213; }
  .main-nav { overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-link { flex: none; white-space: nowrap; }
  .nav-link.active { box-shadow: inset 0 -2px #d2a96f; }
  .dashboard-lower { grid-template-columns: 1fr; }
  .quick-actions { align-self: stretch; }
}

body, button, input, select, textarea { font-family: var(--sans); }
body, .app-shell, .workspace { background: var(--paper); color: var(--ink); }
.login-screen { background: #0a0b0c; }
.login-card h1, .topbar h1, .welcome-row h2, .section-intro h2,
.panel-heading h3, .calendar-heading h3, .dialog-heading h2,
.stat-card strong, .tip-panel h3, .support-note p {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: .025em;
}
.login-card h1 { color: var(--ink); }
.login-card h1 em, .tip-panel h3 em { color: var(--accent); }
.brand-mark { border-color: var(--line); color: var(--ink); font-family: var(--serif); }
.privacy-note, .login-description { color: var(--muted); }
.google-button { border-color: var(--line); border-radius: 3px; background: #111314; color: var(--ink); }
.google-button:hover { border-color: #55504a; }
.setup-hint, .login-error { border: 1px solid #3a3021; border-radius: 3px; background: #171511; color: #c8b797; }
.login-error a { color: var(--accent); }
.sidebar { border-color: var(--line); background: #0d0f10; }
.brand-name, .sidebar-label { color: #dedfdb; }
.brand-name small, .sidebar-label { color: #777c79; }
.nav-link { border-radius: 2px; color: #929794; }
.nav-link:hover, .nav-link.active { background: #181a1b; color: var(--ink); }
.nav-link.active { box-shadow: inset 2px 0 var(--accent); }
.nav-icon, .stat-icon, .note-icon { color: var(--accent); }
.support-note { border-color: var(--line); border-radius: 3px; background: #111314; }
.support-note p { color: #c5c7c2; }
.user-card { border-color: var(--line); }
.user-name { color: #c4c7c3; }
.avatar { background: #202323; }
.icon-button { border-radius: 2px; color: #969c98; }
.icon-button:hover { background: #1c1f20; color: var(--ink); }
.topbar { border-color: var(--line); }
.topbar h1 { color: var(--ink); font-size: 38px; }
.welcome-row h2, .section-intro h2, .panel-heading h3,
.calendar-heading h3, .dialog-heading h2 { color: var(--ink); }
.eyebrow, .welcome-row p, .section-intro p { color: var(--muted); }
.sync-status { color: #909692; }
.sync-status i { background: var(--green); box-shadow: none; }
.button { border-radius: 2px; font-weight: 600; letter-spacing: .035em; }
.button-dark { background: var(--accent); color: #15130f; }
.button-dark:hover { background: #d4b482; }
.button-quiet { border-color: var(--line); background: #111314; color: #c5c8c4; }
.button-quiet:hover { background: #1b1e1f; }
.button-danger { color: var(--red); }
.text-button { color: #a7aca8; }
.text-button:hover { color: var(--ink); }
.stat-card, .panel { border-color: var(--line); border-radius: 3px; background: #111314; box-shadow: none; }
.stat-card { background: #111314; }
.stat-top { color: #a1a6a2; }
.stat-card strong { color: var(--ink); }
.stat-card small, .client-chip small { color: #7d8380; }
.event-card { color: inherit; }
.event-card:hover, .workflow-row:hover, .client-card:hover { border-color: #3b3f3e; background: #171919; }
.event-date, .client-initial { border-radius: 2px; background: #211e18; color: var(--accent); }
.event-meta strong, .client-chip strong, .client-card-content strong { color: var(--ink); }
.event-meta small, .client-card-content small { color: #898f8c; }
.status-pill { border-radius: 2px; background: #1c1e1f; color: #b7b9b5; }
.status-pill.confirmado, .status-pill.entregue, .status-pill.concluida,
.status-pill.pago, .status-pill.concluido { background: #1b201c; color: #a7b2a6; }
.status-pill.em-andamento, .status-pill.em-edição, .status-pill.pronta,
.status-pill.proposta, .status-pill.pendente { background: #211e18; color: #c7ad83; }
.status-pill.cancelado { background: #211918; color: #bd8980; }
.tip-panel { border-color: var(--line); background: #111314; }
.tip-panel .eyebrow { color: #929792; }
.tip-panel h3 { color: var(--ink); }
.tip-panel > p:last-child { color: #969b97; }
.tip-art { color: #c6a06b16; }
.client-chip, .client-card { border-color: var(--line); border-radius: 3px; background: #131516; color: inherit; }
.empty-state { color: #858b88; }
.calendar-panel, .day-panel, .all-events-panel, .clients-panel { border-color: var(--line); background: #111314; }
.calendar-panel { padding: 22px 24px 16px; }
.calendar-heading { justify-content: flex-start; gap: 12px; margin-bottom: 17px; }
.calendar-month-control { display: flex; align-items: center; gap: 8px; }
.calendar-month-control h3 { min-width: 190px; font: 400 27px/1.2 var(--serif); letter-spacing: .025em; text-align: center; }
.calendar-selection { display: grid; gap: 3px; margin-left: auto; text-align: right; }
.calendar-selection .eyebrow { margin: 0; font-size: 8px; }
.calendar-selection strong { font-size: 11px; font-weight: 600; }
#selected-day-count { color: var(--muted); font-size: 9px; }
.calendar-scroll { overflow-x: auto; }
.calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.calendar-weekdays { margin: 0; color: #999f9b; font-size: 9px; }
.calendar-weekdays span { padding: 8px 5px 10px; text-align: left; }
.calendar-day { display: block; min-width: 0; min-height: 116px; padding: 7px; border: 0; border-top: 1px solid #343838; border-right: 1px solid #222626; border-radius: 0; background: #111314; color: #d3d5d1; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day::before, .calendar-day::after { content: none; }
.calendar-day:hover, .calendar-day.selected { background: #191c1c; }
.calendar-day.outside { color: #585e5b; }
.calendar-day.today .calendar-date span { color: var(--accent); }
.calendar-date { display: flex; align-items: center; width: 100%; min-height: 25px; padding: 0 2px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.calendar-date span { font: 400 22px/1 var(--serif); letter-spacing: .025em; }
.calendar-date:hover span { color: var(--accent); }
.calendar-event-list { display: grid; gap: 3px; margin-top: 7px; }
.calendar-event { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; width: 100%; padding: 4px 5px; overflow: hidden; border: 0; border-radius: 2px; background: #1b1e1e; color: #d3d5d1; font: inherit; text-align: left; cursor: pointer; }
.calendar-event:hover { background: #252928; }
.calendar-event span { color: #939996; font-size: 8px; line-height: 1.5; white-space: nowrap; }
.calendar-event strong { display: -webkit-box; overflow: hidden; font-size: 9px; font-weight: 600; line-height: 1.25; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.calendar-event.proposta, .calendar-event.em-andamento { background: #211f1a; }
.calendar-event.concluido { background: #1b201c; }
.calendar-more { padding: 2px 4px; color: #999f9b; font-size: 8px; }
.calendar-legend { color: #929894; }
.calendar-legend i { background: var(--accent); }
.all-events-panel, .clients-panel { margin-top: 14px; padding: 19px; }
.search-field { border-color: #2d3232; border-radius: 2px; background: #0d0f10; color: #929894; }
.search-field input { color: var(--ink); }
.search-field input::placeholder { color: #707774; }
.table-event { border-color: #252929; color: #c9ccc8; }
.table-event span { color: #929894; }
.table-event strong { color: var(--ink); }
.client-card { border-radius: 2px; }
.workspace-footer { color: #777d79; }
.app-shell:has(#view-agenda:not([hidden])) .topbar-actions { display: none; }
.workflow-row { border-color: #252929; border-radius: 2px; color: #e0e2de; }
.workflow-row-main strong { color: #e0e2de; }
.workflow-row-main small { color: #898f8c; }
.delivery-row { border-color: #252929; }
.delivery-link { color: var(--accent); }
.delivery-link:hover { color: #dfbd88; }
.delivery-link-warning, .workflow-amount.negative, .priority-dot.urgente { color: var(--red); }
.workflow-amount { color: #d2d4d0; }
.workflow-amount.positive { color: var(--green); }
.priority-dot { color: #a9aeaa; }
.priority-dot.alta { color: var(--accent); }
.row-arrow { color: var(--accent); }
.table-event .icon-button { color: #a0a5a1; }
.record-dialog { border-color: #303535; border-radius: 3px; background: #111314; color: var(--ink); box-shadow: 0 24px 80px #000b; }
.record-dialog::backdrop { background: #050606c7; backdrop-filter: blur(3px); }
.dialog-heading h2 { color: var(--ink); }
.form-fields label { color: #b9bfbb; }
.form-fields input, .form-fields select, .form-fields textarea { border-color: #303535; border-radius: 2px; background: #0b0d0e; color: var(--ink); }
.form-fields input::placeholder, .form-fields textarea::placeholder { color: #737a76; }
.form-fields input:focus, .form-fields select:focus, .form-fields textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px #c6a06b20; }
.form-error { color: #d29187; }
.toast { border: 1px solid #383329; border-radius: 2px; background: #171511; color: #e7d5b7; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 760px) {
  .calendar-panel { padding: 18px 14px 12px; }
  .calendar-heading { gap: 6px; }
  .calendar-month-control { gap: 0; }
  .calendar-month-control h3 { min-width: 145px; font-size: 22px; }
  .calendar-selection { max-width: 145px; }
  .calendar-selection strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .calendar-scroll > .calendar-grid { min-width: 740px; }
  .calendar-day { min-height: 112px; }
  .all-events-panel .panel-heading { align-items: flex-start; flex-direction: column; }
}

.works-timeline-panel { padding-bottom: 10px; }
.works-timeline-panel .panel-heading h3 { font: 400 28px/1.1 var(--serif); }
.timeline-hint { margin: 14px 0 3px; color: #858b88; font-size: 10px; }
.work-timeline-card { padding: 17px 0 14px; border-top: 1px solid var(--line); }
.work-timeline-heading { display: flex; align-items: center; gap: 12px; }
.work-timeline-info { display: grid; flex: 1; gap: 5px; min-width: 0; }
.work-timeline-info strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.work-timeline-info small { overflow: hidden; color: #8a908d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.work-timeline-heading > .icon-button { font-size: 21px; }
.work-timeline { display: grid; grid-template-columns: repeat(7, minmax(94px, 1fr)); min-width: 730px; padding: 19px 4px 0; }
.work-timeline-card { overflow: hidden; }
.work-timeline { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #424746 transparent; }
.timeline-step { --stage-color: #aaa; position: relative; z-index: 0; display: grid; justify-items: center; gap: 8px; min-width: 0; padding: 0 3px 4px; border: 0; background: transparent; color: #858b88; font: inherit; cursor: pointer; transition: color .18s, transform .18s; }
.timeline-step::after { position: absolute; z-index: -1; top: 7px; right: calc(-50% + 8px); left: calc(50% + 8px); height: 2px; background: #333938; content: ""; }
.timeline-step:last-child::after { display: none; }
.timeline-dot { display: grid; place-items: center; width: 16px; height: 16px; border: 2px solid #484e4b; border-radius: 50%; background: #111314; transition: border-color .18s, background .18s, box-shadow .18s; }
.timeline-label { max-width: 100%; font-size: 9px; line-height: 1.3; text-align: center; }
.timeline-step:hover { color: #e8eae6; transform: translateY(-1px); }
.timeline-step.is-complete { color: #b6bbb7; }
.timeline-step.is-complete .timeline-dot { border-color: var(--stage-color); background: var(--stage-color); }
.timeline-step.is-current { color: #f2f2ee; font-weight: 700; }
.timeline-step.is-current .timeline-dot { border-color: var(--stage-color); background: var(--stage-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--stage-color) 18%, transparent); }
.timeline-step.is-complete::after { background: var(--stage-color); }
.timeline-step.is-upcoming { opacity: .62; }
.timeline-step:disabled { cursor: wait; opacity: .55; }
.stage-prospeccao { --stage-color: #ff6b6b; }
.stage-orcamento { --stage-color: #ff9f43; }
.stage-contrato { --stage-color: #ffd166; }
.stage-planejamento { --stage-color: #6cdbb2; }
.stage-evento { --stage-color: #45b8e8; }
.stage-edicao { --stage-color: #aa8cff; }
.stage-entrega { --stage-color: #f07cc2; }

@media (max-width: 760px) {
  .works-timeline-panel { padding: 14px; }
  .work-timeline-heading { gap: 7px; }
  .work-timeline-heading .status-pill { display: none; }
  .work-timeline-heading .workflow-amount { font-size: 9px; }
  .work-timeline-info strong { font-size: 11px; }
  .work-timeline-info small { font-size: 8px; }
  .work-timeline { margin-right: -4px; }
}

.calendar-toolbar { display: flex; align-items: center; gap: 20px; margin-bottom: 17px; }
.calendar-toolbar .calendar-month-control { flex: none; }
.calendar-toolbar .calendar-month-control h3 { min-width: 190px; }
.calendar-toolbar { display: grid; grid-template-columns: auto auto minmax(180px, 1fr); gap: 10px 16px; }
.calendar-toolbar .calendar-search { width: 100%; max-width: 280px; justify-self: end; }
.calendar-toolbar .calendar-selection { grid-column: 1 / -1; }
.calendar-views { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid #2c3131; border-radius: 3px; background: #0b0d0e; }
.calendar-view-button { min-height: 29px; padding: 0 12px; border: 0; border-radius: 2px; background: transparent; color: #979d99; font: 600 10px var(--sans); cursor: pointer; }
.calendar-view-button:hover { color: var(--ink); }
.calendar-view-button.active { background: #272a29; color: var(--ink); }
.calendar-toolbar .calendar-selection { flex: 1; }
.calendar-day { min-height: 120px; }
.calendar-day.outside .calendar-event-list { opacity: .55; }
.calendar-event { border-left: 2px solid #626966; }
.calendar-event small { overflow: hidden; color: #a4aaa6; font-size: 8px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event.process-prospeccao { border-left-color: #ff6b6b; background: #281b1d; }
.calendar-event.process-orcamento { border-left-color: #ff9f43; background: #2a2119; }
.calendar-event.process-contrato { border-left-color: #ffd166; background: #292519; }
.calendar-event.process-planejamento { border-left-color: #6cdbb2; background: #19241f; }
.calendar-event.process-evento { border-left-color: #45b8e8; background: #192329; }
.calendar-event.process-edicao { border-left-color: #aa8cff; background: #211d2a; }
.calendar-event.process-entrega { border-left-color: #f07cc2; background: #291d26; }
.calendar-event.status-confirmado { border-left-color: #c6a06b; }
.calendar-event.status-proposta { border-left-color: #ff9f43; }
.calendar-event.status-concluido { border-left-color: #a0ad9e; }
.calendar-day.selected { box-shadow: inset 0 0 0 1px #c6a06b66; }
.calendar-day.selected .calendar-date span { color: var(--accent); }
.calendar-day:has(.calendar-date[aria-pressed="true"]) { background: #191c1c; }
.calendar-day.week-day { min-height: 250px; }
.agenda-list-view { display: grid; gap: 0; padding-top: 7px; }
.agenda-list-head { display: grid; grid-template-columns: minmax(95px, .7fr) minmax(180px, 2fr) minmax(100px, .7fr) minmax(115px, .8fr); gap: 14px; padding: 9px 12px; color: #818885; font-size: 8px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.agenda-event-row { display: grid; grid-template-columns: minmax(95px, .7fr) minmax(180px, 2fr) minmax(100px, .7fr) minmax(115px, .8fr); align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 12px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background .16s; }
.agenda-event-row:hover { background: #191c1c; }
.agenda-event-date, .agenda-event-time { color: #a5aaa6; font-size: 10px; white-space: nowrap; }
.agenda-event-main { display: grid; gap: 5px; min-width: 0; }
.agenda-event-main strong { overflow: hidden; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.agenda-event-main small { overflow: hidden; color: #858b88; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.agenda-event-time { justify-self: start; }
.process-status { justify-self: start; padding: 5px 8px; border: 1px solid transparent; border-radius: 2px; font-size: 9px; font-weight: 600; white-space: nowrap; }
.process-prospeccao { border-color: #7d3e43; background: #281b1d; color: #ff9292; }
.process-orcamento { border-color: #815c36; background: #2a2119; color: #ffb35f; }
.process-contrato { border-color: #776839; background: #292519; color: #ffdc7e; }
.process-planejamento { border-color: #3d7662; background: #19241f; color: #83e8c2; }
.process-evento { border-color: #396c83; background: #192329; color: #75cff3; }
.process-edicao { border-color: #5e4c82; background: #211d2a; color: #bea7ff; }
.process-entrega { border-color: #804d6b; background: #291d26; color: #ff9bd7; }
.status-confirmado { border-color: #6b583a; background: #211e18; color: #d7b47f; }
.status-proposta { border-color: #815c36; background: #2a2119; color: #ffb35f; }
.status-concluido { border-color: #435846; background: #1b201c; color: #a7b2a6; }
.agenda-event-row.compact { grid-template-columns: minmax(95px, .7fr) minmax(180px, 2fr) minmax(100px, .7fr) minmax(115px, .8fr); }

@media (max-width: 760px) {
  .calendar-toolbar { grid-template-columns: 1fr auto; gap: 10px; }
  .calendar-toolbar .calendar-month-control { grid-column: 1 / -1; justify-self: center; }
  .calendar-toolbar .calendar-month-control h3 { min-width: 145px; }
  .calendar-views { grid-column: 1; }
  .calendar-toolbar .calendar-search { grid-column: 1 / -1; grid-row: 3; justify-self: stretch; max-width: none; }
  .calendar-toolbar .calendar-selection { grid-column: 2; grid-row: 2; }
  .calendar-selection .eyebrow { font-size: 7px; }
  .calendar-selection strong { font-size: 9px; }
  .calendar-selection #selected-day-count { font-size: 8px; }
  .calendar-toolbar .calendar-scroll > .calendar-grid { min-width: 740px; }
  .calendar-toolbar .calendar-search { width: 100%; }
  .calendar-day.week-day { min-height: 220px; }
  .agenda-list-head { display: none; }
  .agenda-event-row, .agenda-event-row.compact { grid-template-columns: minmax(78px, .7fr) minmax(0, 1.6fr); gap: 8px 12px; padding: 12px 6px; }
  .agenda-event-time { grid-column: 1; }
  .agenda-event-row .process-status { grid-column: 2; grid-row: 2; }
  .agenda-event-row .agenda-event-main { grid-column: 2; grid-row: 1; }
}

@media (max-width: 760px) {
  body:has(#login-screen:not([hidden])) { padding-bottom: env(safe-area-inset-bottom); }
  #login-screen { min-height: 100dvh; grid-template-columns: 1fr; }
  .login-card { width: min(420px, calc(100% - 44px)); padding: 36px 0; }
  .brand-mark-large { margin-bottom: 30px; }
  .login-art { min-height: 220px; }
  .art-caption { right: 22px; bottom: 20px; left: 22px; }
  .work-timeline { width: 100%; min-width: 0; grid-template-columns: repeat(7, minmax(78px, 1fr)); touch-action: pan-x; }
}
