.checks-header {
  display: grid;
  grid-template-columns: 40px 90px minmax(100px, 1fr) auto auto auto;
  column-gap: 2.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #e5e7eb;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  align-items: center;
}
.check-summary {
  display: grid;
  grid-template-columns: 40px 90px minmax(100px, 1fr) auto auto auto;
  column-gap: 2.5rem;
  padding: 1rem 1.5rem;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.15s;
}
.col-check-number {
  text-align: center;
  justify-content: center;
}
.check-number-badge {
  width: 1.5em;
  height: 1.5em;
  line-height: 1.5em;
  font-size: 0.8em;
}
.latest-pill {
  font-size: 0.65em;
  padding: 0.15em 0.5em;
}
/* ===== Check Number and Latest Pill ===== */
.col-check-number {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-right: 1em;
}
.check-number-badge {
  display: inline-block;
  background: #e5e7eb;
  color: #374151;
  font-size: 0.85em;
  font-weight: 600;
  border-radius: 50%;
  width: 2em;
  height: 2em;
  line-height: 2em;
  text-align: center;
  margin-right: 0.2em;
}
.latest-pill {
  display: inline-block;
  background: #f59e0b;
  color: #fff;
  font-size: 0.7em;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.2em 0.7em;
  letter-spacing: 0.05em;
  margin-left: 0.2em;
}
/* ===== Check History Highlight ===== */
.check-row--latest .check-summary {
  background: #fef3c7;
  box-shadow: 0 0 0 2px #f59e0b33;
  border-radius: 6px;
  position: relative;
  transition: background 0.2s, box-shadow 0.2s;
}
.check-row--latest .check-summary:hover {
  background: #fde68a;
  box-shadow: 0 0 0 2px #f59e0b99;
}
/* ===== Last Execution Highlight ===== */
.last-check-highlight {
  transition: background 0.2s, box-shadow 0.2s;
  border-radius: 6px;
  padding: 0.2em 0.6em;
}
.last-check-highlight:hover {
  background: #fef3c7;
  box-shadow: 0 0 0 2px #f59e0b33;
  cursor: pointer;
}
/* ===== Project/Environment Dashboard Table ===== */
.projects-table {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) auto auto;
  column-gap: 2rem;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.project-envs-header {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  padding: 0.75rem 1.5rem;
  background-color: #e5e7eb;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.project-env-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s;
}

.project-env-row:last-child {
  border-bottom: none;
}

.project-env-row:hover {
  background-color: #f9fafb;
  text-decoration: none;
}

