:root {
  --navy: #111111;
  --teal: #f35b69;
  --coral: #f35b69;
  --gold: #c7c7c7;
  --green: #168a67;
  --sky: #8a8f98;
  --lime: #d9d9d9;
  --ink: #151515;
  --sub: #343434;
  --muted: #6e7279;
  --line: #e5e7eb;
  --line-strong: #cfd3da;
  --soft: #f7f7f8;
  --white: #ffffff;
  --page: #f1f3f6;
  --navy-light: #fff0f2;
  --shadow-sm: 0 2px 8px rgba(17, 17, 17, 0.06);
  --shadow-md: 0 10px 24px rgba(17, 17, 17, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --ink: #e5e7eb;
  --sub: #cbd5e1;
  --muted: #94a3b8;
  --line: #263247;
  --line-strong: #334155;
  --soft: #0f172a;
  --white: #111827;
  --page: #020617;
  --navy-light: #1e293b;
}

* {
  box-sizing: border-box;
}

*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

*::-webkit-scrollbar-thumb {
  background: #d0d5dd;
  border-radius: 999px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
}
body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-size: 13px;
  overflow: hidden;
}

#app {
  height: 100vh;
  height: 100dvh;
  min-width: 0;
}

:root[data-theme="dark"] .sidebar {
  background: #050505;
  border-right-color: #2a2a2a;
}

:root[data-theme="dark"] .main,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .stage-card,
:root[data-theme="dark"] .table-wrap,
:root[data-theme="dark"] .dashboard-rail,
:root[data-theme="dark"] .rail-head,
:root[data-theme="dark"] .meeting-item,
:root[data-theme="dark"] .mode-pill {
  background: #111827;
  border-color: #263247;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .toolbar input,
:root[data-theme="dark"] .toolbar select,
:root[data-theme="dark"] .user-status,
:root[data-theme="dark"] .chat-msg,
:root[data-theme="dark"] .search-wrap,
:root[data-theme="dark"] .data-table-toolbar input,
:root[data-theme="dark"] .notification-menu,
:root[data-theme="dark"] .notification-item,
:root[data-theme="dark"] .modal-panel,
:root[data-theme="dark"] .drawer-panel,
:root[data-theme="dark"] #deptFilter {
  background: #0f172a;
  border-color: #334155;
  color: #e5e7eb;
}

:root[data-theme="dark"] .notification-item.unread,
:root[data-theme="dark"] .alert-banner.teal {
  background: #102a2c;
}

:root[data-theme="dark"] .alert-banner.yellow {
  background: #2b220d;
}

:root[data-theme="dark"] .alert-banner.red {
  background: #2a1218;
}

:root[data-theme="dark"] .duplicate-list div,
:root[data-theme="dark"] .timeline-item {
  background: #111827;
  border-color: #334155;
}

:root[data-theme="dark"] .mode-pill button {
  color: #cbd5e1;
}

:root[data-theme="dark"] .mode-pill button.is-active {
  background: #1e293b;
  color: #ffffff;
}

:root[data-theme="dark"] .ring::before,
:root[data-theme="dark"] .stage-body,
:root[data-theme="dark"] .add-lead-row {
  background: #111827;
}

:root[data-theme="dark"] .stat-card strong,
:root[data-theme="dark"] .stage-body strong,
:root[data-theme="dark"] .recent-head h3,
:root[data-theme="dark"] .recent-table td {
  color: #e5e7eb;
}

:root[data-theme="dark"] .recent-table th {
  background: #0f172a;
}

:root[data-theme="dark"] .cal-day {
  background: #1e293b;
  color: #e2e8f0;
}

:root[data-theme="dark"] .cal-day.is-today {
  background: var(--teal);
  color: #ffffff;
}

:root[data-theme="dark"] tbody tr:hover td {
  background: #172033;
}

:root[data-theme="dark"] .panel-head,
:root[data-theme="dark"] .mini-stat {
  background: #111827;
}

:root[data-theme="dark"] th {
  background: #0f172a;
}

:root[data-theme="dark"] tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.55);
}

:root[data-theme="dark"] tbody tr:nth-child(even):hover td {
  background: #172033;
}

