/* ==========================================================================
   Design Tokens
   ========================================================================== */

:root {
  /* Surfaces */
  --app-sidebar-bg: white;
  --app-content-bg: #F5F4F2;
  --app-chrome-bg: #F5F4F2;
  --app-chrome-border: rgba(70, 69, 69, 0.1);

  /* Accent / interactive cards */
  --app-accent-bg: #F6E3E4;
  --app-card-bg: white;
  --app-card-border: #EBE9E5;

  /* Primary button */
  --app-btn-primary: #4B3030;
  --app-btn-primary-hover: #643335;
  --app-on-btn-primary: white;

  /* Text hierarchy */
  --app-text: black;
  --app-text-secondary: #464545;
  --app-text-meta: #464545;
  --app-icon-muted: #999;
  --app-link: #2563EB;

  /* Borders */
  --app-border: #EBE9E5;

  /* Focus & active states */
  --app-focus-ring: #84CAFF;
  --app-item-active-bg: #F6E3E4;

  /* Status colors */
  --status-open-bg: #fef3c7;
  --status-open-text: #92400e;
  --status-seen-bg: #fef9c3;
  --status-seen-text: #854d0e;
  --status-progress-bg: #dbeafe;
  --status-progress-text: #1e40af;
  --status-resolved-bg: #d1fae5;
  --status-resolved-text: #065f46;
  --status-disqualified-bg: #f3f4f6;
  --status-disqualified-text: #6b7280;

  /* Success */
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #166534;

  /* Error */
  --error-text: #dc2626;
}


/* ==========================================================================
   Reset & Base
   ========================================================================== */

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  letter-spacing: 0.025rem;
  color: var(--app-text);
  font-size: 14px;
  line-height: 1.5;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--app-content-bg);
}

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

h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
}


/* ==========================================================================
   Scrollbars
   ========================================================================== */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}


/* ==========================================================================
   Focus & Accessibility
   ========================================================================== */

*:focus-visible {
  outline: 2px solid var(--app-focus-ring);
  outline-offset: 2px;
}

button:focus:not(:focus-visible) {
  outline: none;
}


/* ==========================================================================
   AppShell Layout
   ========================================================================== */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 48px;
  background: white;
  border-bottom: 1px solid var(--app-chrome-border);
  flex-shrink: 0;
}

.app-header__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05rem;
  text-transform: uppercase;
  color: var(--app-text);
  text-decoration: none;
}
.app-header__title:hover {
  text-decoration: none;
}

.app-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  width: 290px;
  background: var(--app-sidebar-bg);
  border-right: 1px solid var(--app-chrome-border);
  overflow-y: auto;
  flex-shrink: 0;
  display: none;
}

.app-sidebar__section-label {
  padding: 16px 16px 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08rem;
  color: var(--app-icon-muted);
}

/* Main content */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--app-content-bg);
}

.app-main__inner {
  flex: 1;
  padding: 24px 16px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.3);
}
.sidebar-overlay.active {
  display: block;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--app-text-secondary);
}
.sidebar-toggle:hover {
  color: var(--app-text);
}

@media (min-width: 768px) {
  .app-sidebar {
    display: block;
    position: static;
  }
  .sidebar-toggle {
    display: none;
  }
  .sidebar-overlay {
    display: none !important;
  }
}

/* Sidebar mobile open state */
.app-sidebar.open {
  display: block;
  position: fixed;
  top: 48px;
  left: 0;
  bottom: 0;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* ==========================================================================
   Navigation Items
   ========================================================================== */

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--app-text-secondary);
  text-decoration: none;
  transition: background 0.15s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: rgba(0, 0, 0, 0.03);
  text-decoration: none;
}
.nav-item.active {
  background: var(--app-item-active-bg);
  font-weight: 600;
}

.nav-item__icon {
  width: 16px;
  height: 16px;
  color: var(--app-icon-muted);
  flex-shrink: 0;
}
.nav-item.active .nav-item__icon {
  color: var(--app-text);
}