/* Handle long text in dashboard table */
.col-project,
.col-environment {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.col-status {
  white-space: nowrap;
}

.col-time {
  white-space: nowrap;
  text-align: right;
}
/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* ===== CSS Variables ===== */
:root {
  --color-ok: #22c55e;
  --color-ok-bg: #dcfce7;
  --color-drift: #f59e0b;
  --color-drift-bg: #fef3c7;
  --color-error: #ef4444;
  --color-error-bg: #fee2e2;
  --color-unknown: #6b7280;
  --color-unknown-bg: #f3f4f6;
  
  --color-bg: #f9fafb;
  --color-card: #ffffff;
  --color-border: #e5e7eb;
  --color-text: #111827;
  --color-text-muted: #6b7280;
  --color-link: #2563eb;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --radius: 8px;
}

/* ===== Base Styles ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  margin: 0;
  padding: 0;
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  margin: 0 0 1rem;
}

/* ===== Layout ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Wider container for dashboard charts */
.container:has(.dashboard) {
  max-width: 1600px;
}

/* Keep table and filter bar at original width */
.dashboard .detail-header,
.dashboard .projects-list {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Dashboard Header ===== */
.dashboard-header {
  text-align: center;
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.dashboard-header .subtitle {
  color: var(--color-text-muted);
  margin: 0;
}

/* ===== Status Summary ===== */
.status-summary {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.status-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 100px;
  padding: 0;
  border-radius: var(--radius);
  min-width: 0;
  box-sizing: border-box;
}

.status-badge .count {
  font-size: 2rem;
  font-weight: bold;
}

.status-badge .label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.status-ok {
  background-color: var(--color-ok-bg);
  color: var(--color-ok);
}

.status-badge.status-drift {
  background-color: var(--color-drift-bg);
  color: var(--color-drift);
}

.status-badge.status-error {
  background-color: var(--color-error-bg);
  color: var(--color-error);
}

.status-badge.status-unknown {
  background-color: var(--color-unknown-bg);
  color: var(--color-unknown);
}

/* ===== Projects List ===== */
.projects-list h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.projects-list {
  overflow-x: auto;
  padding: 0.25rem;
  margin: -0.25rem;
}


.project-row {
  display: grid;
  grid-template-columns: 40px 1fr 100px 120px 120px;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s;
}

.project-row:last-child {
  border-bottom: none;
}

.project-row:hover {
  background-color: var(--color-bg);
  text-decoration: none;
}

.project-status {
  display: flex;
  align-items: center;
}

.project-info {
  display: flex;
  flex-direction: column;
}

.project-name {
  font-weight: 600;
}

.project-key {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  font-family: monospace;
}

.project-status-label {
  text-align: center;
}

.project-changes {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.project-changes .change {
  font-family: monospace;
  font-size: 0.875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.project-changes .change.add {
  background-color: var(--color-ok-bg);
  color: var(--color-ok);
}

.project-changes .change.modify {
  background-color: var(--color-drift-bg);
  color: var(--color-drift);
}

.project-changes .change.destroy {
  background-color: var(--color-error-bg);
  color: var(--color-error);
}

.project-time {
  text-align: right;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ===== Status Indicators ===== */
.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-indicator--large {
  width: 24px;
  height: 24px;
}

.status-indicator--ok {
  background-color: var(--color-ok);
}

.status-indicator--drift {
  background-color: var(--color-drift);
}

.status-indicator--error {
  background-color: var(--color-error);
}

.status-indicator--unknown {
  background-color: var(--color-unknown);
}

/* ===== Status Text ===== */
.status-text {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-text--badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.status-text--large {
  font-size: 1rem;
  padding: 0.5rem 1rem;
}

.status-text--ok {
  color: var(--color-ok);
}

.status-text--drift {
  color: var(--color-drift);
}

.status-text--error {
  color: var(--color-error);
}

.status-text--unknown {
  color: var(--color-unknown);
}

.status-text--badge.status-text--ok {
  background-color: var(--color-ok-bg);
}

.status-text--badge.status-text--drift {
  background-color: var(--color-drift-bg);
}

.status-text--badge.status-text--error {
  background-color: var(--color-error-bg);
}

.status-text--badge.status-text--unknown {
  background-color: var(--color-unknown-bg);
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 3rem;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.empty-state p {
  margin: 0.5rem 0;
}

.empty-state .hint {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* ===== Project Detail ===== */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  overflow: hidden;
}

.breadcrumb {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1;
  max-width: 70%;
}

.breadcrumb a {
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 250px;
  flex-shrink: 1;
  min-width: 0;
}

.breadcrumb a:first-child {
  flex-shrink: 0;
  max-width: none;
}

.breadcrumb span {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 250px;
  flex-shrink: 1;
  min-width: 0;
}

.breadcrumb-sep {
  flex-shrink: 0;
  font-weight: normal;
  max-width: none;
  overflow: visible;
}

.back-link {
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 1;
  min-width: 0;
  max-width: min(350px, calc(100vw - 6rem));
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-summary-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.project-summary-card .summary-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  gap: 1rem;
  overflow: hidden;
}

.project-summary-card .summary-bottom {
  position: relative;
  padding: 1rem 1.5rem;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: center;
}

.summary-bottom-left {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.summary-bottom-right {
  flex-shrink: 0;
}

.project-summary-card .summary-bottom::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 66%;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
}

.project-summary-card .main-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}

.project-summary-card .main-info h1 {
  margin: 0;
  font-size: 1.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.project-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.environment-emoji {
  font-size: 1.25rem;
  line-height: 1;
}

.environment-title {
  font-size: 1.25rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
  max-width: 250px;
}

.env-separator {
  color: #bbb;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.directory-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.directory-path {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  color: var(--color-text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

.project-detail-item {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  max-width: 100%;
  min-width: 0;
}

.project-detail-item a {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  color: var(--color-text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(600px, calc(100vw - 6rem));
}

.project-detail-item a:hover {
  color: var(--color-link);
  background: rgba(0, 0, 0, 0.06);
}

.repo-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.7;
  flex-shrink: 0;
}

.repo-icon--github {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23333' d='M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z'/%3E%3C/svg%3E");
}

.repo-icon--gitlab {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23E24329' d='m23.6 9.593-.033-.086L20.3.98a.848.848 0 0 0-.347-.391.855.855 0 0 0-.987.07.858.858 0 0 0-.254.378l-2.19 6.702H7.478L5.288 1.037a.857.857 0 0 0-.254-.378.855.855 0 0 0-.987-.07.848.848 0 0 0-.347.391L.433 9.507l-.033.086a6.066 6.066 0 0 0 2.012 7.01l.01.008.028.02 4.98 3.727 2.462 1.863 1.5 1.132a1.008 1.008 0 0 0 1.216 0l1.5-1.132 2.462-1.863 5.008-3.747.012-.01a6.068 6.068 0 0 0 2.01-7.008z'/%3E%3C/svg%3E");
}

.repo-icon--bitbucket {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230052CC' d='M.778 1.213a.768.768 0 0 0-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 0 0 .77-.646l3.27-20.03a.768.768 0 0 0-.768-.892zM14.52 15.53H9.522L8.17 8.466h7.561z'/%3E%3C/svg%3E");
}

.repo-icon--generic {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4'/%3E%3Cpath d='M9 18c-4.51 2-5-2-7-2'/%3E%3C/svg%3E");
}

.slack-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23E01E5A' d='M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zm1.271 0a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313z'/%3E%3Cpath fill='%2336C5F0' d='M8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zm0 1.271a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312z'/%3E%3Cpath fill='%232EB67D' d='M18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zm-1.27 0a2.528 2.528 0 0 1-2.522 2.521 2.528 2.528 0 0 1-2.521-2.521V2.522A2.528 2.528 0 0 1 15.164 0a2.528 2.528 0 0 1 2.522 2.522v6.312z'/%3E%3Cpath fill='%23ECB22E' d='M15.164 18.956a2.528 2.528 0 0 1 2.522 2.522A2.528 2.528 0 0 1 15.164 24a2.528 2.528 0 0 1-2.521-2.522v-2.522h2.521zm0-1.27a2.528 2.528 0 0 1-2.521-2.522 2.528 2.528 0 0 1 2.521-2.521h6.314A2.528 2.528 0 0 1 24 15.164a2.528 2.528 0 0 1-2.522 2.522h-6.314z'/%3E%3C/svg%3E");
}

.slack-channel {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  color: var(--color-text-muted);
  background: rgba(0, 0, 0, 0.04);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.project-key-tag {
  display: inline-block;
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  background: var(--color-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.status-pill {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
}

.status-pill--ok {
  background-color: var(--color-ok-bg);
  color: var(--color-ok);
}

.status-pill--drift {
  background-color: var(--color-drift-bg);
  color: var(--color-drift);
}

.status-pill--error {
  background-color: var(--color-error-bg);
  color: var(--color-error);
}

.status-pill--unknown {
  background-color: var(--color-unknown-bg);
  color: var(--color-unknown);
}

.project-meta-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.meta-separator {
  color: var(--color-text-muted);
}

.status-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-label--ok {
  color: var(--color-ok);
}

.status-label--drift {
  color: var(--color-drift);
}

.status-label--error {
  color: var(--color-error);
}

.status-label--unknown {
  color: var(--color-unknown);
}

.last-check-time {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== Check History ===== */
.check-history {
  overflow-x: auto;
  padding: 0.25rem;
  margin: -0.25rem;
}

.check-history h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.checks-table {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}


.checks-header span {
  text-align: left;
}

.checks-header span:last-child {
  text-align: right;
}

.check-row {
  border-bottom: 1px solid var(--color-border);
}

.check-row:last-child {
  border-bottom: none;
}

.check-summary {
  display: grid;
  grid-template-columns: 40px 90px minmax(100px, 1fr) auto auto auto;
  column-gap: 2.5rem;
  padding: 1rem 1.5rem;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.15s;
}

.check-summary:hover {
  background-color: var(--color-bg);
}

.col-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.col-status .status-text {
  font-size: 0.875rem;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
}

.col-summary, .col-duration, .col-time {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  min-width: 0;
}

.environment-row .col-time {
  text-align: right;
}

.oneline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.expand-btn {
  background: none;
  border: 1px solid var(--color-border);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all 0.15s;
}

.expand-btn:hover {
  background-color: var(--color-bg);
  color: var(--color-text);
}

.expand-icon {
  display: inline-block;
  transition: transform 0.15s;
}

.check-row.expanded .expand-icon {
  transform: rotate(90deg);
}

.no-output {
  color: var(--color-text-muted);
}

.check-output {
  padding: 1rem 1.5rem;
  background-color: #1e293b;
  border-top: 1px solid var(--color-border);
}

.check-output pre {
  margin: 0;
  overflow-x: auto;
}

.check-output code {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 0.8125rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===== Environments List ===== */
.environments-list {
  overflow-x: auto;
  padding: 0.25rem;
  margin: -0.25rem;
}

.environments-list h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.environments-table {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}



.environments-header {
  display: grid;
  grid-template-columns: 100px minmax(150px, 300px) 1fr 120px 40px;
  /* Status | Environment | Summary | Last Check | Arrow */
  column-gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #e5e7eb;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.environment-row {
  display: grid;
  grid-template-columns: 100px minmax(150px, 300px) 1fr 120px 40px;
  /* Status | Environment | Summary | Last Check | Arrow */
  column-gap: 1.5rem;
  padding: 1rem 1.5rem;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s;
}

.environment-row:last-child {
  border-bottom: none;
}

.environment-row:hover {
  background-color: #f9fafb;
  text-decoration: none;
}

.col-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.environment-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.environment-key {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-family: monospace;
}

.col-arrow {
  text-align: right;
  color: var(--color-text-muted);
}

.project-environments-count {
  text-align: center;
}

.environments-count {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .project-row {
    grid-template-columns: 30px 1fr auto;
    gap: 0.5rem;
  }
  
  .project-changes,
  .project-time {
    display: none;
  }
  
  .project-summary {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
  
  .current-status {
    flex-direction: column;
  }
  
  .last-check-info {
    text-align: center;
  }
  
  .checks-header {
    display: none;
  }
  
  .check-summary {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }
  
  .col-add, .col-change, .col-destroy, .col-time {
    display: none;
  }
}

/* ===== Top Navigation ===== */
.top-nav {
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
}

.nav-brand:hover {
  text-decoration: none;
  color: var(--color-link);
}

.nav-logo {
  height: 28px;
  width: auto;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link-left {
  position: relative;
  padding-left: 1.25rem;
  margin-left: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.nav-link-left svg {
  flex-shrink: 0;
}

.nav-link-left::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 1.25rem;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--color-border), transparent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-right form {
  margin: 0;
}

.nav-user {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ===== Flash Messages ===== */
.flash-messages {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.flash-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
  color: inherit;
}

.flash-close:hover {
  opacity: 1;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.flash-notice {
  background-color: var(--color-ok-bg);
  color: var(--color-ok);
  border: 1px solid var(--color-ok);
}

.flash-alert {
  background-color: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background-color: var(--color-link);
  color: white;
  border-color: var(--color-link);
}

.btn-primary:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--color-card);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-bg);
  text-decoration: none;
}

.btn-danger {
  background-color: var(--color-error);
  color: white;
  border-color: var(--color-error);
}

.btn-danger:hover {
  background-color: #b91c1c;
  border-color: #b91c1c;
}

.btn-danger-outline {
  background-color: transparent;
  color: var(--color-error);
  border-color: var(--color-error);
}

.btn-danger-outline:hover {
  background-color: var(--color-error);
  color: white;
}

/* ===== Login Page ===== */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.login-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  height: 7rem;
  width: 11rem;
  margin-bottom: 0.5rem;
  object-fit: contain;
}

.login-header h1 {
  font-size: 2rem;
  margin: 0 0 0.25rem;
  font-weight: 700;
}

.login-subtitle {
  color: var(--color-text-muted);
  font-size: 1rem;
  margin: 0;
}

.login-version {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  margin: 1.5rem 0 0 0;
  opacity: 0.6;
}

.login-form .form-group {
  margin-bottom: 1rem;
}

.login-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.login-form input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.login-form input:focus {
  outline: none;
  border-color: var(--color-link);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.login-form .btn {
  margin-top: 1rem;
}

/* ===== Confirmation Modal ===== */
.confirm-modal {
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 0;
  max-width: 450px;
  width: 90%;
}

.confirm-modal::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
}

.confirm-modal-content {
  padding: 1.5rem;
}

.confirm-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.confirm-modal-icon {
  font-size: 1.5rem;
  color: var(--color-error);
}

.confirm-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.confirm-modal-body p {
  margin: 0 0 0.75rem;
  color: var(--color-text);
}

.confirm-modal-warning {
  color: var(--color-error);
  font-weight: 500;
}

.confirm-modal-note {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ===== Summary Top Actions ===== */
.summary-top-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* ===== Detail Section Header ===== */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  position: sticky;
  top: 49px; /* Below the sticky nav bar */
  z-index: 50;
  padding: 0.5rem 0;
}

/* Full-width background that covers scrolling content */
.detail-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: var(--color-bg);
  z-index: -1;
}

.detail-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* Push view toggle to the right */
.detail-filters .view-toggle {
  margin-left: auto;
}

.filter-pill {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 6px;
  padding: 0 2.5em 0 0.75em;
  font-size: 0.875rem;
  height: 2.25rem;
  line-height: 2.25rem;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%236b7280" height="16" viewBox="0 0 20 20" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.06l3.71-3.83a.75.75 0 1 1 1.08 1.04l-4.25 4.39a.75.75 0 0 1-1.08 0L5.21 8.27a.75.75 0 0 1 .02-1.06z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75em center;
  background-size: 1em;
}

.filter-pill:focus {
  border-color: var(--color-primary);
}

.filter-sep {
  width: 1px;
  height: 1.5rem;
  background: #e5e7eb;
  flex-shrink: 0;
}

.filter-search {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0 0.75rem;
  height: 2.25rem;
  flex: 1;
  min-width: 0;
}

.filter-icon {
  font-size: 0.875rem;
  margin-right: 0.5rem;
  color: #9ca3af;
  flex-shrink: 0;
}

.filter-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  min-width: 0;
  width: 100%;
}

.filter-input::placeholder {
  color: #9ca3af;
}

.filter-clear {
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s;
  padding: 0 0.25rem;
  margin-left: 0.5rem;
}

.filter-clear:hover {
  color: var(--color-warning);
}

@media (max-width: 640px) {
  .detail-header {
    flex-wrap: wrap;
  }
  .detail-filters {
    order: 1;
    flex-basis: 100%;
    margin-top: 0.75rem;
  }
  .view-toggle {
    margin-left: auto;
  }
}

/* ===== View Toggle ===== */
.view-toggle {
  display: inline-flex;
  background: #f3f4f6;
  border-radius: 6px;
  padding: 0.2rem;
  gap: 0.2rem;
  flex-shrink: 0;
}

/* When inside filter container, adjust background */
.detail-filters .view-toggle {
  background: #eef1f5;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius) - 2px);
  color: var(--color-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover:not(.active) {
  background: var(--color-bg);
  color: var(--color-text);
}

.view-toggle-btn.active {
  background: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
  font-weight: 600;
}

.view-toggle-btn svg {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .view-toggle-btn span {
    display: none;
  }
  .view-toggle-btn {
    padding: 0.5rem 0.75rem;
  }
}

/* ===== Metrics Section ===== */
.metrics-section {
  margin-bottom: 2rem;
}

.metrics-section h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ===== Charts Grid ===== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

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

/* ===== Chart Card ===== */
.chart-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.25rem;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  z-index: 1;
}

.chart-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.chart-card-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.chart-expand-hint {
  font-size: 0.75rem;
  color: var(--color-muted);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chart-card:hover .chart-expand-hint {
  opacity: 1;
}

.chart-container {
  position: relative;
  height: 350px;
  width: 100%;
}

@media (max-width: 768px) {
  .chart-container {
    height: 280px;
  }
}

/* ===== Chart Modal ===== */
.chart-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}

.chart-modal.active {
  display: block;
}

.chart-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.chart-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 1200px;
  height: 80vh;
  max-height: 700px;
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.chart-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.chart-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

.chart-modal-close {
  background: none;
  border: none;
  font-size: 1.75rem;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.chart-modal-close:hover {
  color: var(--color-text);
}

.chart-modal-body {
  flex: 1;
  padding: 1.5rem;
  min-height: 0;
}

.chart-modal-body canvas {
  width: 100% !important;
  height: 100% !important;
}

@media (max-width: 640px) {
  .chart-modal-content {
    width: 95vw;
    height: 85vh;
  }

  .chart-modal-header {
    padding: 1rem;
  }

  .chart-modal-body {
    padding: 1rem;
  }
}

/* ===== Chart Info Tooltip ===== */
.chart-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-left: 0.4rem;
  color: var(--color-text-muted);
  cursor: help;
  vertical-align: middle;
  opacity: 0.5;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.chart-info:hover {
  opacity: 1;
  color: var(--color-link);
}

.chart-info svg {
  display: block;
}

/* Tooltip */
.chart-info::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.6rem 0.8rem;
  background: rgba(17, 24, 39, 0.95);
  color: #f9fafb;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  width: max-content;
  max-width: 280px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100;
  pointer-events: none;
}

/* Tooltip arrow */
.chart-info::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(17, 24, 39, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 100;
  pointer-events: none;
}

.chart-info:hover::after,
.chart-info:hover::before {
  opacity: 1;
  visibility: visible;
}

/* Prevent tooltip from being cut off on the left */
.chart-card:first-child .chart-info::after,
.charts-grid > :nth-child(odd) .chart-info::after {
  left: 0;
  transform: translateX(0);
}

.chart-card:first-child .chart-info::before,
.charts-grid > :nth-child(odd) .chart-info::before {
  left: 10px;
  transform: translateX(0);
}

/* Prevent tooltip from being cut off on the right */
.charts-grid > :nth-child(even) .chart-info::after {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.charts-grid > :nth-child(even) .chart-info::before {
  left: auto;
  right: 10px;
  transform: translateX(0);
}

/* Stop click propagation on info icon */
.chart-info {
  pointer-events: auto;
}

/* ===== Tag Filter Buttons ===== */
.tag-filters {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-start;
}

.tag-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-border);
  background: #f9fafb;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tag-filter-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: var(--color-text);
}

.tag-filter-btn.active {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--color-link);
  font-weight: 600;
}

@media (max-width: 640px) {
  .tag-filters {
    gap: 0.25rem;
  }

  .tag-filter-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* ===== Navigation Links ===== */
.nav-link {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--color-bg);
  color: var(--color-text);
  text-decoration: none;
}

/* ===== Role Badges ===== */
.role-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.025em;
}

.role-badge--sm {
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  margin-left: 0.5rem;
}

.role-badge--viewer {
  background-color: var(--color-unknown-bg);
  color: var(--color-unknown);
}

.role-badge--editor {
  background-color: var(--color-drift-bg);
  color: var(--color-drift);
}

.role-badge--admin {
  background-color: var(--color-ok-bg);
  color: var(--color-ok);
}

/* ===== Badge ===== */
.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.5rem;
}

.badge-info {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--color-link);
}

/* ===== User Management ===== */
.users-management {
  max-width: 900px;
  margin: 0 auto;
}

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

.header-content h1 {
  margin: 0 0 0.25rem;
}

.header-subtitle {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 0.875rem;
}

.header-actions {
  flex-shrink: 0;
}

.form-page {
  max-width: 500px;
  margin: 0 auto;
}

.form-page .form-card {
  margin: 0;
}

/* Users Table */
.users-table {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.users-header {
  display: grid;
  grid-template-columns: 1fr 100px 120px 160px;
  column-gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #e5e7eb;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.user-row {
  display: grid;
  grid-template-columns: 1fr 100px 120px 160px;
  column-gap: 1.5rem;
  padding: 1rem 1.5rem;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

.user-row:last-child {
  border-bottom: none;
}

.col-email {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-role {
  text-align: left;
}

.col-created {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.col-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Form Card */
.form-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.user-form .form-group {
  margin-bottom: 1.25rem;
}

.user-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.user-form input,
.user-form select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.user-form input:focus,
.user-form select:focus {
  outline: none;
  border-color: var(--color-link);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%236b7280" height="16" viewBox="0 0 20 20" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M5.23 7.21a.75.75 0 0 1 1.06.02L10 11.06l3.71-3.83a.75.75 0 1 1 1.08 1.04l-4.25 4.39a.75.75 0 0 1-1.08 0L5.21 8.27a.75.75 0 0 1 .02-1.06z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.form-errors {
  background-color: var(--color-error-bg);
  border: 1px solid var(--color-error);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.form-errors h3 {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--color-error);
}

.form-errors ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-error);
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (max-width: 768px) {
  .users-header {
    display: none;
  }

  .user-row {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }

  .col-role,
  .col-created {
    display: none;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    margin-top: 1rem;
  }
}

/* ===== Section Headers ===== */
.section-header {
  margin-bottom: 1rem;
}

.section-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

/* ===== Invites Section ===== */
.invites-section {
  margin-bottom: 2rem;
}

.invite-form-inline {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.invite-form-inline .form-row-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.invite-form-inline .inline-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  white-space: nowrap;
}

.invite-form-inline .form-control-inline {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.invite-form-inline .form-control-inline:focus {
  outline: none;
  border-color: var(--color-link);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.invite-form-inline input.form-control-inline {
  flex: 0 1 auto;
  min-width: 280px;
  max-width: 320px;
}

.invite-form-inline .form-control-role {
  min-width: 120px;
}

.invite-form-inline .btn {
  margin-left: auto;
  white-space: nowrap;
}

/* Invites List */
.invites-list {
  margin-top: 1.5rem;
}

.invites-list h3 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
  color: var(--color-text-muted);
}

.invites-table {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.invites-header {
  display: grid;
  grid-template-columns: 1fr 100px 100px 150px 80px;
  column-gap: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: #e5e7eb;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.invite-row {
  display: grid;
  grid-template-columns: 1fr 100px 100px 150px 80px;
  column-gap: 1rem;
  padding: 1rem 1.5rem;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
}

.invite-row:last-child {
  border-bottom: none;
}

.col-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.invite-url {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  background: var(--color-bg);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 250px;
}

.col-expires {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.col-created-by {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.copy-btn {
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .invites-header {
    display: none;
  }

  .invite-row {
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }

  .col-expires,
  .col-created-by {
    display: none;
  }

  .invite-form-inline .form-row-inline {
    flex-wrap: wrap;
  }

  .invite-form-inline input.form-control-inline {
    flex: 1 1 100%;
    min-width: 0;
  }

  .invite-form-inline .btn {
    margin-left: 0;
  }
}