:root[data-theme="dark"] .form-error,
:root[data-theme="dark"] .field input.is-invalid,
:root[data-theme="dark"] .field select.is-invalid,
:root[data-theme="dark"] .field textarea.is-invalid,
:root[data-theme="dark"] tr input.is-invalid,
:root[data-theme="dark"] tr select.is-invalid {
  background: #2a1218;
  border-color: #ef4444 !important;
  color: #fecaca;
}

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

button {
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(155deg, rgba(120, 8, 13, 0.78) 0 18%, transparent 18%),
    linear-gradient(28deg, rgba(116, 20, 22, 0.5) 0 34%, transparent 34%),
    linear-gradient(338deg, transparent 0 53%, rgba(12, 3, 4, 0.82) 53% 100%),
    linear-gradient(78deg, rgba(46, 4, 6, 0.72) 0 47%, rgba(12, 0, 2, 0.92) 47% 100%),
    radial-gradient(circle at 32% 76%, rgba(244, 38, 50, 0.26), transparent 28%),
    radial-gradient(circle at 72% 34%, rgba(255, 92, 108, 0.12), transparent 24%),
    #050000;
  position: relative;
  overflow: hidden;
}

.login::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(152deg, transparent 0 42%, rgba(255, 255, 255, 0.045) 42% 42.12%, transparent 42.12%),
    linear-gradient(24deg, transparent 0 58%, rgba(255, 255, 255, 0.035) 58% 58.12%, transparent 58.12%),
    linear-gradient(205deg, transparent 0 62%, rgba(255, 90, 104, 0.08) 62% 62.2%, transparent 62.2%);
  pointer-events: none;
}

.login::after {
  content: "";
  position: absolute;
  inset: auto -10% -22% -10%;
  height: 42%;
  background: radial-gradient(ellipse at center, rgba(213, 22, 32, 0.18), transparent 68%);
  pointer-events: none;
}

