:root {
  --brand: #d85a30;
  --brand-dark: #a63b1c;
  --brand-light: #f8e5de;
  --brand-pale: #fff8f4;
  --ink: #181814;
  --ink-soft: #5f625e;
  --ink-muted: #8b8d87;
  --sidebar: #191a18;
  --sidebar-soft: #242521;
  --canvas: #f5f4ef;
  --panel: #fffefa;
  --line: #e6e3da;
  --line-strong: #d8d4c9;
  --success: #34785b;
  --success-pale: #e7f3ec;
  --warning: #a46b16;
  --warning-pale: #fbf1dc;
  --danger: #a43f39;
  --danger-pale: #f8e8e6;
  --blue: #376a8f;
  --blue-pale: #e7f0f6;
  --shadow-sm: 0 1px 3px rgba(32, 28, 22, 0.06);
  --shadow-md: 0 14px 36px rgba(43, 36, 26, 0.1);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar-width: 264px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--canvas);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(216, 90, 48, 0.22);
  outline-offset: 2px;
}

.icon-sprite {
  position: fixed;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  display: block;
  color: var(--brand);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow.light {
  color: rgba(255, 255, 255, 0.72);
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 750;
  gap: 8px;
  justify-content: center;
  min-height: 42px;
  padding: 0 17px;
  text-decoration: none;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 6px 16px rgba(216, 90, 48, 0.18);
}

.button-primary:hover {
  background: #c94e28;
  box-shadow: 0 8px 20px rgba(216, 90, 48, 0.25);
}

.button-secondary {
  background: white;
  border-color: var(--line-strong);
  color: var(--ink);
}

.button-secondary:hover {
  background: #f9f8f4;
  border-color: #c6c1b6;
}

.button-light {
  background: white;
  color: var(--ink);
  position: relative;
  z-index: 2;
}

.button-light:hover {
  background: var(--brand-pale);
}

.button-full {
  width: 100%;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.icon-button:hover {
  background: rgba(24, 24, 20, 0.06);
  color: var(--ink);
}

.icon-button.on-dark {
  color: rgba(255, 255, 255, 0.54);
}

.icon-button.on-dark:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

/* Login */
.login-view {
  align-items: center;
  background: var(--brand);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  padding: 64px clamp(24px, 6vw, 96px);
  position: relative;
}

.login-view::before {
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.12), transparent 35%), linear-gradient(135deg, rgba(119, 40, 17, 0.13), transparent 45%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.login-orbit {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  pointer-events: none;
  position: absolute;
}

.orbit-one {
  height: 620px;
  right: -210px;
  top: -250px;
  width: 620px;
}

.orbit-two {
  bottom: -390px;
  height: 760px;
  left: -270px;
  width: 760px;
}

.login-layout {
  align-items: center;
  display: grid;
  gap: clamp(48px, 8vw, 130px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  margin: 0 auto;
  max-width: 1220px;
  position: relative;
  width: 100%;
  z-index: 1;
}

.login-intro {
  color: white;
  max-width: 640px;
}

.login-intro h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.3rem, 6vw, 6.4rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.94;
  margin: 20px 0 28px;
}

.login-intro p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.08rem;
  line-height: 1.7;
  margin: 0;
  max-width: 500px;
}

.login-card {
  background: var(--panel);
  border-radius: 25px;
  box-shadow: 0 30px 90px rgba(81, 25, 8, 0.24);
  overflow: hidden;
  padding: 0 42px 32px;
}

.login-logo-wrap {
  align-items: center;
  background: #df5a2e;
  display: flex;
  height: 142px;
  justify-content: center;
  margin: 0 -42px 32px;
  overflow: hidden;
}

.login-logo {
  display: block;
  height: auto;
  max-width: 230px;
  width: 58%;
}

.login-card-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 8px 0 7px;
}

.login-card-copy p {
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 0 0 26px;
}

.login-card form {
  display: grid;
  gap: 9px;
}

.login-card label,
.dialog-fields label {
  color: #555750;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-top: 8px;
  text-transform: uppercase;
}

.login-card input,
.dialog-fields input,
.dialog-fields select,
.dialog-fields textarea {
  background: #fbfaf6;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  min-height: 46px;
  padding: 0 13px;
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  width: 100%;
}

