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

:root {
  --dark: #1a1a2e;
  --sidebar: #16213e;
  --accent: #0f3460;
  --accent-soft: #dfe8f4;
  --cta: #e94560;
  --bg: #f3f5f9;
  --panel-soft: #f7f9fc;
  --white: #ffffff;
  --text: #2f3441;
  --text-light: #697386;
  --border: #d8e0ea;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #c0392b;
  --shadow: 0 16px 40px rgba(15, 52, 96, 0.08);
  --radius: 16px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  min-height: 100vh;
}

body.admin-shell {
  background: #0f1727;
}

.admin-app {
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(77, 110, 173, 0.22), transparent 24%),
    linear-gradient(180deg, #eef2f8 0%, #f7f9fc 30%, #ffffff 100%);
}

.admin-mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 16px;
  background: rgba(15, 23, 39, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
}

.admin-mobile-brand {
  min-width: 0;
  flex: 1;
  text-decoration: none;
  color: var(--white);
}

.admin-mobile-brand span {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.admin-mobile-brand small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
}

.admin-mobile-topbar .menu-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: min(292px, calc(100vw - 24px));
  padding: 28px 20px 24px;
  background: linear-gradient(180deg, #101726 0%, #16213e 55%, #0f1727 100%);
  color: var(--white);
  box-shadow: 0 28px 64px rgba(7, 12, 24, 0.46);
  transform: translateX(-105%);
  transition: transform 0.24s ease;
}

body.menu-open .admin-sidebar {
  transform: translateX(0);
}

.admin-sidebar-brand {
  display: block;
  padding: 0 12px 24px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
  text-decoration: none;
}

.admin-sidebar-brand strong {
  display: block;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.admin-sidebar-brand span {
  display: block;
  margin-top: 4px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.admin-sidebar-brand small {
  display: block;
  margin-top: 16px;
  font-size: 0.82rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.68);
}

.admin-sidebar-section {
  padding: 0 12px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
}

.admin-sidebar-nav {
  display: grid;
  gap: 8px;
}

.admin-sidebar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 13px 16px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.admin-sidebar-nav a:hover,
.admin-sidebar-nav a.active {
  color: var(--white);
  transform: translateX(2px);
}

.admin-sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.admin-sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(233, 69, 96, 0.2), rgba(255, 255, 255, 0.09));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.admin-sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 999px;
  background: var(--cta);
}

.admin-sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding: 22px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-footer p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.7);
}

.admin-mobile-topbar .btn-secondary,
.admin-sidebar .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.16);
}

.admin-mobile-topbar .btn-secondary:hover,
.admin-sidebar .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.admin-content {
  min-height: 100vh;
  padding: 24px 16px 40px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
}

.mobile-topbar {
  position: sticky;
  top: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 16px;
  background: rgba(243, 245, 249, 0.96);
  border-bottom: 1px solid rgba(216, 224, 234, 0.9);
  backdrop-filter: blur(14px);
}

.mobile-brand {
  min-width: 0;
  flex: 1;
  text-decoration: none;
}

.mobile-brand span,
.sidebar-logo span {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.mobile-brand span {
  color: var(--accent);
}

.mobile-brand small,
.sidebar-logo small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.mobile-brand small {
  color: var(--text-light);
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--accent);
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

body.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

body.menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 96;
  border: 0;
  background: rgba(22, 33, 62, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

body.menu-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: min(280px, calc(100vw - 24px));
  padding: 24px 0;
  background: var(--sidebar);
  color: var(--white);
  box-shadow: 0 20px 40px rgba(10, 18, 33, 0.35);
  transform: translateX(-105%);
  transition: transform 0.2s ease;
}

body.menu-open .sidebar {
  transform: translateX(0);
}

.sidebar-logo {
  padding: 0 24px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 16px;
}

.sidebar-logo small {
  color: rgba(255, 255, 255, 0.7);
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 24px;
  color: rgba(255, 255, 255, 0.76);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav a.active {
  border-left: 3px solid var(--cta);
}

.sidebar-nav a.logout {
  margin-top: auto;
  color: #ffd3db;
}

.content {
  width: 100%;
  min-width: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  padding-bottom: 40px;
}

.content,
.content * {
  min-width: 0;
}

.page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2rem);
  line-height: 1.15;
  color: var(--dark);
}