.nav-item__badge {
  margin-left: auto;
  background: var(--app-accent-bg);
  color: var(--app-text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 9999px;
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--app-btn-primary);
  color: var(--app-on-btn-primary);
  padding: 9px 16px;
  border-radius: 9999px;
  border: none;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-primary:hover {
  background: var(--app-btn-primary-hover);
  text-decoration: none;
  color: var(--app-on-btn-primary);
}

.btn-primary--icon {
  padding: 8px 16px;
  gap: 0;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  color: var(--app-text-secondary);
  padding: 9px 16px;
  border-radius: 9999px;
  border: 1px solid var(--app-card-border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}
.btn-secondary:hover {
  background: var(--app-content-bg);
  text-decoration: none;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 4px;
  border: none;
  background: none;
  color: var(--app-icon-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.btn-icon:hover {
  color: var(--app-text);
  background: rgba(0, 0, 0, 0.05);
}


/* ==========================================================================
   Cards & Containers
   ========================================================================== */

.card {
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  border-radius: 0;
  padding: 12px 16px;
}

.section-card {
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  border-radius: 0;
  margin-bottom: 2px;
}

.section-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--app-card-border);
  background: rgb(218, 211, 212);
}

.section-header__info h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 2px;
}
.section-header__info p {
  font-size: 12px;
  color: var(--app-text-meta);
  margin: 0;
}

.section-header__count {
  font-size: 11px;
  font-weight: 600;
  color: var(--app-text-meta);
  background: var(--app-content-bg);
  padding: 2px 8px;
}

.section-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ==========================================================================
   Issue Items
   ========================================================================== */

/* Issue grid: cards flow inline, wrap to next row on small viewports */
.issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  padding: 12px;
}

.issue-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  text-decoration: none;
  color: var(--app-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  align-items: flex-start;
}
.issue-card:hover {
  border-color: var(--app-icon-muted);
  background: rgba(0, 0, 0, 0.015);
  text-decoration: none;
}

.issue-card__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--app-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.issue-card__date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--app-icon-muted);
  margin-top: auto;
}


/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal__panel {
  position: relative;
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  width: 100%;
  max-width: 640px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
}

.modal__header {
  position: relative;
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--app-card-border);
}

.modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
}

.modal__admin-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--app-card-border);
}

.modal__delete:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.modal__title {
  font-size: 20px;
  font-weight: 600;
  margin-top: 10px;
  line-height: 1.3;
  color: var(--app-text);
  padding-right: 32px;
}

.modal__body {
  padding: 20px 28px 28px;
}


/* Issue detail content */
.issue-detail {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 10px 20px;
  font-size: 13px;
  margin: 0 0 12px 0;
}
.issue-detail dt {
  color: var(--app-text-meta);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04rem;
  font-weight: 600;
  padding-top: 1px;
}
.issue-detail dd {
  color: var(--app-text);
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

.issue-detail--data {
  margin-bottom: 0;
}
.issue-detail--data dt {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--app-text-secondary);
}

.issue-detail__heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06rem;
  color: var(--app-icon-muted);
  margin: 20px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--app-card-border);
}


/* ==========================================================================
   Attachments
   ========================================================================== */

.attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.attachment {
  display: block;
  border: 1px solid var(--app-card-border);
  transition: border-color 0.15s ease;
  text-decoration: none;
}
.attachment:hover {
  border-color: var(--app-icon-muted);
  text-decoration: none;
}

.attachment--image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--app-content-bg);
}
.attachment--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attachment--doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--app-text);
  font-size: 13px;
}
.attachment--doc .icon {
  color: var(--app-icon-muted);
  flex-shrink: 0;
}
.attachment--doc:hover .icon {
  color: var(--app-text);
}
.attachment__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment__download {
  opacity: 0.5;
}


/* ==========================================================================
   Comments
   ========================================================================== */

.comments {
  margin-top: 4px;
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-list__empty {
  font-size: 13px;
  color: var(--app-icon-muted);
  padding: 8px 0;
}

.comment {
  border: 1px solid var(--app-card-border);
  padding: 12px 14px;
  background: var(--app-card-bg);
}

.comment--op {
  background: var(--app-accent-bg);
  border-color: transparent;
}

.comment__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}

.comment__author {
  font-weight: 600;
  color: var(--app-text);
}