.login-panel {
  position: relative;
  z-index: 1;
  width: min(430px, 100%);
  background: var(--white);
  border: 2px solid var(--teal);
  border-radius: 12px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(243, 91, 105, 0.12);
  padding: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.brand img {
  width: 58px;
  height: 34px;
  border-radius: 6px;
  background: #050505;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--navy);
}

.brand p,
.muted {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.field label {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  min-height: 40px;
  padding: 10px 14px;
  background: var(--white);
  color: var(--ink);
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #98a2b3;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #b8c3d4;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus,
.user-status:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(243, 91, 105, 0.16);
}

.required-dot {
  color: #dc2626;
  font-weight: 900;
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid,
tr input.is-invalid,
tr select.is-invalid {
  border-color: #ef4444 !important;
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.form-error {
  grid-column: 1 / -1;
  border: 1px solid #fecaca;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  background: #fff7f7;
  color: #991b1b;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
}

.create-employee-btn {
  min-height: 92px;
  align-self: stretch;
}

.form-status {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.form-status:empty {
  display: none;
}

.form-status.error {
  border-color: #fecaca;
  background: #fff1f2;
  color: #be123c;
}

.designation-edit-btn {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  background: var(--white);
  color: var(--sub);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.designation-edit-btn:hover {
  background: #f8fafc;
}

.primary,
.secondary,
.ghost,
.danger {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.primary {
  background: var(--teal);
  color: var(--white);
  box-shadow: none;
}
.primary:hover {
  background: #dc4656;
}

.secondary {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 6px 14px rgba(33, 57, 111, 0.16);
}
.secondary:hover {
  background: #242424;
}

.ghost {
  background: var(--white);
  color: var(--sub);
  border-color: var(--line-strong);
}
.ghost:hover {
  background: #f5f8fc;
  border-color: #b8c3d4;
}

.danger {
  background: #fef3f2;
  color: #d92d20;
  border-color: #fecdca;
}
.danger:hover {
  background: #fee4e2;
}

.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  background: var(--page);
  overflow: hidden;
}

.sidebar {
  background: #050505;
  color: #fff;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.sidebar .brand {
  margin: 0 8px 28px;
  align-items: center;
  flex-direction: row;
  text-align: left;
  gap: 10px;
}

.sidebar .brand img {
  width: 70px;
  height: 38px;
  border-radius: 6px;
  background: transparent;
  padding: 0;
  object-fit: cover;
}

.sidebar .brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0;
}

.sidebar .brand p {
  margin: 4px 0 0;
  font-size: 10px;
  color: #f35b69;
  letter-spacing: 0;
  font-weight: 700;
  line-height: 1.1;
}

.sidebar-profile {
  margin: 10px 8px 22px;
  text-align: center;
}

.profile-avatar {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f35b69, #c93648);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.profile-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}

.profile-meta {
  margin-top: 2px;
  font-size: 11px;
  color: #b9bcc4;
  font-weight: 600;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  width: 100%;
  padding: 0 14px;
  border-radius: 0;
  color: #d7d7d9;
  background: transparent;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.nav button span {
  width: 18px;
  display: inline-flex;
  justify-content: center;
  color: #f0f0f0;
  font-size: 13px;
}

.nav button:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.nav button.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav button.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 6px;
  bottom: 6px;
  width: 4px;
  background: var(--teal);
  border-radius: 0 8px 8px 0;
}

.sidebar-card {
  margin: auto 2px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 16px 12px;
  text-align: center;
}

.sidebar-card .profile-name {
  font-size: 12px;
}

.sidebar-card .profile-meta {
  line-height: 1.35;
}

#logoutBtn {
  margin-top: 14px;
  min-height: 38px;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  justify-content: flex-start;
}

#logoutBtn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.topbar {
  min-height: 56px;
  background: #fff;
  border-bottom: 1px solid #e6edf7;
  padding: 8px 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-right {
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-wrap {
  width: clamp(220px, 28vw, 340px);
  max-width: 100%;
  min-height: 36px;
  background: #f1f5ff;
  border: 1px solid #e2e8f6;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

.topbar-icon {
  color: #667085;
  font-size: 13px;
}

.search-wrap input {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  width: 100%;
  min-height: 32px;
  font-size: 13px;
  color: #1d2939;
  box-shadow: none !important;
  padding: 0 !important;
}

#search {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 32px !important;
}

.mode-pill {
  background: #f1f5ff;
  border: 1px solid #e2e8f6;
  border-radius: 999px;
  padding: 2px;
  display: flex;
  gap: 2px;
  min-height: 34px;
  align-items: center;
}

.mode-pill button {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #667085;
  background: transparent;
  border: 0;
}

.mode-pill button.is-active {
  background: #fff;
  color: #344054;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.icon-btn {
  min-height: 34px;
  width: 34px;
  border-radius: 999px;
  border: 1px solid #e4e7ec;
  background: #fff;
  color: #344054;
  font-size: 13px;
}

.topbar .primary {
  min-height: 34px;
  border-radius: 8px;
  font-size: 13px;
}

.topbar .ghost {
  min-height: 34px;
  border-radius: 8px;
  font-size: 13px;
  border-color: #7ee6ea;
  color: var(--teal);
}

.topbar #deptFilter {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  min-width: 86px;
}

.content {
  padding: 24px;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 20px;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 0;
  align-items: stretch;
}

.dashboard-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 28px;
  overflow: visible;
  padding-right: 0;
}

.dashboard-rail {
  background: #f7fbff;
  border-left: 1px solid #e6eef6;
  min-height: 100%;
  max-height: 100%;
  overflow: auto;
  padding: 22px 18px 24px;
}

.reference-rail {
  display: grid;
  align-content: start;
  gap: 20px;
}

.ref-month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ref-month-row h3 {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
  color: #032a62;
  font-weight: 800;
  letter-spacing: 0;
}

.ref-nav {
  color: #bfd1dd;
  font-size: 34px;
  letter-spacing: 0;
  user-select: none;
}

.ref-weekdays,
.ref-days {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

.ref-weekdays span {
  font-size: 12px;
  color: #8290a2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.ref-days span {
  font-size: 22px;
  color: #052b63;
  font-weight: 700;
  line-height: 1.1;
  min-height: 44px;
  display: grid;
  place-items: center;
}

.ref-days span.active {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 999px;
  background: #006f77;
  color: #fff;
}

.ref-timeline {
  display: grid;
  gap: 16px;
}

.time-dot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #022a60;
}

.time-dot-row b {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.dot.teal {
  background: #006f77;
}

.dot.light {
  background: #b8dde3;
}

.ref-meeting-card {
  background: #ffffff;
  border: 1px solid #d7e5ec;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  min-height: 96px;
  padding: 12px 12px 12px 14px;
  display: grid;
  grid-template-columns: 4px 1fr auto;
  column-gap: 10px;
  align-items: start;
}

.meeting-accent {
  width: 4px;
  border-radius: 999px;
  background: #006f77;
  min-height: 72px;
}

.ref-meeting-main h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  color: #032a62;
}

.ref-meeting-main p {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.4;
  color: #4b647f;
}

.kebab {
  color: #c8d5de;
  font-size: 20px;
  line-height: 1;
}

.ref-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 8px;
}

.ref-head h3 {
  margin: 0;
  font-size: 26px;
  color: #032a62;
}

.ref-head button {
  background: transparent;
  border: 0;
  color: #007b86;
  font-size: 14px;
  font-weight: 700;
}

.ref-upcoming-card {
  margin-top: 12px;
  background: #eef4ff;
  border: 1px solid #d9e4f2;
  border-radius: 20px;
  padding: 18px 16px;
}

.upcoming-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upcoming-title-row h4 {
  margin: 0;
  color: #032a62;
  font-size: 18px;
}

.upcoming-title-row span {
  color: #032a62;
  font-size: 18px;
}

.ref-upcoming-card p {
  margin: 8px 0 0;
  color: #032a62;
  font-size: 14px;
  line-height: 1.5;
}

.upcoming-meta {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  color: #6b7a90;
  font-size: 12px;
}

.ref-board-card {
  margin-top: 14px;
  background: #ffffff;
  border: 1px solid #bfd3dd;
  border-radius: 18px;
  padding: 16px;
}

.board-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.board-title-row h4 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #032a62;
  font-size: 18px;
}

.board-title-row > span {
  color: #8aa2b1;
  font-size: 16px;
}

.board-time {
  margin-top: 12px;
  color: #032a62;
  font-size: 14px;
  font-weight: 600;
}

.ref-board-card p {
  margin: 12px 0 0;
  color: #113e74;
  font-size: 14px;
  font-style: italic;
  line-height: 1.45;
}

.board-actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.board-actions .ghost,
.board-actions .primary {
  min-height: 38px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.page-head {
  display: grid;
  gap: 4px;
  margin: 0 0 0;
  max-width: 760px;
}

.page-head h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  text-wrap: balance;
}

.page-head .muted {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: #5f6f86;
  max-width: 64ch;
  letter-spacing: 0;
}

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

.stat,
.panel {
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  box-shadow: var(--shadow-sm);
}

.stat,
.stat-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
  min-height: 176px;
}

.stat-card {
  border-radius: 8px;
  padding: 20px 20px 18px;
  display: grid;
  align-content: space-between;
  gap: 18px;
}

.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #16a9c1;
}

