/*
 * Shared application styles.
 */

@font-face {
  font-family: "Open Sans";
  src: url("/assets/OpenSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Open Sans";
  src: url("/assets/OpenSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "Helvetica Neue";
  src: url("/assets/HelveticaNeue.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Helvetica Neue";
  src: url("/assets/HelveticaNeue-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}

:root {
  --font-body: "Open Sans", sans-serif;
  --font-heading: "Helvetica Neue", "Open Sans", sans-serif;
  --color-bg: #f0f2f5;
  --color-bg-strong: #e4e8ed;
  --color-surface: #ffffff;
  --color-surface-muted: #f7f9fc;
  --color-surface-strong: #eef1f6;
  --color-border: #d0d8e2;
  --color-border-strong: #bac5d2;
  --color-text: #1a2535;
  --color-text-muted: #5d6b82;
  --color-heading: #0f1e2d;
  --color-primary: #0f4c81;
  --color-primary-strong: #0b3d68;
  --color-primary-soft: #dce9f7;
  --color-success: #1f6b4f;
  --color-success-soft: #def4ea;
  --color-warning: #8a5a18;
  --color-warning-soft: #fdf0d9;
  --color-danger: #a63838;
  --color-danger-soft: #fae2e2;
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 2px 8px rgba(15, 23, 42, 0.08);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: var(--color-heading);
  font-family: var(--font-heading);
}

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

.app-shell-card,
.enterprise-card,
.data-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.eyebrow-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  background: var(--color-surface-strong);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
}

/* Page Banner — enterprise page header */
.page-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.page-banner-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-banner-title {
  font-size: 20px;
  font-family: var(--font-heading);
  color: var(--color-heading);
  font-weight: 700;
}

.page-banner-kpis {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 8px 14px;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-width: 80px;
  text-align: right;
}

.kpi-tile-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.kpi-tile-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-heading);
  font-family: var(--font-heading);
  margin-top: 2px;
  line-height: 1;
}

/* Table */
.table-shell {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

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

.table-shell th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.table-shell td {
  padding: 13px 16px;
  border-bottom: 1px solid #eaeff5;
  color: var(--color-text);
  font-size: 14px;
  vertical-align: middle;
}

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

.table-shell tbody tr:hover td {
  background: #f5f8fb;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-open {
  background: #ddeafd;
  color: #0f4c81;
}

.status-in-progress {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

.status-closed {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.status-repaired {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.severity-normal {
  background: #e2ebf6;
  color: #30506f;
}

.severity-warning {
  background: #fde8c8;
  color: #8a5a18;
}

.severity-serious {
  background: #efd6b8;
  color: #734312;
}

.severity-critical {
  background: #f7d7d7;
  color: #9e2b2b;
}

/* Review status badges */
.review-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.review-badge-started {
  background: #e0f2fe;
  color: #0369a1;
}

.review-badge-for-review {
  background: #fef3c7;
  color: #92400e;
}

.review-badge-changes-requested {
  background: #ffedd5;
  color: #9a3412;
}

.review-badge-reviewed {
  background: #dcfce7;
  color: #166534;
}

/* Review sub-actions row (shown below main header actions) */
.review-sub-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: #f7f9fc;
  border: 1px solid #e1e7ef;
  border-radius: 8px;
}

.review-sub-actions-label {
  color: #5d6b82;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 4px;
}

.review-sub-actions form {
  margin: 0;
  padding: 0;
  display: inline-flex;
}

.admin-review-override {
  margin-top: 32px;
  padding: 20px 24px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #eef2ff;
}

.admin-review-override-title {
  margin: 0 0 8px;
  color: #1a2433;
  font-size: 16px;
  font-weight: 600;
}

.admin-review-override-audit {
  margin: 0 0 16px;
  color: #64748b;
  font-size: 13px;
}

.admin-review-override-form {
  margin: 0;
}

.admin-review-override-fields {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 420px;
}

.admin-review-override-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 0;
}

.admin-review-override-label {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-review-override .admin-review-override-select {
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 0 32px 0 10px;
  font-size: 14px;
  font-family: inherit;
  color: #1a2433;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  border: 1px solid #d0d8e2;
  border-radius: 6px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.admin-review-override .admin-review-override-select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.35);
}

.admin-review-override-submit {
  flex-shrink: 0;
  min-height: 36px;
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  white-space: nowrap;
}

/* Review dropdown (used in table action columns) */
.review-dropdown {
  position: relative;
  display: inline-block;
}

.review-dropdown-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.review-dropdown-button:hover {
  background: #e0e7ff;
}

.review-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 30;
  overflow: hidden;
}

.review-dropdown-menu.is-open {
  display: block;
}

.review-dropdown-menu form {
  margin: 0;
}

.review-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: #334155;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.review-dropdown-menu button:hover {
  background: #f8fafc;
}