.page-subtitle {
  margin-top: 8px;
  color: var(--text-light);
  overflow-wrap: anywhere;
}

.header-actions,
.filters-actions,
.section-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.section-card,
.form-card,
.filters-card {
  background: var(--white);
  border: 1px solid rgba(216, 224, 234, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-card,
.form-card {
  padding: 20px;
  margin-bottom: 24px;
}

.filters-card {
  padding: 18px;
  margin-bottom: 24px;
}

.form-card h2,
.section-card h2 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  font-size: 1rem;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
}

.section-card-header {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-card-header h2,
.detail-card-header h2,
.detail-card-header h3 {
  margin: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.stats-grid,
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(216, 224, 234, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(233, 69, 96, 0.8) 100%);
  opacity: 0.3;
}

.stat-card .label {
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.stat-card .value {
  font-size: clamp(1.7rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--dark);
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(216, 224, 234, 0.9);
  border-radius: 14px;
  background: var(--white);
  -webkit-overflow-scrolling: touch;
}

.form-card .table-wrap,
.section-card .table-wrap {
  box-shadow: none;
}

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

.table-wrap table {
  min-width: 640px;
}

.btw-grid .table-wrap table {
  min-width: 420px;
}

th,
td {
  padding: 14px 16px;
  vertical-align: top;
}

th {
  background: #f5f8fc;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--text-light);
  white-space: nowrap;
}

td {
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

tbody tr:hover {
  background: #f9fbfe;
}

tfoot td {
  background: #fafbfd;
}

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

.table-link:hover {
  text-decoration: underline;
}

.actions-cell {
  white-space: nowrap;
}

.actions-cell .btn {
  margin-right: 8px;
  margin-bottom: 8px;
}

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

.empty-cell {
  text-align: center;
  color: var(--text-light);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-draft {
  background: #eceff4;
  color: #5b6474;
}

.badge-issued {
  background: #e6f0ff;
  color: #225ea8;
}

.badge-paid {
  background: #e8f7ee;
  color: #1f7a45;
}

.badge-overdue {
  background: #fdebec;
  color: #b02a37;
}

.badge-cancelled,
.badge-credited {
  background: #f1f3f6;
  color: #666f80;
}

.btn,
.remove-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

.btn-primary:hover {
  background: #d63a52;
}

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

.btn-secondary:hover {
  background: var(--panel-soft);
}

.btn-danger {
  background: #fdebec;
  color: var(--danger);
  border-color: #f3c3c8;
}

.btn-danger:hover {
  background: #f9dce0;
}

.btn-sm {
  min-height: 44px;
  padding: 10px 14px;
  font-size: 0.88rem;
}

.topbar-logout {
  white-space: nowrap;
}

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

.field-group {
  margin-bottom: 18px;
}

.form-group label,
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea,
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group textarea,
.field-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.12);
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: #8b96a8;
}

.input-uppercase {
  text-transform: uppercase;
}

.form-row,
.form-grid,
.filters-grid,
.detail-grid,
.btw-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.detail-list {
  display: grid;
  gap: 14px;
}

.detail-list div {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.detail-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.detail-list dt {
  margin-bottom: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.inline-form {
  margin-top: 20px;
}

.credit-item-selector {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--dark);
}

.credit-item-selector input {
  margin: 0;
}

.credit-form-hint {
  margin: 16px 0 0;
}

.notes-block {
  margin-top: 24px;
  padding: 18px;
  border-radius: 14px;
  background: var(--panel-soft);
}

.notes-block h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--dark);
}

.notes-block pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
}

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

.logo-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 260px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
}