.stat .muted,
.stat small,
.stat-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #4b5565;
  font-weight: 700;
  margin: 0;
}

.stat b,
.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.05;
}

.stat-card p,
.stat .stat-sub {
  margin-top: 6px;
  font-size: 13px;
  color: #667085;
  line-height: 1.35;
  font-weight: 500;
}

.stat-row,
.stat .stat-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ring,
.stat .progress {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: conic-gradient(var(--teal) calc(var(--pct) * 1%), #e9eef5 0);
  display: grid;
  place-items: center;
  position: relative;
  font-size: 13px;
  font-weight: 700;
  color: #113b7e;
}

.ring::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: #fff;
}

.ring span {
  position: relative;
  z-index: 1;
  font-size: 11px;
}

.stat-action,
.stat .stat-action {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--teal);
  background: #fff;
  color: var(--teal);
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
}

.stat-action.primary {
  color: #fff;
  background: var(--teal);
}

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

.stage-card {
  overflow: hidden;
  min-height: 164px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  display: grid;
  grid-template-rows: 96px 1fr;
  padding: 0;
  text-align: center;
}

.stage-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.stage-icon {
  display: grid;
  place-items: center;
  background: #043542;
  color: rgba(255, 255, 255, 0.48);
  font-size: 36px;
  line-height: 1;
}

.stage-body {
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 14px;
}

.stage-body strong {
  font-size: 17px;
  color: #143979;
}

.stage-body span {
  font-size: 10px;
  color: #68758a;
  text-transform: uppercase;
}

.recent-panel {
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(18, 36, 63, 0.08);
}

.recent-head {
  min-height: 68px;
  padding: 0 20px;
}

.recent-head h3 {
  font-size: 21px;
  color: var(--ink);
}

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

