/* Admin console shell — sidebar layout, no marketing chrome. */

.admin-body {
  min-height: 100vh;
  display: block;
  background: #f3f4f6;
  color: var(--text);
}

.admin-body-login {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #e5e7eb 0%, transparent 50%),
    #f3f4f6;
}

.admin-login-wrap {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #111827;
  color: #f9fafb;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 18px;
}

.admin-brand a {
  color: #f9fafb;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-nav a {
  color: #d1d5db;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
}

.admin-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}

.admin-nav a.is-active {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

.admin-logout .btn-ghost {
  width: 100%;
  color: #d1d5db;
  border-color: #374151;
  background: transparent;
}

.admin-logout .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-left: auto;
}

.admin-role {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--text);
}

.admin-content {
  padding: 24px;
  max-width: 1280px;
  width: 100%;
  box-sizing: border-box;
}

.admin-content .card.form-card {
  overflow: hidden;
  max-width: 100%;
  padding: 18px 20px;
}
.admin-content .card.form-card > h1 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.admin-content .card.form-card > .muted:first-of-type {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
}

/* Unified page header + compact toolbars */
.admin-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 10px;
}
.admin-page-head h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.admin-page-head .lead {
  margin: 0;
  flex: 1 1 200px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}
.admin-page-head .head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.admin-page-head .head-actions .btn,
.admin-page-head .head-actions .btn-ghost,
.admin-page-head .head-actions .btn-primary {
  width: auto;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
  padding: 8px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.admin-toolbar > form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
}
.admin-toolbar input[type="text"],
.admin-toolbar input[type="search"],
.admin-toolbar input[type="password"],
.admin-toolbar select {
  height: 34px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  min-width: 0;
}
.admin-toolbar input[type="search"],
.admin-toolbar .grow {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 360px;
}
.admin-toolbar .btn,
.admin-toolbar .btn-ghost,
.admin-toolbar .btn-primary,
.admin-toolbar button.btn {
  width: auto !important;
  max-width: none;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}
.admin-toolbar .sep {
  width: 1px;
  align-self: stretch;
  min-height: 20px;
  background: var(--line);
  margin: 0 2px;
}
.admin-toolbar .toolbar-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.admin-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 10px;
}
.admin-filter-chips .label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 2px;
}

/* Marketing .btn-primary is width:100%; admin forms need compact buttons. */
.admin-content .btn-primary,
.admin-content button.btn-primary,
.admin-content a.btn-primary {
  width: auto;
  max-width: max-content;
  padding: 10px 18px;
  font-size: 14px;
}

/* Searchable model <select> enhancer (admin.js) → floating combo */
.model-search-combo {
  position: relative;
  width: 100%;
  min-width: min(100%, 280px);
}
.model-search-combo .model-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
}
.model-search-combo .model-search-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
select.model-search-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Sticky action column for admin tables */
.admin-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 100%;
}
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
.admin-table thead { background: var(--bg-soft); }
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--bg-soft); }
.admin-table code {
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 12px;
  border: 1px solid var(--line);
  word-break: break-all;
}
.admin-table th.col-actions,
.admin-table td.col-actions {
  position: sticky;
  right: 0;
  z-index: 2;
  white-space: nowrap;
  background: #fff;
  box-shadow: -8px 0 10px -8px rgba(15, 23, 42, 0.18);
}
.admin-table thead th.col-actions {
  background: var(--bg-soft);
  z-index: 3;
}
.admin-table tbody tr:hover td.col-actions { background: var(--bg-soft); }
.admin-table .row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px 10px;
  flex-wrap: nowrap;
}
.admin-table .row-actions form {
  display: inline;
  margin: 0;
}
.admin-table .row-actions .btn,
.admin-table .row-actions .btn-ghost {
  width: auto;
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
}

.admin-content .inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 12px 0 16px;
  position: relative;
  z-index: 1;
}

.admin-content .inline-form input,
.admin-content .inline-form select {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 220px;
  /* Keep single-line height even if a page sets flex-direction: column */
  flex-grow: 0;
  height: 38px;
  min-height: 38px;
  box-sizing: border-box;
}

.admin-content .inline-form .btn,
.admin-content .inline-form .btn-primary {
  flex: 0 0 auto;
  width: auto;
  align-self: flex-end;
}

.admin-menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}

@media (max-width: 800px) {
  .admin-shell {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    display: none;
  }
  .admin-shell.sidebar-open .admin-sidebar {
    display: flex;
  }
  .admin-menu-toggle {
    display: inline-flex;
  }
  .admin-content {
    padding: 16px;
  }
}


.admin-toolbar.is-split {
  justify-content: space-between;
  align-items: flex-start;
}
.admin-toolbar .toolbar-left,
.admin-toolbar .toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.admin-toolbar .toolbar-right {
  justify-content: flex-end;
}

.admin-modal {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 440px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  color: inherit;
}
.admin-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}
.admin-modal-body {
  padding: 20px 22px 22px;
}