.login-card input:focus,
.dialog-fields input:focus,
.dialog-fields select:focus,
.dialog-fields textarea:focus {
  background: white;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(216, 90, 48, 0.12);
  outline: 0;
}

.login-card .button {
  margin-top: 12px;
}

.form-error {
  color: var(--danger);
  font-size: 0.78rem;
  margin: 0;
  min-height: 17px;
}

.demo-hint {
  color: var(--ink-muted);
  font-size: 0.73rem;
  margin: 18px 0 0;
  text-align: center;
}

/* App shell */
.app-shell {
  background: var(--canvas);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  color: white;
  display: flex;
  flex-direction: column;
  height: 100vh;
  inset: 0 auto 0 0;
  overflow-y: auto;
  position: fixed;
  width: var(--sidebar-width);
  z-index: 30;
}

.brand {
  align-items: center;
  background: #df5a2e;
  display: flex;
  flex: 0 0 auto;
  height: 108px;
  justify-content: center;
  overflow: hidden;
  padding: 16px 30px;
}

.brand img {
  display: block;
  height: auto;
  max-width: 180px;
  width: 100%;
}

.main-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 24px 14px;
}

.nav-label {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin: 0 12px 9px;
  text-transform: uppercase;
}

.nav-label-spaced {
  margin-top: 28px;
}

.nav-link {
  align-items: center;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.58);
  display: flex;
  font-size: 0.88rem;
  font-weight: 650;
  gap: 12px;
  min-height: 45px;
  padding: 0 13px;
  text-decoration: none;
}

.nav-link svg {
  height: 18px;
  width: 18px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.055);
  color: white;
}

.nav-link.active {
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
  color: white;
}

.nav-count {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  font-size: 0.66rem;
  margin-left: auto;
  min-width: 23px;
  padding: 3px 6px;
  text-align: center;
}

.nav-link.active .nav-count {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 0 14px;
  padding: 16px 0 20px;
}

