@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
  --navy: #0a1128;
  --ink: #1c2332;
  --muted: #6b7482;
  --line: #e5e0d9;
  --bg: #faf9f6;
  --white: #fff;
  --blue: #8c552a;
  --gold: #b87d4b;
  --green: #24765a;
  --red: #aa4f48;
  --copper-soft: #f7efe7;
  --shadow: 0 8px 28px rgba(10, 17, 40, .055);
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, sans-serif; line-height: 1.5; }
::selection { background: #b87d4b47; }
:focus-visible { outline: 3px solid #b87d4b88; outline-offset: 3px; }
h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; color: var(--navy); letter-spacing: -.025em; }
h1 { font-size: clamp(30px, 3vw, 39px); font-weight: 600; line-height: 1.2; }
h2 { font-size: 25px; font-weight: 600; }
h3 { font-size: 19px; font-weight: 600; }
.eyebrow { color: #8c552a; font-size: 11px; letter-spacing: .12em; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }

body:not(.auth-page) > aside {
  width: 254px;
  min-height: 100vh;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding: 25px 15px 20px;
  background: radial-gradient(circle at 30% 0%, #162746 0, #0a1128 55%, #060b1b 100%);
  border-right: 1px solid #b87d4b38;
  color: #e6eaf0;
}
.brand { text-decoration: none; }
body:not(.auth-page) > aside .brand { margin: 0 8px 32px; padding-bottom: 23px; border-bottom: 1px solid #b87d4b38; gap: 12px; }
.brand-mark { width: 42px; height: 46px; flex: 0 0 auto; display: block; }
.brand .brand-name { display: block; color: #fff; font-family: 'Playfair Display', Georgia, serif; font-size: 17px; font-weight: 600; line-height: 1.15; letter-spacing: .055em; text-transform: uppercase; }
.brand .brand-subtitle { display: block; margin-top: 6px; color: #c99263; font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.nav-group-label { margin: 22px 12px 7px; color: #a4785d; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
body:not(.auth-page) > aside nav { display: grid; gap: 3px; }
body:not(.auth-page) > aside nav::before { content: 'NAVEGAÇÃO'; display: block; padding: 0 12px 7px; color: #a4785d; font-size: 10px; font-weight: 700; letter-spacing: .16em; }
body:not(.auth-page) > aside nav a { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 9px 12px; border: 1px solid transparent; border-radius: 7px; color: #d6dce5; font-size: 13px; font-weight: 500; transition: background .15s, color .15s, border-color .15s; }
body:not(.auth-page) > aside nav a:hover, body:not(.auth-page) > aside nav a.active { background: #ffffff13; border-color: #b87d4b36; color: #fff; }
body:not(.auth-page) > aside nav a.active { box-shadow: inset 3px 0 #c58d5a; }
body:not(.auth-page) > aside nav a.active:before { display: none; }
.nav-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: #c58d5a; }
body:not(.auth-page) > aside nav a.active .nav-icon { color: #e0ab79; }
.aside-foot { margin-top: auto; padding: 18px 12px 4px; border-top: 1px solid #b87d4b32; color: #b4bfce; font-size: 11px; }
.aside-foot span { color: #8c9bb0; }

body:not(.auth-page) > main { max-width: 1510px; min-width: 0; width: 100%; margin: 0 auto; padding: 27px clamp(22px, 3vw, 47px) 24px; }
.app-header { display: flex; align-items: center; gap: 22px; margin: 0 0 30px; padding: 0 0 19px; border-bottom: 1px solid var(--line); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.search-wrap { max-width: 520px; }
.search-wrap input { min-height: 43px; padding: 10px 17px 10px 42px; border: 1px solid #ded8d0; border-radius: 8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23826E62' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat 15px center; color: var(--ink); font: inherit; font-size: 12px; box-shadow: 0 2px 10px #0a112808; }
.search-wrap input:focus { outline: none; border-color: #b87d4b; box-shadow: 0 0 0 3px #b87d4b28; }
.search-results { top: 48px; border-radius: 9px; box-shadow: 0 14px 35px #0a112824; }
.header-user { display: grid; text-align: right; line-height: 1.25; }
.header-user strong { font-size: 12px; color: var(--navy); }
.header-user small { color: var(--muted); font-size: 10px; }
.icon-btn, .avatar { width: 39px; height: 39px; border-color: var(--line); }
.avatar { display: grid; place-items: center; background: var(--copper-soft); color: #8c552a; }
.notification-button { color: #8c552a; font-size: 18px; }
.notification-button .nav-icon { width: 19px; height: 19px; color: #8c552a; }
.header-actions .link-btn { color: var(--muted); font-size: 11px; font-weight: 600; }

.page-title { margin: 4px 0 27px; }
.page-title .muted { margin-top: 6px; }
.hero { min-height: 150px; border: 1px solid #dfc5a9; border-radius: 12px; background: linear-gradient(115deg, #fcf9f4, #f5e8d7); color: var(--navy); box-shadow: var(--shadow); }
.hero h2 { color: var(--navy); }
.hero p:not(.eyebrow) { color: #675c55; }
.hero .eyebrow.light { color: #8c552a; }
.hero-orbit { color: #b87d4b24; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.hero-actions a { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 12px; border: 1px solid #cda77f; border-radius: 5px; color: #6d4122; text-decoration: none; font-size: 11px; font-weight: 700; }
.hero-actions a:hover { background: #fff9; }
.module-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 18px 0 16px; }
.module-card { display: flex; align-items: flex-start; gap: 13px; min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow); color: var(--navy); text-decoration: none; transition: border-color .15s, transform .15s; }
.module-card:hover { border-color: #b87d4b; transform: translateY(-2px); }
.module-card-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--copper-soft); color: #8c552a; }
.module-card-icon .nav-icon { color: #8c552a; }
.module-card-content { display: grid; flex: 1; gap: 5px; min-width: 0; }
.module-card-content strong { font-family: 'Playfair Display', Georgia, serif; font-size: 17px; }
.module-card-content small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.module-card-content em { margin-top: 7px; font-size: 10px; font-style: normal; font-weight: 700; }
.module-live { color: var(--green); }
.module-offline { color: #a65a40; }
.module-note { margin: 0 0 22px; }
.metrics { gap: 13px; }
.metrics article, .panel { background: #fff; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); }
.metrics article { min-height: 107px; padding: 18px; }
.metrics strong { color: var(--navy); font-size: 24px; font-weight: 700; line-height: 1.2; }
.metrics article span:not(.metric-icon) { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.metrics article > small { color: var(--muted); font-size: 11px; }
.metrics.compact article { min-height: 86px; }
.metrics.compact strong { font-size: 20px; }
.metric-icon { border-radius: 8px; }
.metric-icon.blue, .metric-icon.gold { background: var(--copper-soft); color: #8c552a; }
.metric-icon.green { background: #e9f5ee; color: var(--green); }
.metric-icon.red { background: #fbefec; color: var(--red); }
.panel { padding: 22px; }
.panel-head { gap: 15px; }
.link-btn { color: #8c552a; font-weight: 700; text-decoration: none; }
.link-btn:hover, td a:hover { text-decoration: underline; }
.status { background: #eaf5ef; color: var(--green); }
.task, .movement, .client, .finance-row { border-top-color: #eeeae5; }
.primary-btn { min-height: 40px; padding: 10px 16px; border-radius: 6px; background: linear-gradient(135deg, #b87d4b, #d89868 50%, #a06436); color: #0a1128; font-size: 12px; font-weight: 700; box-shadow: 0 5px 16px #a064362e; }
.primary-btn:hover { filter: brightness(1.05); }
.secondary-btn { min-height: 40px; padding: 9px 14px; border: 1px solid #cfc5ba; border-radius: 6px; background: #fff; color: var(--navy); font-weight: 600; cursor: pointer; }
.secondary-btn:hover { background: #fcf8f3; border-color: #b87d4b; }
.form-grid input, .form-grid select, .form-grid textarea, .inline-form input, .inline-form select, .opportunity-card input, .opportunity-card select { min-height: 39px; border-color: #dcd6ce; border-radius: 6px; font: inherit; font-size: 12px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { outline: none; border-color: #b87d4b; box-shadow: 0 0 0 3px #b87d4b24; }
.form-grid label { color: #535d6b; font-size: 12px; font-weight: 600; }
th { color: #65584f; background: #fbfaf8; }
td { border-bottom-color: #eeeae5; }
td a { color: #7d4c2c; }
.kanban-column { background: #f2eee8; border: 1px solid #e5ded5; }
.opportunity-card { border-color: #e5ded5; box-shadow: 0 3px 12px #0a11280a; }
.timeline-dot { background: #b87d4b; }
.toast { background: var(--navy); border: 1px solid #c58d5a55; }
footer { color: #88909a; text-align: left; border-top: 1px solid var(--line); margin-top: 28px; }
footer a { color: #8c552a; }

body.auth-page { display: grid; grid-template-columns: minmax(340px, 46%) minmax(0, 1fr); min-height: 100vh; place-items: stretch; background: var(--bg); }
body.error-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: var(--bg); }
body.error-page .auth-card { display: grid; justify-items: start; gap: 12px; }
body.error-page .auth-card h1 { margin: 0; }
body.error-page .auth-card .primary-btn { width: auto; margin-top: 12px; text-decoration: none; }
.auth-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; width: 100%; min-height: 100vh; overflow: hidden; padding: clamp(32px, 5vw, 74px); background: radial-gradient(circle at 20% 5%, #1c3356 0, #0a1128 58%, #060b1b 100%); color: #fff; }
.auth-aside:after { content: ''; position: absolute; right: -100px; bottom: -180px; width: 520px; height: 520px; border: 1px solid #b87d4b33; border-radius: 50%; box-shadow: 0 0 0 68px #b87d4b0d, 0 0 0 150px #b87d4b09; pointer-events: none; }
.auth-aside .brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 15px; margin: 0; }
.auth-aside .brand-mark { width: 55px; height: 60px; }
.auth-aside .brand-name { font-size: 20px; }
.auth-intro { position: relative; z-index: 1; max-width: 540px; }
.auth-intro .eyebrow { color: #c99263; }
.auth-intro h2 { margin: 14px 0; color: #fff; font-size: clamp(36px, 4vw, 56px); line-height: 1.13; }
.auth-intro p:not(.eyebrow) { max-width: 470px; color: #c2cbd9; font-size: 15px; line-height: 1.7; }
.auth-aside footer { position: relative; z-index: 1; margin: 0; padding: 0; border: 0; color: #8c9bb0; font-size: 11px; }
.auth-main { display: grid; place-items: center; width: 100%; max-width: none; min-width: 0; margin: 0; padding: 38px 22px; }
.auth-card { width: min(440px, 100%); padding: 38px; border: 1px solid #e8e0d8; border-radius: 13px; background: #fff; box-shadow: 0 18px 55px #0a11280e; }
.auth-card .eyebrow { color: #8c552a; }
.auth-card h1 { margin: 10px 0 8px; font-size: clamp(28px, 3vw, 35px); }
.auth-card .auth-description { color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-card form { gap: 17px; margin-top: 29px; }
.auth-card label { color: #485161; font-size: 12px; font-weight: 600; }
.auth-card input { min-height: 44px; padding: 11px 13px; border: 1px solid #dcd6ce; border-radius: 6px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; }
.auth-card input:focus { outline: none; border-color: #b87d4b; box-shadow: 0 0 0 3px #b87d4b24; }
.auth-card .primary-btn { width: 100%; margin-top: 5px; }
.auth-card .form-error { padding: 12px 14px; border: 1px solid #eac9c4; border-radius: 6px; }
.auth-security { display: flex; align-items: center; gap: 8px; margin-top: 24px; color: #7e8894; font-size: 11px; }
.auth-security svg { width: 15px; height: 15px; color: #8c552a; }

@media (max-width: 960px) {
  .module-grid { grid-template-columns: 1fr; }
  body:not(.auth-page) > aside { width: 218px; padding: 20px 10px; }
  body:not(.auth-page) > main { padding: 24px 25px; }
  .header-user { display: none; }
  body.auth-page { grid-template-columns: minmax(280px, 42%) minmax(0, 1fr); }
}
@media (max-width: 700px) {
  body:not(.auth-page) { display: block; }
  body:not(.auth-page) > aside { position: relative; width: 100%; min-height: 0; height: auto; overflow: visible; padding: 15px; }
  body:not(.auth-page) > aside .brand { margin: 0 0 12px; padding-bottom: 12px; }
  .brand-mark { width: 33px; height: 38px; }
  .brand-name { font-size: 15px; }
  .nav-group-label { display: none; }
  body:not(.auth-page) > aside nav { display: flex; overflow-x: auto; padding-bottom: 5px; gap: 3px; }
  body:not(.auth-page) > aside nav { scrollbar-width: none; }
  body:not(.auth-page) > aside nav::-webkit-scrollbar { display: none; }
  body:not(.auth-page) > aside nav::before { display: none; }
  body:not(.auth-page) > aside nav a { white-space: nowrap; padding: 8px 10px; font-size: 11px; }
  .nav-icon { width: 15px; height: 15px; }
  body:not(.auth-page) > main { padding: 22px 16px; }
  .app-header { display: flex; gap: 10px; margin-bottom: 25px; padding-bottom: 13px; }
  .search-wrap { max-width: none; }
  .header-actions { display: flex; gap: 7px; }
  .header-actions .avatar { display: none; }
  .notification-button { display: grid; }
  .page-title { display: block; margin-bottom: 22px; }
  .hero { min-height: 0; padding: 21px; }
  .hero-orbit { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics article { min-width: 0; }
  .metrics strong { font-size: 20px; overflow-wrap: anywhere; }
  .grid, .split, .agenda-columns, .tabs-grid { grid-template-columns: 1fr; }
  body.auth-page { display: block; }
  .auth-aside { min-height: 0; padding: 24px 22px; }
  .auth-aside .brand-mark { width: 40px; height: 45px; }
  .auth-intro, .auth-aside footer { display: none; }
  .auth-main { min-height: calc(100vh - 99px); padding: 25px 16px; }
  .auth-card { padding: 30px 24px; }
}
@media (max-width: 390px) {
  .metrics { grid-template-columns: 1fr; }
  .search-wrap input { font-size: 11px; }
}

/* Assinatura do escritório, com a mesma proporção do Radar Processual. */
body:not(.auth-page) > aside .brand,
.auth-aside .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
body:not(.auth-page) > aside .brand-mark,
.auth-aside .brand-mark {
  display: block;
  width: 176px;
  height: auto;
  max-width: 100%;
  filter: brightness(0) invert(1);
}
body:not(.auth-page) > aside .brand > div,
.auth-aside .brand > span {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #b87d4b40;
}
body:not(.auth-page) > aside .brand-name,
.auth-aside .brand-name { display: none; }
body:not(.auth-page) > aside .brand-subtitle,
.auth-aside .brand-subtitle {
  margin-top: 0;
  color: #cd925c;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
}
.auth-aside .brand-mark { width: min(240px, 100%); }
@media (max-width: 700px) {
  body:not(.auth-page) > aside .brand-mark,
  .auth-aside .brand-mark { width: 165px; height: auto; }
  body:not(.auth-page) > aside .brand > div,
  .auth-aside .brand > span { margin-top: 10px; padding-top: 9px; }
}
