.scx-files-root {
  --scx-navy: #013369;
  --scx-navy-deep: #01244a;
  --scx-orange: #ffa500;
  --scx-orange-soft: #fff1d6;
  --scx-slate: #5c6b80;
  --scx-border: #d9e1ea;
  --scx-bg: #f4f8fc;
  --scx-white: #ffffff;
  --scx-green: #1f9d57;
  --scx-red: #d64545;
  --scx-yellow: #c58a00;
  color: #142235;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.scx-files-root *,
.scx-files-root *::before,
.scx-files-root *::after {
  box-sizing: border-box;
}

.scx-panel,
.scx-section,
.scx-company-group {
  background: var(--scx-white);
  border: 1px solid var(--scx-border);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(1, 51, 105, 0.08);
}

.scx-panel {
  padding: 24px;
  margin-bottom: 20px;
  background:
    radial-gradient(circle at top right, rgba(255, 165, 0, 0.18), transparent 30%),
    linear-gradient(145deg, #ffffff 0%, #f6faff 100%);
}

.scx-panel-emergency {
  background:
    linear-gradient(180deg, rgba(1, 51, 105, 0.98), rgba(5, 66, 126, 0.96)),
    linear-gradient(145deg, #ffffff 0%, #f6faff 100%);
  color: #fff;
}

.scx-section,
.scx-company-group {
  padding: 22px;
  margin-bottom: 18px;
}

.scx-panel-head,
.scx-section-head,
.scx-company-group-head,
.scx-toolbar,
.scx-stat-row,
.scx-actions-row,
.scx-sharing-row,
.scx-shared-row,
.scx-shared-row-main,
.scx-program-card-top,
.scx-project-sds-top,
.scx-compliance-widget,
.scx-preview-meta,
.scx-modal-actions,
.scx-panel-actions {
  display: flex;
  align-items: center;
}

.scx-panel-head,
.scx-section-head,
.scx-company-group-head,
.scx-toolbar,
.scx-stat-row,
.scx-panel-actions {
  justify-content: space-between;
  gap: 12px;
}

.scx-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--scx-orange);
}

.scx-panel h2,
.scx-section h3,
.scx-company-group h3,
.scx-modal-head h3 {
  margin: 0;
  color: var(--scx-navy);
  line-height: 1.1;
}

.scx-panel h2,
.scx-modal-head h3 {
  font-size: 30px;
  font-weight: 800;
}

.scx-panel-emergency h2,
.scx-panel-emergency h3,
.scx-panel-emergency p,
.scx-panel-emergency span {
  color: #fff;
}

.scx-section-head h3,
.scx-company-group-head h3 {
  font-size: 20px;
  font-weight: 800;
}

.scx-section-head span,
.scx-company-group-head span,
.scx-meta-row,
.scx-muted-note,
.scx-storage-note,
.scx-modal-head p,
.scx-empty-inline,
.scx-sharing-row span,
.scx-shared-row span,
.scx-program-desc,
.scx-project-sds-card p {
  color: var(--scx-slate);
  font-size: 14px;
}

.scx-stat-row {
  margin-top: 18px;
  flex-wrap: wrap;
}

.scx-stat-card {
  min-width: 150px;
  flex: 1 1 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(1, 51, 105, 0.04);
  border: 1px solid rgba(1, 51, 105, 0.08);
}

.scx-stat-card strong {
  display: block;
  font-size: 28px;
  color: var(--scx-navy);
}

.scx-stat-card span {
  font-size: 13px;
  color: var(--scx-slate);
}

.scx-program-grid,
.scx-project-card-grid {
  display: grid;
  gap: 16px;
}

.scx-program-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.scx-project-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.scx-program-card {
  background: var(--scx-white);
  border: 1px solid var(--scx-border);
  border-left: 8px solid var(--scx-category-color, var(--scx-navy));
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(1, 51, 105, 0.06);
}

.scx-program-card h4,
.scx-project-sds-card h4 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--scx-navy);
}

.scx-file-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  background: var(--scx-orange-soft);
  font-size: 24px;
}

.scx-file-icon-sm {
  width: 36px;
  height: 36px;
  margin: 0;
  font-size: 18px;
  flex-shrink: 0;
}

.scx-chip-row,
.scx-actions-row,
.scx-sharing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.scx-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(1, 51, 105, 0.08);
  color: var(--scx-navy);
  font-size: 13px;
  font-weight: 700;
}

.scx-chip-muted {
  background: #eef3f9;
  color: var(--scx-slate);
}