.user-card {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.avatar {
  align-items: center;
  background: var(--brand);
  border: 2px solid rgba(255,255,255,.1);
  border-radius: 50%;
  color: white;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.user-card strong,
.user-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card strong {
  font-size: 0.8rem;
}

.user-card small {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.69rem;
  margin-top: 3px;
}

.main-area {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  align-items: center;
  background: rgba(255, 254, 250, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 88px;
  justify-content: space-between;
  padding: 0 clamp(24px, 3.7vw, 56px);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.topbar-title h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 3px 0 0;
}

.topbar-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.global-search,
.search-field {
  align-items: center;
  background: #f7f5ef;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-muted);
  display: flex;
  min-height: 42px;
}

.global-search {
  padding: 0 10px 0 13px;
  width: 300px;
}

.global-search svg,
.search-field svg {
  flex: 0 0 auto;
  height: 17px;
  width: 17px;
}

.global-search input,
.search-field input {
  background: transparent;
  border: 0;
  color: var(--ink);
  min-width: 0;
  outline: 0;
  padding: 0 10px;
  width: 100%;
}

.global-search span {
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-muted);
  flex: 0 0 auto;
  font-size: 0.64rem;
  padding: 3px 5px;
}

.menu-button {
  display: none;
}

.page-container {
  margin: 0 auto;
  max-width: 1560px;
  padding: 34px clamp(24px, 3.7vw, 56px) 60px;
}

.page {
  animation: page-in 220ms ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-panel {
  align-items: center;
  background: var(--brand);
  border-radius: var(--radius-lg);
  color: white;
  display: flex;
  justify-content: space-between;
  min-height: 206px;
  overflow: hidden;
  padding: 38px 42px;
  position: relative;
}

.welcome-panel > div {
  max-width: 620px;
  position: relative;
  z-index: 2;
}

.welcome-panel h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.2vw, 3.15rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin: 11px 0 13px;
}

.welcome-panel p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

.welcome-shape {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  position: absolute;
}

.shape-a {
  height: 330px;
  right: 70px;
  top: -180px;
  width: 330px;
}

.shape-b {
  bottom: -220px;
  height: 400px;
  right: -100px;
  width: 400px;
}

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

.kpi-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 18px;
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  padding: 22px;
}

.kpi-topline {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.kpi-label {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.kpi-icon {
  align-items: center;
  background: var(--brand-light);
  border-radius: 9px;
  color: var(--brand);
  display: inline-flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.kpi-icon svg {
  height: 16px;
  width: 16px;
}

.kpi-value {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.6rem, 2.2vw, 2.15rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  margin-top: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-meta {
  color: var(--ink-muted);
  display: block;
  font-size: 0.69rem;
  margin-top: 5px;
}

.kpi-meta.positive {
  color: var(--success);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.75fr);
  margin-top: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 23px 24px 16px;
}

.panel-heading h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 5px 0 0;
}

.range-chip {
  background: #f5f2eb;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-soft);
  font-size: 0.69rem;
  font-weight: 700;
  padding: 7px 10px;
}

.chart-summary {
  align-items: baseline;
  display: flex;
  gap: 9px;
  padding: 0 24px;
}

.chart-summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 500;
}

.chart-summary span {
  color: var(--ink-muted);
  font-size: 0.7rem;
}

.bar-chart {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(7, 1fr);
  height: 196px;
  padding: 24px 24px 21px;
}

.bar-column {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  justify-content: end;
  min-width: 0;
}

.bar-track {
  align-items: end;
  background: #f2eee7;
  border-radius: 8px 8px 3px 3px;
  display: flex;
  flex: 1;
  justify-content: center;
  overflow: hidden;
  width: min(36px, 72%);
}

.bar-fill {
  background: var(--brand);
  border-radius: 8px 8px 3px 3px;
  min-height: 6px;
  position: relative;
  width: 100%;
}

.bar-fill:hover::after {
  background: var(--ink);
  border-radius: 6px;
  color: white;
  content: attr(data-value);
  font-size: 0.62rem;
  left: 50%;
  padding: 5px 7px;
  position: absolute;
  top: -30px;
  transform: translateX(-50%);
  white-space: nowrap;
}

.bar-column > span {
  color: var(--ink-muted);
  font-size: 0.63rem;
  font-weight: 700;
}

.status-panel {
  padding-bottom: 16px;
}

.status-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(88px, 1fr) minmax(80px, 1.3fr) 24px;
  padding: 10px 24px;
}

.status-row span,
.status-row strong {
  font-size: 0.71rem;
}

.status-row strong {
  text-align: right;
}

.status-track {
  align-self: center;
  background: #eeeae2;
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
}

.status-track i {
  background: var(--brand);
  border-radius: 99px;
  display: block;
  height: 100%;
}

.table-panel {
  margin-top: 18px;
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 14px 20px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #faf9f5;
  color: var(--ink-muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

td strong {
  color: var(--ink);
  display: block;
  font-size: 0.8rem;
}

.contact-cell span,
.name-cell span {
  color: var(--ink-muted);
  display: block;
  font-size: 0.69rem;
  margin-top: 3px;
}

.name-cell {
  align-items: center;
  display: flex;
  gap: 10px;
}

.name-avatar {
  align-items: center;
  background: var(--brand-light);
  border-radius: 50%;
  color: var(--brand-dark);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.69rem;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.status-badge,
.channel-badge {
  border-radius: 99px;
  display: inline-flex;
  font-size: 0.66rem;
  font-weight: 750;
  padding: 5px 8px;
  white-space: nowrap;
}

.status-new { background: var(--brand-light); color: var(--brand-dark); }
.status-contacted { background: var(--blue-pale); color: var(--blue); }
.status-appointment { background: var(--warning-pale); color: var(--warning); }
.status-won { background: var(--success-pale); color: var(--success); }
.status-lost { background: var(--danger-pale); color: var(--danger); }
.channel-badge { background: #f0eee7; color: var(--ink-soft); }

.text-link {
  align-items: center;
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  gap: 3px;
  text-decoration: none;
}

.text-link svg {
  height: 14px;
  width: 14px;
}

.text-link:hover {
  color: var(--brand);
}

.row-actions {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.row-button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 750;
  min-height: 31px;
  padding: 0 9px;
}

.row-button:hover {
  background: var(--brand-pale);
  border-color: rgba(216, 90, 48, 0.34);
  color: var(--brand-dark);
}

.row-button.danger:hover {
  background: var(--danger-pale);
  border-color: rgba(164, 63, 57, 0.32);
  color: var(--danger);
}

.section-heading {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3vw, 2.7rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  margin: 7px 0 8px;
}

.section-heading p {
  color: var(--ink-soft);
  font-size: 0.88rem;
  margin: 0;
}

.toolbar-panel {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 1fr) 180px 180px;
  padding: 14px;
}

.search-field {
  padding-left: 12px;
}

select {
  background-color: #faf9f5;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  min-height: 42px;
  padding: 0 12px;
}

.table-meta {
  align-items: center;
  color: var(--ink-muted);
  display: flex;
  font-size: 0.67rem;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 20px;
}

.table-meta span:first-child {
  color: var(--ink);
  font-weight: 750;
}

.progress-cell {
  min-width: 140px;
}

.milestone-cell {
  min-width: 230px;
}

.milestone-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px;
}

.milestone-pill {
  background: #f0eee7;
  border-radius: 99px;
  color: var(--ink-soft);
  display: inline-flex;
  font-size: 0.61rem;
  font-weight: 750;
  padding: 5px 7px;
  white-space: nowrap;
}

.milestone-pill.done {
  background: var(--success-pale);
  color: var(--success);
}

.milestone-progress-notes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.milestone-progress-notes span {
  color: var(--ink-soft);
  display: block;
  font-size: 0.68rem;
  line-height: 1.3;
  white-space: normal;
}

.progress-label {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.progress-label span {
  font-size: 0.65rem;
}

.progress-bar {
  background: #eeeae2;
  border-radius: 99px;
  height: 6px;
  margin-top: 7px;
  overflow: hidden;
}

.progress-bar i {
  background: var(--brand);
  border-radius: 99px;
  display: block;
  height: 100%;
}

.security-notice {
  align-items: start;
  background: var(--brand-pale);
  border: 1px solid #f0cabb;
  border-radius: var(--radius);
  color: var(--brand-dark);
  display: flex;
  gap: 13px;
  margin-bottom: 18px;
  padding: 17px 19px;
}

.security-notice svg {
  flex: 0 0 auto;
  height: 20px;
  margin-top: 1px;
  width: 20px;
}

.security-notice strong {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 3px;
}

.security-notice p {
  color: #7e4d3d;
  font-size: 0.73rem;
  line-height: 1.5;
  margin: 0;
}

.credential-grid,
.notes-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.credential-card,
.note-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  padding: 21px;
}

.credential-head,
.note-head {
  align-items: start;
  display: flex;
  justify-content: space-between;
}

.tool-icon {
  align-items: center;
  background: var(--brand-light);
  border-radius: 11px;
  color: var(--brand-dark);
  display: inline-flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  height: 42px;
  justify-content: center;
  text-transform: uppercase;
  width: 42px;
}

.credential-card h3,
.note-card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 16px 0 4px;
}

.credential-card > p,
.note-card > p {
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.55;
  margin: 0;
}

.credential-data {
  background: #f8f6f0;
  border-radius: 10px;
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 13px;
}

.credential-line {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-width: 0;
}

.credential-line span {
  color: var(--ink-muted);
  font-size: 0.66rem;
}

.credential-line code {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reveal-button {
  background: transparent;
  border: 0;
  color: var(--brand-dark);
  cursor: pointer;
  padding: 2px;
}

.reveal-button svg {
  height: 16px;
  width: 16px;
}

.note-tag {
  background: var(--brand-light);
  border-radius: 99px;
  color: var(--brand-dark);
  display: inline-flex;
  font-size: 0.61rem;
  font-weight: 800;
  padding: 5px 8px;
  text-transform: uppercase;
}

.note-date {
  color: var(--ink-muted);
  display: block;
  font-size: 0.64rem;
  margin-top: 18px;
}

.updates-panel {
  padding: 8px 26px;
}

.timeline {
  margin-left: 9px;
}

.timeline-item {
  border-left: 1px solid var(--line-strong);
  padding: 25px 0 27px 34px;
  position: relative;
}

.timeline-item:last-child {
  border-left-color: transparent;
}

.timeline-dot {
  align-items: center;
  background: var(--panel);
  border: 2px solid var(--brand);
  border-radius: 50%;
  display: flex;
  height: 18px;
  justify-content: center;
  left: -9px;
  position: absolute;
  top: 27px;
  width: 18px;
}

.timeline-dot::after {
  background: var(--brand);
  border-radius: 50%;
  content: "";
  height: 6px;
  width: 6px;
}

.timeline-item time {
  color: var(--ink-muted);
  font-size: 0.66rem;
}

.timeline-item h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 500;
  margin: 7px 0;
}

.timeline-item p {
  color: var(--ink-soft);
  font-size: 0.79rem;
  line-height: 1.6;
  margin: 0;
  max-width: 720px;
}

.timeline-delete {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  position: absolute;
  right: 0;
  top: 22px;
  width: 30px;
}

.timeline-delete:hover {
  background: var(--danger-pale);
  color: var(--danger);
}

.timeline-delete svg {
  height: 15px;
  width: 15px;
}

.empty-state {
  color: var(--ink-muted);
  font-size: 0.8rem;
  padding: 42px 20px;
  text-align: center;
}

/* Dialog & toast */
.record-dialog {
  background: transparent;
  border: 0;
  color: var(--ink);
  max-height: calc(100vh - 32px);
  max-width: 620px;
  padding: 0;
  width: calc(100% - 32px);
}

.record-dialog::backdrop {
  background: rgba(18, 17, 14, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,.25);
  overflow: hidden;
}

.dialog-heading {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 25px 28px 20px;
}

.dialog-heading h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 6px 0 0;
}

.dialog-fields {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  padding: 22px 28px;
}

.dialog-fields .field-full {
  grid-column: 1 / -1;
}

.dialog-fields textarea {
  min-height: 105px;
  padding-top: 12px;
  resize: vertical;
}

.checkbox-field {
  margin-top: 7px;
}

.checkbox-control {
  align-items: center;
  background: #f8f6f0;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  min-height: 46px;
  padding: 0 13px;
}

.checkbox-control input {
  accent-color: var(--brand);
  height: 18px;
  margin: 0;
  width: 18px;
}

.checkbox-control span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.dialog-actions {
  align-items: center;
  background: #faf9f5;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  padding: 16px 28px;
}

.toast {
  align-items: center;
  background: var(--ink);
  border-radius: 11px;
  bottom: 24px;
  box-shadow: var(--shadow-md);
  color: white;
  display: flex;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 10px;
  left: 50%;
  opacity: 0;
  padding: 12px 17px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 20px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 100;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast-icon {
  align-items: center;
  background: var(--brand);
  border-radius: 50%;
  display: flex;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.toast-icon svg {
  height: 13px;
  width: 13px;
}

.sidebar-backdrop {
  display: none;
}

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

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

  .global-search {
    width: 230px;
  }
}

@media (max-width: 920px) {
  .login-layout {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .login-intro {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    box-shadow: 20px 0 50px rgba(0,0,0,.18);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    background: rgba(12, 12, 10, 0.45);
    display: block;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 220ms ease;
    z-index: 25;
  }

  .sidebar-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .main-area {
    width: 100%;
  }

  .menu-button {
    display: inline-flex;
    margin-right: 10px;
  }

  .topbar-title {
    margin-right: auto;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .login-view {
    padding: 20px;
  }

  .login-card {
    border-radius: 20px;
    padding: 0 24px 26px;
  }

  .login-logo-wrap {
    margin: 0 -24px 28px;
  }

  .topbar {
    height: 74px;
    padding: 0 16px;
  }

  .topbar-actions .global-search {
    display: none;
  }

  .topbar-actions .button span {
    display: none;
  }

  .topbar-title h1 {
    font-size: 1.3rem;
  }

  .page-container {
    padding: 22px 16px 42px;
  }

  .welcome-panel {
    align-items: start;
    flex-direction: column;
    gap: 24px;
    padding: 28px 24px;
  }

  .kpi-grid,
  .kpi-grid.compact,
  .credential-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 18px;
  }

  .toolbar-panel {
    grid-template-columns: 1fr;
  }

  .table-meta {
    align-items: start;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
  }

  .dialog-fields {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .dialog-fields .field-full {
    grid-column: auto;
  }

  .dialog-heading,
  .dialog-actions {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