.logo-preview img {
  max-height: 120px;
  width: auto;
}

.alert {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
}

.alert-error {
  background: #fdebec;
  color: #9c1f2c;
  border-color: #f3c3c8;
}

.alert-success {
  background: #e8f7ee;
  color: #1f7a45;
  border-color: #bfe2cb;
}

.alert strong {
  display: block;
  margin-bottom: 4px;
}

.alert-copy {
  overflow-wrap: anywhere;
}

.page-eyebrow {
  margin: 0 0 10px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 52, 96, 0.08);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-hero {
  display: grid;
  gap: 20px;
  padding: 24px;
  margin-bottom: 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(233, 69, 96, 0.28), transparent 30%),
    linear-gradient(135deg, #0f3460 0%, #1a1a2e 100%);
  color: var(--white);
  box-shadow: 0 28px 56px rgba(12, 22, 39, 0.2);
}

.admin-hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.45rem);
  line-height: 1.05;
  color: var(--white);
}

.admin-hero p {
  margin: 0;
  max-width: 48rem;
  color: rgba(255, 255, 255, 0.78);
}

.admin-hero .page-kicker {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.94);
}

.admin-hero-actions,
.form-actions,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-hero .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.16);
}

.admin-hero .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.stats-grid.admin-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 24px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.admin-grid > .section-card,
.admin-grid > .form-card,
.admin-detail-grid > .section-card,
.admin-detail-grid > .form-card {
  margin-bottom: 0;
}

.admin-panel {
  height: 100%;
}

.admin-panel p {
  margin-top: 0;
}

.admin-panel-grid {
  display: grid;
  gap: 14px;
}

.admin-panel-grid form {
  margin: 0;
}

.admin-panel-grid .btn {
  width: 100%;
}

.admin-summary-list {
  display: grid;
  gap: 14px;
}

.admin-summary-item {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--panel-soft);
  border: 1px solid rgba(216, 224, 234, 0.9);
}

.admin-summary-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--dark);
}

.admin-summary-item p {
  margin: 0;
  color: var(--text-light);
}

.admin-quick-links {
  display: grid;
  gap: 12px;
}

.admin-quick-link {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid rgba(216, 224, 234, 0.95);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.admin-quick-link:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 52, 96, 0.16);
  box-shadow: 0 16px 32px rgba(15, 52, 96, 0.08);
}

.admin-quick-link strong {
  color: var(--dark);
}

.admin-quick-link span {
  color: var(--text-light);
}

.admin-inline-stat {
  display: inline-grid;
  gap: 4px;
  min-width: 132px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--white);
  border: 1px solid rgba(216, 224, 234, 0.9);
  box-shadow: var(--shadow);
}

.admin-inline-stat span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
}

.admin-inline-stat strong {
  font-size: 1.45rem;
  line-height: 1;
  color: var(--dark);
}

.section-copy {
  margin: 0 0 18px;
  color: var(--text-light);
}

.section-card-header .section-copy,
.detail-card-header .section-copy {
  margin-bottom: 0;
}

.stacked-copy {
  display: grid;
  gap: 4px;
}

.stacked-copy strong {
  color: var(--dark);
}

.stacked-copy span,
.stacked-copy small {
  color: var(--text-light);
}

.table-actions {
  gap: 8px;
}

.table-actions form {
  margin: 0;
}

.table-actions .btn {
  min-height: 40px;
  margin: 0;
}