.link-btn {
  background: transparent;
  color: #263b5d;
  min-height: 30px;
  padding: 0 0;
  font-size: 13px;
}

.recent-table {
  min-width: 760px;
}

.recent-table th {
  background: #f7f9fc;
}

.recent-table td {
  height: 56px;
  color: #142852;
}

.stage-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 16px;
  border-radius: 4px;
  padding: 0 7px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.stage-badge.outline {
  border: 1px solid var(--teal);
  color: #1b8f96;
  background: #fff;
}

.stage-badge.solid,
.stage-badge.green {
  color: #fff;
  background: var(--teal);
}

.stage-badge.blue {
  color: #0d4f71;
  background: #c7eefa;
}

.add-lead-row {
  width: 100%;
  min-height: 48px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: #1a9fa4;
  font-weight: 600;
}

.marketing-ops,
.hr-ops {
  display: grid;
  gap: 20px;
}

.ops-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ops-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 21px;
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: 0;
}

.ops-head span {
  display: block;
  margin-top: 6px;
  color: #1d3557;
  font-size: 12px;
}

.live-badge {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--white);
  color: var(--ink) !important;
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 11px !important;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.live-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--teal);
}

.marketing-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.mini-stat {
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  padding: 20px 16px 20px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: 124px;
}

.mini-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--teal);
}

.mini-stat:nth-child(2)::before {
  background: var(--gold);
}

.mini-stat:nth-child(3)::before {
  background: #38bdf8;
}

.mini-stat::after {
  content: "▤";
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #e8f5f5;
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
}

.mini-stat:nth-child(2)::after {
  content: "◎";
  background: #fff3e2;
  color: #f59e0b;
}

.mini-stat:nth-child(3)::after {
  content: "☑";
  background: #eef9fd;
  color: #38bdf8;
}

.mini-stat span,
.mini-stat small {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.mini-stat b {
  display: block;
  margin: 12px 0 10px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
}

.mini-stat small {
  color: #5b6b83;
  line-height: 1.35;
}

.ops-forms,
.ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.ops-grid {
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
}

.ops-log-form .form-area {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 16px;
}

.ops-log-form .primary {
  width: 100%;
  margin-top: 10px;
}

.ops-app-form .primary {
  grid-column: 2;
  justify-self: end;
  min-width: 150px;
  margin-top: 10px;
}

.nested-panel {
  min-width: 0;
  min-height: 0;
}

.candidate-workspace {
  overflow: visible;
}

.candidate-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}

.candidate-work-card {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  display: grid;
  gap: 14px;
  padding: 16px;
  min-width: 0;
}

.candidate-work-head,
.panel-subhead,
.resume-section > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.candidate-work-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.candidate-work-head span,
.resume-section small,
.candidate-note small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.resume-section,
.notes-section {
  display: grid;
  gap: 10px;
}

.resume-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.resume-download {
  justify-self: start;
  text-decoration: none;
}