.comment__badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05rem;
  background: var(--app-btn-primary);
  color: var(--app-on-btn-primary);
  padding: 1px 6px;
  border-radius: 9999px;
  text-transform: uppercase;
}

.comment__date {
  margin-left: auto;
  color: var(--app-icon-muted);
  font-size: 11px;
}

.comment__body {
  font-size: 13px;
  line-height: 1.5;
  color: var(--app-text);
  word-break: break-word;
}
.comment__body p {
  margin: 0 0 8px;
}
.comment__body p:last-child {
  margin-bottom: 0;
}


.comment-form {
  border-top: 1px solid var(--app-card-border);
  padding-top: 16px;
}

.comment-form textarea {
  resize: vertical;
  min-height: 70px;
  margin-bottom: 8px;
}

.no-issues {
  padding: 16px;
  color: var(--app-icon-muted);
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--app-icon-muted);
}
.empty-state__icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  color: var(--app-card-border);
}
.empty-state__text {
  font-size: 14px;
}


/* ==========================================================================
   Status Filter (sidebar)
   ========================================================================== */

.app-sidebar__section-label--mt {
  margin-top: 16px;
}

.status-filter {
  display: flex;
  flex-direction: column;
}

.status-filter__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--app-text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.status-filter__item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.status-filter__checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.status-filter__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: opacity 0.15s ease;
}

.status-filter__item:has(.status-filter__checkbox:not(:checked)) {
  opacity: 0.45;
}

.status-filter__dot--open       { background: var(--status-open-text);          border-color: var(--status-open-text); }
.status-filter__dot--seen       { background: var(--status-seen-text);          border-color: var(--status-seen-text); }
.status-filter__dot--in_progress { background: var(--status-progress-text);     border-color: var(--status-progress-text); }
.status-filter__dot--resolved   { background: var(--status-resolved-text);      border-color: var(--status-resolved-text); }
.status-filter__dot--disqualified { background: var(--status-disqualified-text); border-color: var(--status-disqualified-text); }


/* ==========================================================================
   Status Badges
   ========================================================================== */

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
}

.status-badge--open {
  background: var(--status-open-bg);
  color: var(--status-open-text);
}
.status-badge--seen {
  background: var(--status-seen-bg);
  color: var(--status-seen-text);
}
.status-badge--in_progress {
  background: var(--status-progress-bg);
  color: var(--status-progress-text);
}
.status-badge--resolved {
  background: var(--status-resolved-bg);
  color: var(--status-resolved-text);
}
.status-badge--disqualified {
  background: var(--status-disqualified-bg);
  color: var(--status-disqualified-text);
}


/* ==========================================================================
   Success & Error Messages
   ========================================================================== */

.alert-success {
  padding: 12px 16px;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 0;
  color: var(--success-text);
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}


/* ==========================================================================
   Forms
   ========================================================================== */

.form-card {
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  border-radius: 0;
  padding: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
  margin-bottom: 6px;
  color: var(--app-text-secondary);
}

.form-group .help-text {
  font-size: 12px;
  color: var(--app-icon-muted);
  margin-top: 4px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--app-card-border);
  border-radius: 0;
  font-size: 14px;
  font-family: inherit;
  color: var(--app-text);
  background: white;
  transition: border-color 0.15s ease;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--app-focus-ring);
  box-shadow: 0 0 0 2px var(--app-focus-ring);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group .errorlist {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  color: var(--error-text);
  font-size: 12px;
}

.form-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.form-group ul li {
  margin-bottom: 4px;
}
.form-group ul li label {
  text-transform: none;
  font-weight: 400;
  font-size: 14px;
  display: inline;
  margin-left: 6px;
}

.section-fields-divider {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06rem;
  color: var(--app-icon-muted);
  margin: 20px 0 12px;
  border-top: 1px solid var(--app-card-border);
  padding-top: 16px;
}

.form-fieldset {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.form-fieldset legend {
  font-weight: 600;
  font-size: 13px;
  padding: 0 6px;
}
.form-fieldset .form-group:last-child {
  margin-bottom: 0;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}


/* ==========================================================================
   Page Header
   ========================================================================== */

.page-header {
  margin-bottom: 24px;
}

.page-header__title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.page-header__subtitle {
  font-size: 13px;
  color: var(--app-text-meta);
}

.page-header__actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}


