/* Enterprise ops UI ? source of truth also in static/src/input.css (Tailwind build when Node available) */
  :root {
    --brand-50: #fff0f8;
    --brand-100: #ffd9f3;
    --brand-200: #ffb3e6;
    --brand-500: #ff67ce;
    --brand-600: #ed0390;
    --brand-700: #d10280;
    --brand-800: #a30166;
    --surface: #f8fafc;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
  }

  * {
    box-sizing: border-box;
  }

  body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    background: var(--surface);
    color: var(--text);
  }
 
  .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text);
    line-height: 1.25;
  }

  .page-subtitle {
    margin-top: 0.375rem;
    color: var(--muted);
    max-width: 40rem;
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }

  .app-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .app-card-padded {
    padding: 1.25rem;
  }

  .app-card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .app-card-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
  }

  .stat-grid {
    display: grid;
    gap: 0.75rem;
  }

  @media (min-width: 768px) {
    .stat-grid-3 {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .stat-grid-4 {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .stat-grid-5 {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }
  }

  .stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 1.125rem;
    box-shadow: none;
    text-decoration: none;
    color: inherit;
    display: block;
  }

  .stat-card:hover {
    border-color: #cbd5e1;
  }

  .stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .stat-value {
    margin-top: 0.25rem;
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
  }

  .stat-value-sm {
    margin-top: 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25rem;
    padding: 0.5rem 0.875rem;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
  }

  .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .btn-primary {
    background: var(--brand-600);
    color: #fff;
    box-shadow: none;
  }

  .btn-primary:hover:not(:disabled) {
    background: var(--brand-700);
  }

  .btn-secondary {
    background: #fff;
    border-color: #cbd5e1;
    color: #334155;
  }

  .btn-secondary:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
  }

  .btn-ghost {
    background: transparent;
    color: #475569;
    border-color: transparent;
  }

  .btn-ghost:hover:not(:disabled) {
    background: #f1f5f9;
    color: var(--text);
  }

  .btn-danger {
    background: #dc2626;
    color: #fff;
  }

  .btn-danger:hover:not(:disabled) {
    background: #b91c1c;
  }

  .btn-success {
    background: #059669;
    color: #fff;
  }

  .btn-success:hover:not(:disabled) {
    background: #047857;
  }

  .btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
  }

  .form-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
  }

  .form-input,
  .form-select,
  .form-textarea {
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: var(--text);
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .form-input:focus,
  .form-select:focus,
  .form-textarea:focus {
    outline: none;
    border-color: var(--brand-600);
    box-shadow: 0 0 0 3px rgba(237, 3, 144, 0.18);
  }

  .filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: flex-end;
    padding: 0.875rem 1rem;
  }

  .table-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: none;
  }

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

  .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
  }

  .data-table thead th {
    background: #f8fafc;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.625rem;
    font-weight: 700;
    color: #64748b;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }

  .data-table tbody td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #334155;
  }

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

  .data-table tbody tr:hover {
    background: #f8fafc;
  }

  .data-table tbody tr.row-issue {
    background: #fff;
    box-shadow: inset 3px 0 0 #f87171;
  }

  .data-table tbody tr.row-issue:hover {
    background: #fef2f2;
  }

  .data-table tbody tr.row-warning {
    background: #fff;
    box-shadow: inset 3px 0 0 #fbbf24;
  }

  .table-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
  }

  .badge {
    display: inline-flex;
    align-items: center;
    border-radius: 0.375rem;
    padding: 0.0625rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25rem;
  }

  .badge-success {
    background: #dcfce7;
    color: #166534;
  }
  .badge-danger {
    background: #fee2e2;
    color: #991b1b;
  }
  .badge-warning {
    background: #fef3c7;
    color: #92400e;
  }
  .badge-info {
    background: #e0f2fe;
    color: #075985;
  }

  .detail-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    font-size: 0.875rem;
  }
  .detail-dl dt {
    color: #64748b;
    font-weight: 500;
  }
  .detail-dl dd {
    margin: 0;
    color: #0f172a;
  }

  .entitlement-list {
    margin: 0;
    padding-left: 1.1rem;
    list-style: disc;
  }
  .entitlement-list li {
    margin: 0.1rem 0;
  }
  .entitlement-list-actions {
    list-style: none;
    padding-left: 0;
  }
  .entitlement-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f1f5f9;
  }
  .entitlement-list-item:last-child {
    border-bottom: none;
  }

  .detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid #e2e8f0;
  }
  .detail-tab {
    padding: 0.55rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
  }
  .detail-tab:hover {
    color: #0f172a;
  }
  .detail-tab-active {
    color: var(--brand-700, #d10280);
    border-bottom-color: var(--brand-600, #ed0390);
  }

  [x-cloak] {
    display: none !important;
  }

  .link {
    color: var(--brand-600);
    font-weight: 500;
    text-decoration: none;
  }

  .link:hover {
    color: var(--brand-800);
    text-decoration: underline;
  }

  .alert {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid;
    font-size: 0.8125rem;
  }

  .alert-info {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #075985;
  }

  .alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
  }

  .alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
  }

  .alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
  }

  .empty-state {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted);
  }

  .focus-section {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
  }

  .focus-kicker {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--brand-600);
  }

  .tile-link {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background-color 0.15s;
  }

  .tile-link:hover {
    border-color: var(--brand-200);
    background: var(--brand-50);
  }

  .issue-pill {
    display: inline-flex;
    border-radius: 0.375rem;
    border: 1px solid #fecaca;
    background: #fff;
    padding: 0.0625rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #991b1b;
    text-decoration: none;
  }

  .issue-pill:hover {
    background: #fef2f2;
  }

  .issue-pill-active {
    box-shadow: 0 0 0 2px #f87171;
  }

  .issue-pill-compact {
    display: inline-block;
    margin: 0 0.2rem 0.2rem 0;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
    max-width: 100%;
  }

  .manager-attestation-table-panel {
    overflow-x: visible;
  }

  .manager-attestation-table {
    width: 100%;
    table-layout: auto;
  }

  .manager-attestation-table .col-issues {
    min-width: 10rem;
    max-width: 16rem;
    white-space: normal;
  }

  .manager-attestation-table .col-cycle {
    min-width: 6.5rem;
  }

  .manager-attestation-table .col-actions {
    min-width: 12rem;
  }

  .manager-attestation-table .col-comment {
    min-width: 8rem;
  }

  .master-table-panel {
    max-height: min(70vh, 900px);
    overflow: auto;
    scrollbar-gutter: stable;
  }

  .master-table-panel thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #f8fafc;
    box-shadow: inset 0 -1px 0 var(--border);
  }

  .master-table-panel .sticky-col {
    position: sticky;
    left: 0;
    z-index: 10;
    background: #fff;
  }

  .master-table-panel thead th.sticky-col {
    z-index: 30;
    background: #f8fafc;
  }

  .master-table-panel tbody tr.row-issue td.sticky-col {
    background: #fff;
  }

  .master-table-panel tbody tr.row-ok td.sticky-col {
    background: #fff;
  }

  .master-table-panel tbody tr:hover td {
    background: #f8fafc;
  }

  .master-table-panel tbody tr.row-issue:hover td.sticky-col {
    background: #fef2f2;
  }

  .login-shell {
    min-height: calc(100vh - 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
  }

  .login-card {
    width: 100%;
    max-width: 26rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  }

  .login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
  }

  .login-card p {
    color: var(--muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }

  .login-card label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.375rem;
  }

  .btn-ad-sso {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    background: var(--brand-600);
    color: #fff;
    border: 1px solid var(--brand-700);
    font-weight: 600;
  }

  .btn-ad-sso:hover {
    background: var(--brand-700);
    border-color: var(--brand-800);
  }

  .login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .login-divider::before,
  .login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
  }

  .login-card input[type="text"],
  .login-card input[type="password"] {
    width: 100%;
    margin-bottom: 1rem;
  }

  .login-card .errorlist {
    color: #dc2626;
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
    list-style: none;
    padding: 0;
  }

  .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1rem;
  }

  .app-nav-link.active {
    color: #fff !important;
    background: rgba(237, 3, 144, 0.35) !important;
  }

  .nav-dropdown {
    position: relative;
  }

  .nav-dropdown-toggle {
    cursor: pointer;
    border: none;
    background: transparent;
  }

  .nav-dropdown.is-active .nav-dropdown-toggle,
  .nav-dropdown:focus-within .nav-dropdown-toggle,
  .nav-dropdown:hover .nav-dropdown-toggle {
    color: #fff !important;
    background: rgba(237, 3, 144, 0.35) !important;
  }

  .nav-dropdown-menu {
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 100;
    min-width: 11rem;
    padding: 0.375rem 0 0.25rem;
    border-radius: 0.5rem;
    border: 1px solid #334155;
    background: #0f172a;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  }

  .nav-dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 0.375rem;
  }

  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-dropdown:hover .nav-dropdown-chevron,
  .nav-dropdown:focus-within .nav-dropdown-chevron {
    transform: rotate(180deg);
  }

  .nav-dropdown-chevron {
    transition: transform 0.15s ease;
  }

  .nav-dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #cbd5e1;
    text-decoration: none;
  }

  .nav-dropdown-item:hover,
  .nav-dropdown-item:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
  }

  .nav-dropdown-item.active {
    color: #fff;
    background: rgba(237, 3, 144, 0.35);
  }

  .ops-shell-header {
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
  }

  .scope-banner {
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.375rem;
    padding: 0.375rem 0.625rem;
  }
