:root {
  --bg: #f2f5f7;
  --panel: #ffffff;
  --panel-soft: #f8fafb;
  --ink: #17202a;
  --muted: #647284;
  --line: #dce3ea;
  --nav: #102436;
  --nav-soft: #18354e;
  --blue: #1267b1;
  --teal: #168b87;
  --amber: #c47b13;
  --red: #b94040;
  --green: #287a46;
  --shadow: 0 18px 45px rgba(22, 35, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-view {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  align-items: center;
  gap: 40px;
  padding: clamp(20px, 6vw, 82px);
  overflow: hidden;
}

.login-media,
.login-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-media {
  background:
    linear-gradient(115deg, rgba(6, 23, 36, 0.9), rgba(8, 58, 78, 0.38)),
    url("../web/assets/telecenter-logo.jpg") center / cover;
  filter: saturate(1.05);
}

.login-video {
  opacity: 0.36;
  mix-blend-mode: screen;
}

.login-view::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(5, 20, 32, 0.58), rgba(5, 20, 32, 0.18) 48%, rgba(5, 20, 32, 0.78));
  pointer-events: none;
}

.login-copy {
  position: relative;
  z-index: 2;
  align-self: end;
  max-width: 700px;
  color: #fff;
  padding-bottom: 20px;
}

.login-copy p {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.login-copy h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1;
}

.login-card {
  position: relative;
  z-index: 2;
  grid-column: 2;
  display: grid;
  gap: 18px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 28px 76px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.login-card img {
  width: 168px;
  border-radius: 8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.login-card h1,
.topbar h1,
.modal-card h2 {
  margin-bottom: 0;
}

.login-card h1 {
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 138px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(18, 103, 177, 0.14);
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 850;
}

.primary-button {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 22px rgba(18, 103, 177, 0.22);
}

.primary-button:hover {
  background: #0d5798;
}

.secondary-button {
  background: #fff;
  color: #18354e;
  border-color: var(--line);
}

.ghost-button {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.icon-button {
  width: 42px;
  padding: 0;
  background: var(--panel-soft);
  color: var(--ink);
  border-color: var(--line);
}

.app-shell {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px;
  background: var(--nav);
  color: #fff;
}

.brand {
  display: grid;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.brand img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.brand strong,
.brand span,
.session-card strong,
.session-card span {
  display: block;
}

.brand span,
.session-card span {
  margin-top: 3px;
  color: #c2d3df;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: #d7e5ed;
  text-align: left;
  font-weight: 820;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  border-color: rgba(22, 139, 135, 0.78);
  background: var(--nav-soft);
}

.session-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #173149;
}

.workspace {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 42px);
}

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

.notice-button span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 24px;
  margin-left: 7px;
  border-radius: 999px;
  background: #e8f5f4;
  color: var(--teal);
  font-size: 12px;
}

.view {
  display: grid;
  gap: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.record-card,
.advisor-card,
.schema-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 830;
}

.metric-card strong {
  display: block;
  margin-top: 9px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.section-title h2 {
  margin-bottom: 0;
}

.toolbar,
.upload-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.upload-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.edit-grid,
.advisor-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 940px;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7fa;
  color: #425160;
  font-size: 12px;
  text-transform: uppercase;
}

tr:hover td {
  background: #fbfdff;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef4fa;
  color: #19364e;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.pill.ok {
  background: #eaf7ef;
  color: var(--green);
}

.pill.warn {
  background: #fff4df;
  color: var(--amber);
}

.pill.bad {
  background: #faeeee;
  color: var(--red);
}

.pill.info {
  background: #eaf4fd;
  color: var(--blue);
}

.record-list,
.advisor-grid,
.timeline {
  display: grid;
  gap: 10px;
}

.advisor-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.record-card,
.advisor-card,
.schema-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  box-shadow: none;
}

.record-card header,
.advisor-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.record-card p,
.advisor-card p,
.timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.mini-stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.mini-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}

.mini-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #425160;
  font-size: 13px;
  font-weight: 820;
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  background: #e7eef5;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.notice-tray {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.notice-card,
.toast {
  padding: 12px 14px;
  border: 1px solid #bcdedc;
  border-radius: 8px;
  background: #effaf9;
  color: #143d3b;
  box-shadow: 0 12px 26px rgba(22, 139, 135, 0.12);
}

.notice-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.notice-card p,
.toast p {
  margin: 0;
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  animation: rise 0.25s ease-out;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.modal::backdrop {
  background: rgba(6, 19, 30, 0.54);
}

.modal-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: #fff;
}

.modal-header,
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

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

.lead-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.modal-body.manager-edit {
  grid-template-columns: 1fr;
}

.modal-body.manager-edit .lead-summary {
  grid-column: auto;
}

.modal-body.manager-edit textarea {
  min-height: 96px;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .brand {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
  }

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

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

@media (max-width: 720px) {
  .login-view {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .login-card {
    grid-column: 1;
  }

  .login-copy {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar,
  .section-title,
  .modal-header,
  .modal-actions,
  .notice-card {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions,
  .button-row {
    display: grid;
  }

  .nav-list,
  .metric-grid,
  .content-grid,
  .toolbar,
  .upload-grid,
  .edit-grid,
  .advisor-form,
  .advisor-grid,
  .mini-grid,
  .modal-body {
    grid-template-columns: 1fr;
  }
}