/* ==========================================================================
   Icon Utilities
   ========================================================================== */

.icon {
  display: inline-block;
  vertical-align: middle;
}
.icon--sm { width: 14px; height: 14px; }
.icon--md { width: 18px; height: 18px; }
.icon--lg { width: 24px; height: 24px; }


/* ==========================================================================
   Back Link
   ========================================================================== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
  color: var(--app-text-secondary);
  text-decoration: none;
  margin-bottom: 20px;
}
.back-link:hover {
  color: var(--app-text);
  text-decoration: none;
}


/* ==========================================================================
   Auth Screen (login, etc.)
   ========================================================================== */

.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--app-content-bg);
}

.auth-card {
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  padding: 32px;
  width: 100%;
  max-width: 400px;
}

.auth-card__title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
}

.auth-card__subtitle {
  font-size: 13px;
  color: var(--app-text-meta);
  margin-bottom: 24px;
}

.auth-card__submit {
  width: 100%;
  justify-content: center;
}

.auth-card__alt {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
}
.auth-card__alt a {
  color: var(--app-text-meta);
  text-decoration: none;
}
.auth-card__alt a:hover {
  color: var(--app-text);
  text-decoration: underline;
}


/* ==========================================================================
   Full-width Layout (no sidebar)
   ========================================================================== */

.app-body--full .app-sidebar {
  display: none !important;
}
.app-body--full .sidebar-toggle {
  display: none !important;
}
.app-body--full .app-main__inner {
  max-width: 1100px;
}


/* ==========================================================================
   Status Page: Service Grid
   ========================================================================== */

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .service-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ==========================================================================
   Listing Page: Stacked full-width list
   ========================================================================== */

.listing-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.listing-item {
  display: block;
  width: 100%;
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  padding: 16px;
}


/* ==========================================================================
   Status Page: Service Cards
   ========================================================================== */

.service-card {
  background: var(--app-card-bg);
  border: 1px solid var(--app-card-border);
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

.service-card__header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--app-card-border);
}

.service-card__body {
  padding: 16px;
  border-bottom: 1px solid var(--app-card-border);
}

.service-card__name {
  font-size: 15px;
  font-weight: 600;
}

.service-card__desc {
  font-size: 12px;
  color: var(--app-text-meta);
  margin-top: 4px;
  line-height: 1.4;
}

/* Service status indicator */
.service-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03rem;
  white-space: nowrap;
  padding: 4px 12px;
}