.resume-upload-row,
.candidate-note-form {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.candidate-note-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.candidate-note-form textarea,
.candidate-note textarea {
  min-height: 74px;
}

.candidate-notes {
  display: grid;
  gap: 10px;
}

.candidate-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.candidate-note p {
  margin: 0;
  color: var(--sub);
  line-height: 1.45;
}

.note-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.nested-panel:has(.table-wrap),
.nested-panel:has(.form-area) {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(560px, calc(100dvh - 210px));
}

.nested-panel .table-wrap,
.nested-panel .form-area {
  min-height: 0;
  max-height: min(420px, calc(100dvh - 290px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.breakdown-list {
  display: grid;
  gap: 0;
}

.breakdown-list div {
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.breakdown-list div:last-child {
  border-bottom: 0;
}

.breakdown-list span {
  color: var(--sub);
  font-size: 13px;
}

.breakdown-list b {
  color: var(--teal);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.toolbar select,
.toolbar input {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
}

.span-2 {
  grid-column: span 2;
}

.onboarding-table {
  min-width: 1120px;
}

.salary-table {
  min-width: 1180px;
}

.salary-form-panel,
.salary-form-panel .form-area {
  overflow: visible;
}

.salary-preview {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f7f9fc;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px;
  color: var(--ink);
  font-weight: 800;
}

.salary-preview span {
  white-space: nowrap;
}

.salary-save-status {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  display: flex;
  align-items: center;
  padding: 10px;
  font-weight: 700;
}

.salary-saved-panel {
  border-color: rgba(30, 164, 166, 0.35);
  background: #effdfb;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.salary-saved-panel b {
  color: #087f83;
}

.salary-saved-panel span {
  color: var(--ink);
  font-weight: 700;
}

tr.saved-row td {
  background: #ecfeff;
  box-shadow: inset 3px 0 0 var(--teal);
}

.inline-email-form {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(120px, 0.65fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 420px;
}

.inline-email-form input {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sort-header {
  width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.sort-header:hover,
.sort-header.active {
  color: var(--navy);
}

.stage-select {
  width: min(210px, 100%);
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 750;
}

.panel select,
.panel input:not([type="checkbox"]):not([type="radio"]),
.panel textarea,
.table-wrap select,
.table-wrap input:not([type="checkbox"]):not([type="radio"]),
.data-table-toolbar input,
#deptFilter {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  min-height: 40px;
  padding: 9px 12px;
  font-size: 12px;
  box-shadow: none;
}

.panel select:focus,
.panel input:not([type="checkbox"]):not([type="radio"]):focus,
.panel textarea:focus,
.table-wrap select:focus,
.table-wrap input:not([type="checkbox"]):not([type="radio"]):focus,
.data-table-toolbar input:focus,
#deptFilter:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, 0.12);
}

.panel-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-strong);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: var(--white);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0;
}

.panel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 20px;
  margin-left: 6px;
  border-radius: 999px;
  background: #e7f8f8;
  color: #0f7f82;
  font-size: 11px;
  font-weight: 800;
}

.employee-form-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: max(360px, calc(100dvh - 190px));
}

.employee-form-panel .form-area {
  overflow: auto;
  max-height: max(300px, calc(100dvh - 250px));
  -webkit-overflow-scrolling: touch;
}

.employee-panel-head {
  align-items: flex-start;
}

.department-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-chip {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--white);
  color: var(--sub);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: var(--teal);
  background: #e6fbfb;
  color: #117f83;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-strong);
  background: #fbfdff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pagination-bar > div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pagination-bar button {
  min-height: 30px;
  padding: 0 10px;
}

.pagination-bar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.target-progress {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--sub);
  font-size: 12px;
}

.target-row b {
  color: var(--ink);
}

.target-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e7eef8;
  overflow: hidden;
}

.target-track span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #16a34a);
}

.lead-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
}

.lead-card {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  padding: 16px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.lead-card h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.lead-card p {
  margin: 6px 0 4px;
  color: var(--sub);
  font-size: 13px;
}

.sales-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.4fr);
  gap: 16px;
  align-items: start;
}

.sales-list-panel {
  overflow: hidden;
}

.sales-lead-card {
  padding: 0;
}

.sales-lead-card button {
  width: 100%;
  min-height: 118px;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  text-align: left;
  padding: 16px;
  cursor: pointer;
}

.sales-lead-card.active {
  border-color: #168b8d;
  box-shadow: 0 0 0 3px rgba(30, 164, 166, 0.16);
}

.sales-lead-card.is-unreachable {
  border-color: #f2b8b5;
  background: #fff8f7;
}

.sales-lead-card small {
  display: block;
  margin-top: 8px;
  color: var(--sub);
  font-size: 12px;
  text-align: right;
}

.sales-detail-panel {
  min-width: 0;
}

.sales-info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.sales-info-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.sales-info-grid span,
.sales-info-grid b {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sales-call-form,
.sales-enroll-form .form-area {
  border-bottom: 1px solid var(--line);
}

.compact-head {
  padding-top: 14px;
  padding-bottom: 10px;
}

.compact-head h4 {
  margin: 0;
  color: var(--ink);
}

.alert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.notification-wrap {
  position: relative;
  flex: 0 0 auto;
}

.notification-bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
}

.notification-bell svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-bell b {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0 5px;
  font-size: 10px;
  line-height: 1;
  border: 2px solid var(--white);
}

.notification-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(360px, calc(100vw - 32px));
  max-height: min(440px, calc(100vh - 96px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-md);
  z-index: 30;
  overflow: hidden;
}

