:root {
  --bg: #f5f8f8;
  --card: #ffffff;
  --panel: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --primary: #2cc4f6;
  --primary-dark: #0aa7dc;
  --primary-soft: rgba(44, 196, 246, 0.12);
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --success-line: #9ae6b4;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 16px;
  min-height: 100vh;
}

.shell {
  width: 100%;
  min-height: calc(100vh - 32px);
}

.card {
  width: 100%;
  min-height: 100%;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  overflow: hidden;
}

.hero,
.manager-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.hero {
  justify-content: flex-start;
}

.hero-title {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.hero-icon,
.button-icon,
.icon-button,
.edit-icon,
.tree-icon,
.file-icon,
.table-action,
.message-icon,
.message-link-icon,
.message-close {
  font-family: "Material Symbols Outlined", sans-serif;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.hero-icon {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 28px;
  flex-shrink: 0;
}

.manager-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 20px;
  line-height: 1.25;
}

.subtle {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.button {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  color: white;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

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

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

.button-large {
  width: 100%;
  min-height: 58px;
  font-size: 16px;
  box-shadow: 0 12px 24px rgba(44, 196, 246, 0.25);
}

.button:disabled,
.icon-button:disabled,
.inline-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.details {
  padding: 24px;
  background: var(--panel);
  margin: 24px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
}

.row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: center;
}

.row + .row {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.row-label {
  color: var(--muted);
  font-size: 14px;
}

.row-label.top {
  align-self: start;
  padding-top: 2px;
}

.row-value {
  font-size: 14px;
  font-weight: 600;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-button {
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
}

.inline-input,
.search-input,
.select-input {
  width: 100%;
  border: 1px solid var(--line);
  background: white;
  padding: 12px 14px;
  border-radius: 12px;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.inline-input {
  background: transparent;
  border: none;
  padding: 0;
  font-weight: 600;
}

.edit-icon,
.icon-button,
.table-action,
.message-close {
  color: #94a3b8;
  font-size: 18px;
}

.icon-button {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px;
}

.icon-button-round {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.icon-button-round:hover,
.icon-button:hover,
.table-action:hover,
.breadcrumb:hover {
  background: #f1f5f9;
  color: var(--primary-dark);
}

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

.tree-node {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: 14px;
}

.tree-node-child {
  padding-left: 18px;
}

.tree-node-leaf {
  padding-left: 36px;
  color: var(--primary-dark);
  font-weight: 700;
}

.tree-icon {
  font-size: 20px;
}

.tree-arrow {
  color: #cbd5e1;
}

.card-footer,
.manager-footer {
  padding: 0 24px 24px;
  display: flex;
  justify-content: center;
}

.manager-footer {
  justify-content: flex-start;
}

.table-panel {
  padding: 24px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.muted-badge {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.breadcrumb {
  border: none;
  background: white;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  border: 1px solid var(--line);
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 700;
  cursor: default;
}

.table-wrap {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  overflow: hidden;
  background: white;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
}

.file-table thead {
  background: var(--panel);
}

.file-table th,
.file-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

.file-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.file-table tr:last-child td {
  border-bottom: none;
}

.file-row:hover {
  background: var(--panel);
}

.file-open-button {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}

.file-open-button:hover {
  color: var(--primary-dark);
}

.file-icon {
  font-size: 20px;
  color: var(--primary);
}

.file-icon.file-pdf {
  color: #ef4444;
}

.file-icon.file-cad {
  color: #3b82f6;
}

.file-icon.file-zip {
  color: #f59e0b;
}

.table-action {
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
}

.align-right {
  text-align: right;
}

.message {
  margin-bottom: 16px;
  border-radius: 18px;
  border: 1px solid var(--success-line);
  background: var(--success-soft);
  color: #166534;
  box-shadow: 0 10px 24px rgba(22, 101, 52, 0.08);
}

.message-error {
  border-color: var(--danger-line);
  background: var(--danger-soft);
  color: #991b1b;
  box-shadow: 0 10px 24px rgba(153, 27, 27, 0.08);
}

.message-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  padding: 22px 24px;
}

.message-icon {
  font-size: 36px;
  color: var(--success);
}

.message-error .message-icon {
  color: var(--danger);
}

.message-copy {
  display: grid;
  gap: 14px;
}

.message-text {
  font-size: 17px;
  line-height: 1.45;
  font-weight: 600;
}

.message-link {
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.message-link-icon {
  font-family: "Material Symbols Outlined", sans-serif;
  font-size: 24px;
}

.message-close {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: inherit;
  font-size: 28px;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
}

.modal-card {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  background: white;
  border-radius: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
  z-index: 1;
}

.modal-card-narrow {
  width: min(420px, calc(100vw - 32px));
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.company-results {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.company-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  text-align: left;
  cursor: pointer;
}

.company-item:hover {
  border-color: var(--primary);
  background: #f0fbff;
}

.action-list {
  display: grid;
  gap: 8px;
}

.action-button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-button:hover {
  background: var(--panel);
  border-color: #cbd5e1;
}

.action-icon,
.button-loader {
  font-family: "Material Symbols Outlined", sans-serif;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.action-button-danger {
  color: var(--danger);
}

.button-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 999px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

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

.install-log {
  border-radius: 14px;
  border: 1px dashed var(--line);
  padding: 16px;
  background: rgba(255, 255, 255, 0.55);
}

@media (max-width: 900px) {
  .table-header,
  .manager-header,
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .message-content {
    grid-template-columns: 1fr;
  }

  .message-close {
    justify-self: end;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 12px;
  }

  .shell {
    min-height: calc(100vh - 24px);
  }

  .row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .details,
  .table-panel,
  .hero,
  .manager-header,
  .card-footer,
  .manager-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .details {
    margin: 16px;
  }

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