.scx-chip-tight {
  margin: 2px 4px 2px 0;
  padding: 4px 10px;
  min-height: 0;
}

.scx-sharing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.scx-badge-shared {
  background: rgba(31, 157, 87, 0.12);
  color: var(--scx-green);
}

.scx-badge-private {
  background: #ecf0f5;
  color: #66768c;
}

.scx-program-desc {
  margin: 14px 0;
  min-height: 44px;
}

.scx-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.scx-sharing-panel-inline {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--scx-border);
}

.scx-sharing-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--scx-navy);
}

.scx-sharing-row,
.scx-shared-row {
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
}

.scx-sharing-row:last-child,
.scx-shared-row:last-child {
  border-bottom: 0;
}

.scx-sharing-row strong,
.scx-shared-row strong {
  display: block;
  margin-bottom: 4px;
  color: var(--scx-navy);
}

.scx-share-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 10px;
  margin-top: 14px;
}

.scx-share-form select,
.scx-search input,
.scx-select-wrap select,
.scx-field input,
.scx-field textarea,
.scx-field select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--scx-border);
  font: inherit;
  color: #142235;
  background: #fff;
}

.scx-search input,
.scx-select-wrap select {
  background: #fff;
}

.scx-search {
  flex: 1 1 260px;
}

.scx-search-lg input {
  min-height: 56px;
  font-size: 18px;
}

.scx-select-wrap {
  width: min(260px, 100%);
}

.scx-btn,
.scx-text-btn,
.scx-modal-close,
.scx-dropzone {
  font: inherit;
}

.scx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.scx-btn:hover,
.scx-text-btn:hover,
.scx-modal-close:hover {
  transform: translateY(-1px);
}

.scx-btn-primary {
  background: var(--scx-orange);
  color: #1f1300;
  box-shadow: 0 10px 24px rgba(255, 165, 0, 0.28);
}

.scx-btn-primary:hover {
  background: #f19a00;
}

.scx-btn-outline {
  border-color: rgba(1, 51, 105, 0.18);
  background: #fff;
  color: var(--scx-navy);
}

.scx-btn-muted {
  background: rgba(1, 51, 105, 0.08);
  color: var(--scx-navy);
}

.scx-btn-sm {
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13px;
}

.scx-text-btn {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--scx-red);
  cursor: pointer;
  font-weight: 700;
}

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

.scx-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

.scx-table th,
.scx-table td {
  padding: 16px 14px;
  text-align: left;
  border-bottom: 1px solid #edf2f7;
  vertical-align: top;
}

.scx-table th {
  font-size: 12px;
  font-weight: 800;
  color: var(--scx-slate);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scx-actions-row-tight {
  gap: 8px;
}

.scx-empty-state {
  padding: 28px;
  border: 1px dashed rgba(1, 51, 105, 0.18);
  border-radius: 18px;
  background: #f9fbfe;
  color: var(--scx-slate);
  text-align: center;
}

.scx-empty-state-compact {
  padding: 18px;
}

.scx-compliance-widget {
  gap: 18px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
}

.scx-panel-emergency .scx-compliance-widget {
  background: rgba(255, 255, 255, 0.12);
}

.scx-compliance-ring {
  --scx-progress: 0%;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    conic-gradient(var(--scx-orange) var(--scx-progress), rgba(1, 51, 105, 0.12) 0),
    radial-gradient(circle, transparent 58%, rgba(255,255,255,0.98) 59%);
  flex-shrink: 0;
}

.scx-panel-emergency .scx-compliance-ring {
  background:
    conic-gradient(var(--scx-orange) var(--scx-progress), rgba(255, 255, 255, 0.2) 0),
    radial-gradient(circle, transparent 58%, rgba(1, 51, 105, 0.96) 59%);
}

.scx-compliance-center {
  font-size: 20px;
  font-weight: 800;
  color: var(--scx-navy);
}

.scx-panel-emergency .scx-compliance-center {
  color: #fff;
}

.scx-compliance-copy h4 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--scx-navy);
}

.scx-panel-emergency .scx-compliance-copy h4 {
  color: #fff;
}

.scx-compliance-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 14px;
}

.scx-compliance-danger {
  border: 1px solid rgba(214, 69, 69, 0.2);
}

.scx-compliance-warn {
  border: 1px solid rgba(197, 138, 0, 0.2);
}

.scx-compliance-good {
  border: 1px solid rgba(31, 157, 87, 0.2);
}