.table-actions .btn-sm,
.btn-small {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.detail-card {
  display: grid;
  gap: 18px;
}

.detail-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.detail-card-header p {
  margin: 6px 0 0;
  color: var(--text-light);
}

.detail-list.grid-2 {
  grid-template-columns: 1fr;
}

.surface-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(216, 224, 234, 0.9);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-login-page {
  background:
    radial-gradient(circle at top, rgba(233, 69, 96, 0.18), transparent 24%),
    radial-gradient(circle at bottom left, rgba(36, 74, 120, 0.18), transparent 30%),
    linear-gradient(180deg, #101726 0%, #16213e 52%, #0f1727 100%);
}

.admin-login-card {
  width: 100%;
  max-width: 430px;
  padding: 34px 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 60px rgba(6, 13, 24, 0.36);
}

.admin-login-card h1 {
  margin: 12px 0 10px;
  font-size: 2rem;
  letter-spacing: -0.03em;
  color: var(--dark);
}

.admin-login-card p {
  margin: 0 0 24px;
  color: var(--text-light);
}

.admin-login-card .btn-primary {
  width: 100%;
}

.alert-list {
  margin: 0;
  padding-left: 20px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  text-decoration: none;
}

.pagination a.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.inline-feedback {
  margin-bottom: 24px;
}

.saved-services-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.saved-services-search {
  flex: 1 1 260px;
  margin-bottom: 0;
}

.saved-services-help {
  margin-top: 0;
}

.saved-services-grid {
  display: grid;
  gap: 12px;
}

.saved-service-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
}

.saved-service-pick,
.saved-service-delete,
.save-service-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.saved-service-pick {
  display: grid;
  gap: 4px;
  color: var(--text);
}

.saved-service-pick strong {
  color: var(--dark);
}

.saved-service-pick span,
.saved-service-pick small {
  color: var(--text-light);
}

.saved-service-delete,
.save-service-link {
  color: var(--accent);
  font-weight: 600;
}

.saved-service-delete:hover,
.save-service-link:hover {
  text-decoration: underline;
}

.line-items {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.line-item {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-soft);
}

.line-item .form-group {
  margin-bottom: 0;
}

.line-item input,
.line-item select {
  min-height: 44px;
}

.line-item-actions {
  display: grid;
  gap: 8px;
  align-items: center;
}

.remove-line {
  justify-self: flex-start;
  background: transparent;
  color: var(--cta);
  border-color: rgba(233, 69, 96, 0.22);
}

.remove-line:hover {
  background: rgba(233, 69, 96, 0.08);
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(circle at top, #244a78 0%, #16213e 52%, #101726 100%);
}

.login-box {
  width: 100%;
  max-width: 420px;
  padding: 32px 24px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: 0 24px 48px rgba(9, 17, 30, 0.28);
}

.login-box h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
  color: var(--dark);
}

.login-box p {
  margin: 0 0 24px;
  color: var(--text-light);
}

.login-box .btn-primary {
  width: 100%;
}

@media (min-width: 640px) {
  .admin-content {
    padding: 32px 24px 48px;
  }

  .content {
    padding: 24px;
    padding-bottom: 48px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-list.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
  }
}

@media (min-width: 768px) {
  body.menu-open {
    overflow: auto;
  }

  .mobile-topbar,
  .sidebar-backdrop {
    display: none;
  }

  .sidebar {
    width: 240px;
    transform: translateX(0);
  }

  .content {
    margin-left: 240px;
    padding: 32px;
  }

  .page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
  }

  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .btw-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .line-item {
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto;
    align-items: end;
  }

  .header-actions .btn,
  .filters-actions .btn {
    flex: 0 0 auto;
  }
}

@media (min-width: 992px) {
  .admin-mobile-topbar,
  .admin-sidebar-backdrop {
    display: none;
  }

  .admin-sidebar {
    width: 292px;
    transform: translateX(0);
  }

  .admin-content {
    margin-left: 292px;
    padding: 40px 48px 56px;
    border-radius: 28px 0 0 0;
  }

  .admin-hero {
    grid-template-columns: minmax(0, 1.5fr) auto;
    align-items: end;
  }

  .admin-detail-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.95fr);
  }

  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}
