:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #17243b;
  background: #f4f6fb;
  --ink: #17243b;
  --muted: #586780;
  --line: #dfe5ef;
  --bg: #f4f6fb;
  --surface: #fff;
  --accent: #3158c9;
  --primary: #3158c9;
  --border: #dfe5ef;
  --danger: #ad2d3e;
  --success: #167052;
  --shadow: 0 2px 6px rgb(22 37 66 / 5%);
  font-size: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; font-size: 1rem; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid #687fe8; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.025em; }
h1 { margin-bottom: .4rem; font-size: clamp(1.8rem, 2.8vw, 2.5rem); }
h2 { font-size: 1.24rem; margin-bottom: .5rem; }
h3 { font-size: 1.05rem; margin-bottom: .4rem; }
p { margin-bottom: 1rem; }
a { color: var(--accent); }
small, .subtle { color: var(--muted); font-size: .875rem; }
.muted { color: var(--muted); }
.rotinas-resumo { white-space: pre-wrap; overflow-wrap: anywhere; }
.stack { display: grid; gap: .85rem; }
.grid, .fields { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: .9rem;
  padding: clamp(.95rem, 2vw, 1.35rem);
  box-shadow: var(--shadow);
  min-width: 0;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .56rem .92rem;
  min-height: 2.6rem;
  border: 1px solid #cdd7e8;
  border-radius: .55rem;
  background: #fff;
  color: #233653;
  text-decoration: none;
  font-weight: 650;
  font-size: .9rem;
  text-align: center;
}
.btn:hover { background: #f1f4fb; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #2747a8; border-color: #2747a8; }
.btn.danger { color: var(--danger); border-color: #f1c7cd; }
.btn.compact { min-height: 2.25rem; padding: .35rem .72rem; }
.pill {
  font-size: .84rem;
  font-weight: 650;
  display: inline-block;
  color: #294185;
  background: #edf1ff;
  border-radius: 99px;
  padding: .2rem .6rem;
}
.pill.success { color: #116148; background: #e6f7ef; }
.pill.warning { color: #775011; background: #fff3d9; }
.field { display: grid; gap: .3rem; font-size: .9rem; font-weight: 650; color: var(--ink); }
.field small { font-weight: normal; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  min-width: 0;
  max-width: 100%;
  padding: .54rem .72rem;
  border: 1px solid #cbd6e8;
  border-radius: .52rem;
  background: #fff;
  color: var(--ink);
  min-height: 2.62rem;
  font-size: 1rem;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
textarea { resize: vertical; }
input[type="file"] { max-width: 100%; font-size: .89rem; }
input::file-selector-button { margin-right: .55rem; padding: .36rem .65rem; border: 1px solid var(--line); border-radius: .45rem; background: #edf1fa; color: var(--ink); }
label > input:not([type="checkbox"]):not([type="radio"]), label > select, label > textarea { width: 100%; }
.table-wrap { width: 100%; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: .69rem .55rem; border-bottom: 1px solid #e8edf5; vertical-align: middle; }
th { background: #f6f8fc; color: #4e607a; font-size: .86rem; font-weight: 680; }
tr:last-child td { border-bottom: 0; }
.empty { padding: .9rem 0; margin: 0; color: var(--muted); }
.form-error { color: var(--danger); background: #fff1f3; border: 1px solid #f4d0d5; border-radius: .6rem; padding: .63rem .78rem; font-size: .91rem; margin-bottom: 1rem; }

.brand { display: flex; align-items: center; gap: .68rem; line-height: 1.22; letter-spacing: -.015em; }
.brand-mark { display: inline-block; flex: 0 0 2rem; height: 2rem; position: relative; border-radius: .57rem; background: #5376e9; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 22%); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; height: .19rem; border-radius: 1rem; left: .48rem; background: #fff; }
.brand-mark::before { width: 1rem; top: .64rem; }
.brand-mark::after { width: .73rem; top: 1.12rem; }
.entry {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.1rem;
  background: radial-gradient(ellipse at 17% 5%, #e2e9ff, transparent 55%), #f4f6fb;
}
.entry-card {
  width: min(100%, 29rem);
  padding: clamp(1.35rem, 4vw, 2.45rem);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 16px 60px rgb(35 59 105 / 10%);
  border-radius: 1.15rem;
}
.entry-card .brand { margin-bottom: 1.9rem; }
.entry-card h1 { font-size: 1.75rem; }
.entry-card form { margin-top: 1.15rem; }
.entry-card form .btn { margin-top: .55rem; }

.app-shell { display: grid; grid-template-columns: 15rem minmax(0,1fr); min-height: 100vh; }
.sidebar { background: #17243b; color: #f8fbff; display: flex; flex-direction: column; padding: 1.55rem 1rem 1rem; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { margin: 0 .42rem 2rem; }
.sidebar nav { display: grid; gap: .28rem; }
.sidebar nav button {
  background: transparent;
  color: #d5e0f1;
  border: 1px solid transparent;
  padding: .62rem .74rem;
  min-height: 2.7rem;
  border-radius: .53rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .94rem;
  font-weight: 580;
  text-align: left;
}
.sidebar nav button span { width: 1.25rem; text-align: center; font-size: 1.1rem; color: #acc0e8; line-height: 1; }
.sidebar nav button:hover, .sidebar nav button[aria-current] { background: #263953; color: #fff; }
.sidebar nav button[aria-current] { border-color: #395581; }
.sidebar nav button[aria-current] span { color: #dbe7ff; }
.sidebar-foot { margin-top: auto; padding: .75rem .4rem .15rem; border-top: 1px solid #32425b; display: flex; justify-content: space-between; gap: .6rem; align-items: center; }
.sidebar-foot span { color: #c6d4ec; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot button { background: transparent; border: 0; color: #fff; text-decoration: underline; padding: .3rem; font-size: .85rem; }
.main-column { min-width: 0; }
.topbar { background: #fff; padding: .7rem clamp(1rem, 3vw, 2.6rem); min-height: 4rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.topbar > span { color: var(--muted); font-size: .9rem; }
.workspace-main { max-width: 94rem; margin-inline: auto; padding: clamp(1rem, 3vw, 2.6rem); }
.workspace-main:focus { outline: none; }
.page-heading { margin-bottom: 1.5rem; }
.page-heading p { margin-bottom: 0; }
.demo-banner { font-size: .88rem; color: #624609; background: #fff4d5; border: 1px solid #efdc9e; border-radius: .5rem; padding: .45rem .7rem; margin-bottom: 1rem; }
.metrics { display: grid; gap: .82rem; grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 1rem; }
.metric { background: #fff; border: 1px solid var(--line); border-radius: .82rem; position: relative; text-align: left; display: grid; gap: .45rem; padding: .9rem 1rem; box-shadow: var(--shadow); color: var(--ink); }
.metric:hover { border-color: #aebdeb; }
.metric span { color: var(--muted); font-size: .9rem; }
.metric strong { font-size: 1.85rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric.urgent strong { color: var(--danger); }
.metric.due strong { color: #85560c; }
.metric.incomplete strong { color: #3455a7; }
.metric.count strong { color: var(--success); }
.home-grid { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
.dashboard.wide { grid-column: 1 / -1; }
.section-head { display: flex; justify-content: space-between; gap: .8rem; align-items: center; margin-bottom: .24rem; }
.section-head h2, .section-head p { margin-bottom: .22rem; }
.section-head p { font-size: .9rem; }
.work-row { display: flex; align-items: center; gap: .72rem; border-top: 1px solid #e7edf5; padding: .7rem 0; min-width: 0; }
.work-row:first-of-type { margin-top: .35rem; }
.work-row:last-child { padding-bottom: 0; }
.work-row > div { flex: 1; overflow-wrap: anywhere; }
.work-row small { display: block; font-size: .88rem; }
.deadline-tag { display: inline-block; flex-shrink: 0; color: #2e4b91; background: #ebf1ff; font-variant-numeric: tabular-nums; border-radius: .46rem; padding: .24rem .45rem; font-weight: 700; font-size: .84rem; }
.deadline-tag.late { color: #9c293b; background: #ffedf0; }
.deadline-tag.today { color: #805415; background: #fff3d9; }
.clipboard-fallback { position: fixed; top: -10000px; }
#toast { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 10; max-width: min(29rem, calc(100vw - 2.5rem)); padding: .68rem .9rem; color: #fff; background: #223451; border-radius: .6rem; box-shadow: 0 6px 25px rgb(20 39 72 / 20%); }
#toast.error { background: #92283a; }
dialog { max-width: min(47rem, calc(100% - 1.4rem)); max-height: calc(100% - 1.4rem); border: 1px solid var(--line); border-radius: .9rem; box-shadow: 0 20px 65px #15274735; color: var(--ink); padding: clamp(.85rem, 3vw, 1.4rem); }
dialog::backdrop { background: #14254170; }

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 11.2rem minmax(0,1fr); }
  .sidebar { padding-inline: .65rem; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: .8rem .85rem .45rem; }
  .sidebar .brand { margin: 0 0 .6rem; }
  .sidebar .brand br { display: none; }
  .sidebar .brand strong { font-size: 1rem; }
  .sidebar nav { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .sidebar nav button { font-size: .83rem; gap: .24rem; padding-inline: .35rem; min-height: 2.25rem; }
  .sidebar nav button span { width: .9rem; font-size: .89rem; }
  .sidebar-foot { margin-top: .45rem; padding: .25rem 0 0; }
  .topbar { flex-wrap: wrap; }
  .topbar > span { width: 100%; }
  .topbar .btn { min-height: 2.15rem; }
  .section-head { align-items: flex-start; }
}