.scx-project-groups {
  display: grid;
  gap: 18px;
}

.scx-project-sds-card {
  background: linear-gradient(180deg, #ffffff, #f6faff);
  border: 1px solid rgba(1, 51, 105, 0.12);
  border-radius: 20px;
  padding: 18px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.scx-project-sds-top {
  align-items: flex-start;
  gap: 14px;
}

.scx-project-sds-top .scx-file-icon {
  margin-bottom: 0;
  flex-shrink: 0;
}

.scx-emergency-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 165, 0, 0.18);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.scx-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 24, 48, 0.7);
  backdrop-filter: blur(4px);
}

.scx-modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.scx-modal-card-lg {
  width: min(940px, 100%);
}

.scx-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(1, 51, 105, 0.08);
  color: var(--scx-navy);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.scx-modal-head {
  margin-bottom: 18px;
  padding-right: 42px;
}

.scx-modal-form {
  display: grid;
  gap: 16px;
}

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

.scx-field {
  display: grid;
  gap: 8px;
}

.scx-field span {
  font-size: 13px;
  font-weight: 800;
  color: var(--scx-navy);
  letter-spacing: 0.02em;
}

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

.scx-dropzone {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 28px 20px;
  border: 2px dashed rgba(1, 51, 105, 0.22);
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(255, 165, 0, 0.12), transparent 28%),
    linear-gradient(145deg, #f8fbff, #ffffff);
  text-align: center;
  cursor: pointer;
}

.scx-dropzone.is-dragover {
  border-color: var(--scx-orange);
  background:
    radial-gradient(circle at top left, rgba(255, 165, 0, 0.24), transparent 28%),
    linear-gradient(145deg, #fff8ec, #ffffff);
}

.scx-dropzone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scx-dropzone-copy strong {
  display: block;
  color: var(--scx-navy);
  font-size: 18px;
}

.scx-dropzone-copy span,
.scx-dropzone-meta {
  color: var(--scx-slate);
  font-size: 14px;
}

.scx-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.scx-checkbox-pill {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px 12px 44px;
  border-radius: 14px;
  border: 1px solid var(--scx-border);
  background: #fff;
  cursor: pointer;
}

.scx-checkbox-pill input {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
}

.scx-modal-actions {
  justify-content: flex-end;
  gap: 12px;
}

.scx-preview-shell {
  display: grid;
  gap: 14px;
}

.scx-preview-meta {
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f6f9fc;
  color: var(--scx-slate);
}

.scx-preview-body {
  min-height: 360px;
  border: 1px solid var(--scx-border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.scx-preview-frame,
.scx-preview-image,
.scx-preview-text {
  width: 100%;
  min-height: 360px;
  border: 0;
  display: block;
}

.scx-preview-image {
  object-fit: contain;
  background: #f3f7fb;
}

.scx-preview-text {
  margin: 0;
  padding: 20px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.scx-preview-placeholder {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--scx-slate);
  background:
    radial-gradient(circle at top right, rgba(255, 165, 0, 0.12), transparent 30%),
    linear-gradient(145deg, #f9fbfe, #ffffff);
}

@media (max-width: 900px) {
  .scx-panel-head,
  .scx-toolbar,
  .scx-share-form,
  .scx-modal-actions,
  .scx-stat-row,
  .scx-panel-actions,
  .scx-compliance-widget {
    flex-direction: column;
    align-items: stretch;
  }

  .scx-share-form {
    grid-template-columns: 1fr;
  }

  .scx-form-grid {
    grid-template-columns: 1fr;
  }

  .scx-compliance-ring {
    margin: 0 auto;
  }

  .scx-table {
    min-width: 720px;
  }
}

@media (max-width: 640px) {
  .scx-panel,
  .scx-section,
  .scx-company-group,
  .scx-modal-card {
    padding: 18px;
    border-radius: 18px;
  }

  .scx-panel h2,
  .scx-modal-head h3 {
    font-size: 24px;
  }

  .scx-program-card h4,
  .scx-project-sds-card h4 {
    font-size: 18px;
  }

  .scx-stat-card {
    min-width: 0;
  }

  .scx-shared-row,
  .scx-sharing-row,
  .scx-shared-row-main,
  .scx-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .scx-search input,
  .scx-select-wrap select,
  .scx-btn,
  .scx-field input,
  .scx-field textarea,
  .scx-field select {
    min-height: 48px;
  }

  .scx-project-card-grid {
    grid-template-columns: 1fr;
  }
}