.notification-head {
  min-height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-list {
  max-height: 360px;
  overflow: auto;
}

.notification-item {
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  color: var(--sub);
  display: grid;
  gap: 4px;
  padding: 12px;
  text-align: left;
}

.notification-item.unread {
  box-shadow: inset 3px 0 0 var(--teal);
  background: #f0fdfd;
}

.notification-item b {
  color: var(--ink);
  font-size: 13px;
}

.notification-item span,
.notification-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.compact-empty {
  padding: 18px;
}

.assign-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.assign-row select,
.target-input {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
}

.target-input {
  width: 110px;
}

.form-area {
  padding: 20px 22px;
}

.panel > .form-area {
  min-height: 0;
  overflow: auto;
  max-height: min(680px, calc(100dvh - 180px));
  -webkit-overflow-scrolling: touch;
}

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

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

.wide {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 840px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
}

.employees-table {
  min-width: 1280px;
}

.scroll-panel,
.employees-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: max(360px, calc(100dvh - 190px));
}

.scroll-panel .table-wrap,
.employees-panel .table-wrap {
  min-height: 340px;
  max-height: max(320px, calc(100dvh - 250px));
  overflow: auto;
}

.scroll-panel th,
.employees-panel th {
  top: 0;
  z-index: 2;
}

.message-list {
  display: grid;
  align-content: start;
}

.message-row {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.message-row p {
  margin: 8px 0;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7fb;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
  box-shadow: inset 0 -1px 0 var(--line-strong);
}

td {
  font-size: 13px;
  font-weight: 550;
  color: var(--sub);
}

tbody tr:hover td {
  background: #f6fafc;
}

tbody tr:nth-child(even) td {
  background: rgba(248, 251, 255, 0.6);
}

tbody tr:nth-child(even):hover td {
  background: #f0f7fb;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e6f7f7;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.cell-with-avatar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.dept-name {
  font-weight: 600;
  color: var(--ink);
}

.dept-purpose {
  color: var(--muted);
  font-size: 12px;
}

.user-status,
.chat-msg {
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 12px;
  background: var(--white);
  color: var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--navy-light);
  color: var(--navy);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.pill.teal {
  background: #e6f7f7;
  color: var(--teal);
}

.pill.green {
  background: #ecfdf3;
  color: #027a48;
}

.pill.red {
  background: #fef3f2;
  color: #d92d20;
}

.pill.yellow {
  background: #fffaeb;
  color: #b54708;
}

.empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 24px rgba(16, 24, 40, 0.24);
  z-index: 20;
  animation: toast-slide-up 0.22s ease-out;
}

@keyframes toast-slide-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100dvh;
  }

  .sidebar {
    position: relative;
    z-index: 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: #050505;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand nav logout";
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    overflow: visible;
  }

  .sidebar .brand {
    grid-area: brand;
    margin: 0;
    white-space: nowrap;
  }

  .sidebar .brand h1 {
    font-size: 18px;
  }

  .sidebar-profile,
  .sidebar-card {
    display: none;
  }

  .nav {
    grid-area: nav;
    display: flex;
    gap: 4px;
    margin: 0;
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .nav button {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 13px;
  }

  .nav button.active::before {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 2px;
    width: auto;
    height: 3px;
    border-radius: 999px;
  }

  #logoutBtn {
    grid-area: logout;
    margin: 0;
    min-height: 36px;
    padding: 0 10px;
  }

  .dashboard-layout,
  .stats,
  .stage-grid,
  .sales-grid,
  .sales-info-grid,
  .alert-grid,
  .lead-card-grid,
  .marketing-summary,
  .ops-forms,
  .ops-grid,
  .candidate-work-grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .stage-card {
    grid-template-rows: 78px 1fr;
    min-height: 132px;
  }

  .dashboard-layout {
    gap: 14px;
  }

  .ops-head {
    display: grid;
  }

  .live-badge {
    justify-self: start;
  }

  .ops-app-form .primary {
    grid-column: 1;
    width: 100%;
  }

  .resume-upload-row,
  .candidate-note-form {
    grid-template-columns: 1fr;
  }

  .dashboard-rail {
    position: static;
    min-height: auto;
    border-left: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 16px;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
  }

  .topbar-right {
    margin-left: 0;
    justify-content: flex-start;
    overflow: visible;
  }

  .search-wrap {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 1180px) {
  .content {
    padding: 22px;
    gap: 22px;
  }

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

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

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

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

@media (max-width: 720px) {
  html,
  body,
  #app {
    height: 100%;
  }

  body {
    overflow: hidden;
  }

  .app {
    height: 100dvh;
  }

  .sidebar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand logout"
      "nav nav";
  }

  .sidebar .brand p,
  .nav button span,
  .icon-btn {
    display: none;
  }

  .nav button {
    min-height: 34px;
    font-size: 12px;
  }

  .topbar-right > * {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .topbar-right .mode-pill {
    flex: 1 1 100%;
    justify-content: center;
  }

  .topbar-right .primary,
  .topbar-right .ghost,
  .topbar #deptFilter {
    width: 100%;
  }

  .content {
    padding: 16px;
    gap: 18px;
  }

  .page-head h2 {
    font-size: 28px;
    display: block;
  }

  .page-head .muted {
    font-size: 13px;
  }

  .stats,
  .stage-grid,
  .marketing-summary,
  .ops-forms,
  .ops-grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }

  .inline-email-form {
    grid-template-columns: 1fr;
    min-width: 220px;
  }

  .stat-card,
  .mini-stat {
    min-height: auto;
  }

  .stat-row {
    gap: 14px;
  }

  .stage-card {
    min-height: 112px;
    grid-template-rows: 64px 1fr;
  }

  .stage-icon {
    font-size: 28px;
  }