.service-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.service-status--operational { color: #065f46; }
.service-status--operational .service-status__dot { background: #10b981; }

.service-status--degraded { color: #92400e; }
.service-status--degraded .service-status__dot { background: #f59e0b; }

.service-status--outage { color: #991b1b; }
.service-status--outage .service-status__dot { background: #ef4444; }

.service-status--maintenance { color: #1e40af; }
.service-status--maintenance .service-status__dot { background: #3b82f6; }


/* ==========================================================================
   Status Page: Bulletins
   ========================================================================== */

.bulletin {
  border-bottom: 1px solid var(--app-card-border);
}
.bulletin:last-child {
  border-bottom: none;
}

.bulletin__toggle {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  transition: background 0.15s ease;
  position: relative;
}
.bulletin__toggle:hover {
  background: rgba(0, 0, 0, 0.015);
}

.bulletin__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

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

.bulletin__severity {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04rem;
  text-transform: uppercase;
  padding: 2px 8px;
  margin-right: 8px;
  flex-shrink: 0;
}

.bulletin__severity--info        { background: var(--status-progress-bg); color: var(--status-progress-text); }
.bulletin__severity--warning     { background: var(--status-open-bg);     color: var(--status-open-text); }
.bulletin__severity--critical    { background: #fee2e2;                   color: #991b1b; }
.bulletin__severity--resolved    { background: var(--status-resolved-bg); color: var(--status-resolved-text); }

.bulletin__date {
  font-size: 12px;
  color: var(--app-icon-muted);
  white-space: nowrap;
}

.bulletin__preview {
  font-size: 13px;
  color: var(--app-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
}

.bulletin__chevron {
  position: absolute;
  right: 16px;
  top: 16px;
  color: var(--app-icon-muted);
  transition: transform 0.2s ease;
}

.bulletin__content {
  display: none;
  padding: 0 16px 16px;
}

.bulletin__block {
  font-size: 14px;
  line-height: 1.6;
  color: var(--app-text-secondary);
  margin-bottom: 12px;
}
.bulletin__block p {
  margin: 0 0 8px;
}
.bulletin__block p:last-child {
  margin-bottom: 0;
}

.bulletin__update {
  padding: 10px 14px;
  border-left: 3px solid var(--app-card-border);
  margin-bottom: 12px;
}
.bulletin__update:last-child {
  margin-bottom: 0;
}

.bulletin__timestamp {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--app-text);
  margin-bottom: 4px;
}

.bulletin__update-text {
  font-size: 13px;
  color: var(--app-text-secondary);
  line-height: 1.5;
}
.bulletin__update-text p {
  margin: 0 0 4px;
}
.bulletin__update-text p:last-child {
  margin-bottom: 0;
}

/* Expanded state */
.bulletin.expanded .bulletin__preview {
  display: none;
}
.bulletin.expanded .bulletin__content {
  display: block;
}
.bulletin.expanded .bulletin__chevron {
  transform: rotate(180deg);
}


/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
  .app-main__inner {
    padding: 16px 12px;
    padding-bottom: 80px;
  }

  .form-card {
    padding: 16px;
  }

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

  .btn-primary,
  .btn-secondary {
    justify-content: center;
  }
}


/* ==========================================================================
   Runbook body
   Semantic-first: a single `.runbook-body` scope styles its child elements
   directly. New block types render to a plain HTML element (h2, pre, aside,
   section, figure) and inherit these defaults without per-block classes.
   ========================================================================== */

.runbook-body {
  max-width: 760px;
  margin: 24px 0;
  counter-reset: runbook-step;
}

.runbook-body > h2 {
  margin: 28px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--app-card-border);
  font-size: 18px;
  font-weight: 600;
}

.runbook-body > h2:first-child {
  margin-top: 0;
}

.runbook-body > p,
.runbook-body > ul,
.runbook-body > ol {
  margin: 8px 0;
  line-height: 1.6;
}

.runbook-body > ul,
.runbook-body > ol {
  padding-left: 24px;
}

.runbook-body a {
  color: var(--app-link);
}

.runbook-body > pre {
  background: var(--app-chrome-bg);
  border: 1px solid var(--app-card-border);
  padding: 12px 14px;
  margin: 12px 0;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.runbook-body > pre[data-language]:not([data-language=""])::before {
  content: attr(data-language);
  display: block;
  font-size: 11px;
  color: var(--app-text-meta);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.runbook-body > aside {
  border-left: 4px solid var(--app-icon-muted);
  background: var(--app-card-bg);
  padding: 10px 14px;
  margin: 16px 0;
}

.runbook-body > aside[data-level="info"] {
  border-color: var(--app-link);
  background: var(--status-progress-bg);
  color: var(--status-progress-text);
}

.runbook-body > aside[data-level="warning"] {
  border-color: var(--status-open-text);
  background: var(--status-open-bg);
  color: var(--status-open-text);
}

.runbook-body > aside[data-level="danger"] {
  border-color: var(--error-text);
  background: #fee2e2;
  color: var(--error-text);
}

.runbook-body > section {
  counter-increment: runbook-step;
  border: 1px solid var(--app-card-border);
  background: var(--app-card-bg);
  padding: 14px 16px 14px 48px;
  margin: 12px 0;
  position: relative;
}

.runbook-body > section::before {
  content: counter(runbook-step);
  position: absolute;
  top: 14px;
  left: 12px;
  width: 26px;
  height: 26px;
  background: var(--app-btn-primary);
  color: var(--app-on-btn-primary);
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.runbook-body > section h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.runbook-body > figure {
  margin: 16px 0;
}

.runbook-body > figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--app-card-border);
}

.runbook-body > figure figcaption {
  margin-top: 4px;
  font-size: 12px;
  color: var(--app-text-meta);
}
