:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #15212b;
  --muted: #667383;
  --line: #dbe3ea;
  --primary: #176d6b;
  --primary-dark: #105554;
  --blue: #245b8f;
  --green: #2d7c45;
  --amber: #9a6a16;
  --red: #a33a3a;
  --shadow: 0 18px 45px rgba(18, 34, 49, 0.12);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

a {
  color: var(--primary);
}

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
}

.login-panel {
  background: var(--panel);
  padding: 42px;
  display: grid;
  align-content: center;
  gap: 28px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand.compact {
  padding: 20px;
}

.brand-logo-wrap {
  width: 96px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  padding: 8px;
  background: #fff;
}

.brand-logo {
  width: 100%;
  max-height: 28px;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.brand p,
.section-head p,
.app-card p,
.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.login-actions {
  display: grid;
  gap: 16px;
}

.quick-login {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: grid;
  gap: 10px;
}

.quick-login p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quick-login-buttons {
  display: grid;
  gap: 8px;
}

.login-visual {
  display: grid;
  align-items: end;
  padding: 56px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(16, 85, 84, 0.92), rgba(36, 91, 143, 0.86)),
    linear-gradient(45deg, #143b4b, #216d63);
}

.login-visual h2 {
  max-width: 720px;
  margin: 8px 0 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1;
  letter-spacing: 0;
}

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

.login-visual .eyebrow {
  color: rgba(255, 255, 255, 0.74);
}

.button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover:not(:disabled) {
  border-color: #b9c7d4;
}

.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.ghost {
  background: transparent;
}

.button.small {
  min-height: 34px;
  padding: 0 11px;
  font-size: 13px;
}

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

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.microsoft-login {
  min-height: 46px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.nav {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px 12px;
}

.nav-button {
  border: 0;
  background: transparent;
  color: var(--text);
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
}

.nav-button span,
.app-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8f1f0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.nav-button.active,
.nav-button:hover {
  background: #edf4f4;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.user-block {
  display: grid;
  gap: 3px;
}

.user-block span {
  color: var(--muted);
  font-size: 13px;
}

.content {
  min-width: 0;
  padding: 28px;
}

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

.topbar h2 {
  margin: 4px 0 0;
  font-size: 30px;
}

.pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section {
  display: grid;
  gap: 16px;
}

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

.section-head h3 {
  margin: 0;
  font-size: 20px;
}

.app-grid,
.iso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.app-card,
.iso-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.app-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.app-card h3,
.iso-item h4 {
  margin: 0;
}

.app-description {
  min-height: 48px;
  line-height: 1.45;
}

.app-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  background: #eef1f4;
  color: var(--muted);
}

.status.active {
  background: #e6f4ea;
  color: var(--green);
}

.status.planned {
  background: #fff5df;
  color: var(--amber);
}

.status.paused {
  background: #f9e9e9;
  color: var(--red);
}

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

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

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

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td span {
  color: var(--muted);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: 0;
}

.actions {
  text-align: right;
}

.timeline {
  display: grid;
  gap: 8px;
}

.timeline-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.timeline-item > span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 27, 38, 0.48);
  display: grid;
  place-items: center;
  padding: 22px;
  z-index: 10;
}

.modal {
  width: min(820px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
}

.modal header,
.modal footer {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.modal h3 {
  margin: 0;
}

.modal-body {
  padding: 18px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field label,
.access-list h4 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 800;
  margin: 0;
}

.field input,
.field select,
.field textarea,
.access-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

.field textarea {
  resize: vertical;
}

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

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.access-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.access-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 10px;
  align-items: center;
}

.empty {
  background: var(--panel);
  border: 1px dashed #b8c5d1;
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #11242f;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  z-index: 20;
}

.toast.error {
  background: #8c2f2f;
}

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

  .login-visual {
    min-height: 36vh;
    padding: 28px;
  }

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

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand.compact {
    padding-bottom: 10px;
  }

  .nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .sidebar-foot {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .content {
    padding: 18px;
  }

  .topbar,
  .section-head,
  .timeline-item {
    display: grid;
  }

  .form-grid,
  .access-row {
    grid-template-columns: 1fr;
  }

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