.panel-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }

  .recent-head {
    min-height: auto;
  }

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

  .form-area {
    padding: 14px;
  }

  .employee-panel-head {
    align-items: flex-start;
  }

  .department-filter {
    justify-content: flex-start;
  }

  .create-employee-btn {
    min-height: 44px;
  }

  table {
    min-width: 760px;
  }

  .employees-table {
    min-width: 1280px;
  }

  .scroll-panel,
  .employees-panel {
    max-height: max(320px, calc(100dvh - 230px));
  }

  .employee-form-panel {
    max-height: max(320px, calc(100dvh - 230px));
  }

  .employee-form-panel .form-area {
    max-height: max(280px, calc(100dvh - 300px));
  }

  .scroll-panel .table-wrap,
  .employees-panel .table-wrap {
    min-height: 300px;
    max-height: max(280px, calc(100dvh - 300px));
  }

  th,
  td {
    padding: 11px 12px;
    font-size: 12px;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
}

.data-table {
  min-width: 0;
}

.data-table-toolbar {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.data-table-toolbar input {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 0 12px;
  min-width: min(260px, 100%);
}

.alert-banner {
  border: 1px solid var(--line-strong);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--white);
  color: var(--sub);
  font-size: 13px;
  font-weight: 750;
}

.alert-banner.teal {
  border-left-color: var(--teal);
  background: #f0fdfd;
}

.alert-banner.yellow {
  border-left-color: var(--gold);
  background: #fffaeb;
}

.alert-banner.red {
  border-left-color: #d92d20;
  background: #fef3f2;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.46);
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-panel {
  width: min(560px, 100%);
  max-height: min(680px, calc(100vh - 48px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  overflow: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.duplicate-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.duplicate-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.duplicate-list span,
.duplicate-list small {
  color: var(--muted);
  font-size: 12px;
}

.timeline-feed {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border-left: 3px solid var(--teal);
  background: var(--soft);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.drawer-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(520px, 100vw);
  z-index: 35;
  background: var(--white);
  border-left: 1px solid var(--line-strong);
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.16);
  overflow: auto;
}

@media (max-width: 420px) {
  .sidebar {
    padding: 8px 10px;
  }

  .sidebar .brand h1 {
    font-size: 16px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .topbar-right > * {
    flex-basis: 100%;
  }

  .content {
    padding: 12px;
  }

  .stat-card {
    padding: 16px;
  }

  .ring {
    width: 44px;
    height: 44px;
  }

  .scroll-panel,
  .employees-panel {
    max-height: max(280px, calc(100dvh - 260px));
  }

  .employee-form-panel {
    max-height: max(280px, calc(100dvh - 260px));
  }

  .employee-form-panel .form-area {
    max-height: max(240px, calc(100dvh - 330px));
  }

  .scroll-panel .table-wrap,
  .employees-panel .table-wrap {
    min-height: 260px;
    max-height: max(240px, calc(100dvh - 330px));
  }
}
