/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #f8f9fa;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-border: #e5e7eb;
  --color-danger: #ef4444;
  --sidebar-width: 240px;
  --sidebar-collapsed-width: 56px;
  --transition-speed: 200ms;
}

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

a { color: inherit; text-decoration: none; }

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

.flash {
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  animation: flash-in 0.3s ease;
}

.flash--notice { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash--alert { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Impersonation Banner === */
.impersonation-banner {
  background: #fbbf24;
  color: #1a1a2e;
  text-align: center;
  padding: 6px 16px;
  font-size: 13px;
}

.impersonation-banner__stop {
  background: none;
  border: 1px solid #1a1a2e;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 12px;
}

/* === App Layout === */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-speed) ease;
  overflow: hidden;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar[data-collapsed="true"] {
  width: var(--sidebar-collapsed-width);
}

.sidebar[data-collapsed="true"] .sidebar__label {
  opacity: 0;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.sidebar[data-collapsed="true"] .sidebar__section-title {
  height: 1px;
  margin: 8px 12px;
  padding: 0;
  background: var(--color-border);
  overflow: hidden;
}

.sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  gap: 8px;
}

.sidebar__logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-primary);
  white-space: nowrap;
  transition: opacity var(--transition-speed) ease;
}

.sidebar[data-collapsed="true"] .sidebar__logo {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar__toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.sidebar__nav {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--color-text-muted);
  transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
  white-space: nowrap;
}

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

.sidebar__link--active {
  background: #eef2ff;
  color: var(--color-primary);
  font-weight: 500;
}

.sidebar__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar__label {
  transition: opacity var(--transition-speed) ease;
}

.sidebar__section-title {
  padding: 8px 8px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.sidebar__footer {
  padding: 12px 8px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
}

.sidebar__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.sidebar__avatar--placeholder {
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.sidebar__user-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__link--sign-out { color: var(--color-danger); }
.sidebar__link--sign-out:hover { background: #fef2f2; }

/* === Main Content === */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  transition: margin-left var(--transition-speed) ease;
  min-height: 100vh;
}

.sidebar[data-collapsed="true"] ~ .main-content {
  margin-left: var(--sidebar-collapsed-width);
}

/* === Landing Page === */
.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

.landing__container { max-width: 400px; }

.landing__title {
  font-size: 48px;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.landing__subtitle {
  font-size: 18px;
  color: var(--color-text-muted);
  margin-bottom: 32px;
}

.landing__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.landing__or {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 150ms ease;
  text-decoration: none;
}

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

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

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

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

.btn--google {
  background: #4285f4;
  color: white;
  width: 100%;
}

.btn--google:hover { background: #3367d6; }

.btn--small {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 6px;
}

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

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

/* === Dashboard === */
.dashboard__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.dashboard__welcome {
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.dashboard__cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.dashboard__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.dashboard__card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.1);
}

.dashboard__card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.dashboard__card-desc {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* === Brief Form === */
.brief-page__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.brief-page__subtitle {
  color: var(--color-text-muted);
  font-size: 15px;
  margin-bottom: 24px;
}

.brief-form {
  max-width: 720px;
}

.brief-form__errors {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
}

.brief-form__errors ul { margin-top: 6px; padding-left: 18px; }
.brief-form__errors li { margin-bottom: 2px; }

.brief-form__section {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 20px;
  background: var(--color-surface);
}

.brief-form__legend {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  padding: 0 8px;
}

.brief-form .field {
  margin-bottom: 16px;
}

.brief-form .field:last-child {
  margin-bottom: 0;
}

.brief-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--color-text);
}

.brief-form input[type="text"],
.brief-form input[type="email"],
.brief-form input[type="date"],
.brief-form textarea,
.brief-form select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 150ms ease;
  background: white;
}

.brief-form input:focus,
.brief-form textarea:focus,
.brief-form select:focus {
  border-color: var(--color-primary);
}

.brief-form textarea {
  resize: vertical;
  min-height: 60px;
}

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

/* Deliverable rows */
.brief-form__deliverable-row {
  margin-bottom: 8px;
}
.brief-form__deliverable-fields {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.brief-form__deliverable-field--desc { flex: 2; }
.brief-form__deliverable-field--resp { flex: 1; }
.brief-form__deliverable-field--date { flex: 0 0 160px; }
.brief-form__deliverable-fields .field { margin-bottom: 0; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 20px; line-height: 1; padding: 6px 8px; border-radius: 4px; color: var(--color-text-muted); }
.btn-icon:hover { background: var(--color-bg); }
.btn-icon--danger:hover { color: var(--color-danger); }
.btn--sm { font-size: 13px; padding: 6px 12px; }

.brief-form__checkboxes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.brief-form__checkbox,
.brief-form__radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.brief-form__checkbox input,
.brief-form__radio input {
  width: auto;
  margin: 0;
  accent-color: var(--color-primary);
}

.brief-form__radios {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.brief-form__urgency {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.brief-form__urgency-label {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.brief-form__urgency-option {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  cursor: pointer;
}

.brief-form__urgency-option input {
  width: auto;
  margin: 0;
  accent-color: var(--color-primary);
}

.brief-form__file {
  margin-top: 4px;
}

.brief-form__hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.brief-form__attached {
  font-size: 13px;
  color: var(--color-primary);
  margin-top: 4px;
}

.brief-form__actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

/* === Brief Show === */
.brief-show__status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.brief-show__status-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brief-show__status-form select {
  padding: 4px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  background: white;
}

.brief-show__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.brief-show__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 20px;
}

.brief-show__card--full { grid-column: 1 / -1; }
.brief-show__card h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.brief-show__dl {
  display: grid;
  gap: 12px;
}

.brief-show__dl dt {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.brief-show__dl dd {
  font-size: 14px;
  line-height: 1.5;
}

.brief-show__dl dd p { margin: 0; }

.brief-show__download {
  color: var(--color-primary) !important;
  font-weight: 500;
}

.brief-show__download:hover { text-decoration: underline; }

/* Brief status badges */
.admin-badge--submitted { background: #dbeafe; color: #1d4ed8; }
.admin-badge--in_review { background: #fef3c7; color: #92400e; }
.admin-badge--approved { background: #ecfdf5; color: #065f46; }
.admin-badge--rejected { background: #fef2f2; color: #991b1b; }
.admin-badge--draft { background: var(--color-bg); color: var(--color-text-muted); }

/* Urgency badges */
.admin-badge--urgency-1, .admin-badge--urgency-2 { background: #ecfdf5; color: #065f46; }
.admin-badge--urgency-3 { background: #fef3c7; color: #92400e; }
.admin-badge--urgency-4, .admin-badge--urgency-5 { background: #fef2f2; color: #991b1b; }

/* === AI Features === */
.btn--ai {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: white;
  display: inline-flex;
  align-items: center;
}

.btn--ai:hover { background: linear-gradient(135deg, #6d28d9, #4338ca); }

.ai-generated-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #ede9fe, #e0e7ff);
  color: #4f46e5;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 20px;
}

.ai-input {
  max-width: 720px;
}

.ai-input__tabs {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
}

.ai-input__tab {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 150ms ease;
}

.ai-input__tab--active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.ai-input__tab:hover { color: var(--color-text); }

.ai-input__form { margin-top: 16px; }

.ai-input__label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.ai-input__textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 150ms ease;
}

.ai-input__textarea:focus { border-color: var(--color-primary); }

.ai-input__actions {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* AI Full-screen overlay */
.ai-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.ai-overlay--open { display: flex; }

.ai-overlay__card {
  background: var(--color-surface);
  border-radius: 16px;
  padding: 40px 48px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: modal-in 0.2s ease;
}

.ai-overlay__spinner-ring {
  width: 48px;
  height: 48px;
  border: 4px solid var(--color-border);
  border-top-color: #7c3aed;
  border-right-color: #4f46e5;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.ai-overlay__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-overlay__current {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 20px;
  min-height: 22px;
  transition: opacity 0.15s ease;
}

.ai-overlay__stages {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.ai-overlay__stage {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.ai-overlay__stage--active {
  color: var(--color-primary);
  font-weight: 500;
}

.ai-overlay__stage--done {
  color: #059669;
}

.ai-overlay__stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.ai-overlay__stage--active .ai-overlay__stage-dot {
  background: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  animation: pulse-dot 1.5s ease infinite;
}

.ai-overlay__stage--done .ai-overlay__stage-dot {
  background: #059669;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.1); }
}

.ai-overlay__hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
}

/* AI Assist button on fields */
.field__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.field__header label { margin-bottom: 0; }

.btn-ai-assist {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: white;
  border: none;
  padding: 2px 10px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.btn-ai-assist:hover { opacity: 0.85; }
.btn-ai-assist:disabled { opacity: 0.5; cursor: wait; }

.brief-page__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.brief-page__header .brief-page__title { margin-bottom: 4px; }
.brief-page__header .brief-page__subtitle { margin-bottom: 0; }

/* === Sharing Panel === */
.sharing-panel__form {
  margin-bottom: 16px;
}

.sharing-panel__row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sharing-panel__input {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.sharing-panel__input:focus {
  border-color: var(--color-primary);
}

.sharing-panel__select {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  background: white;
}

.sharing-panel__table {
  margin-top: 12px;
}

.sharing-panel__inline-form {
  display: inline;
}

/* === Tool Page === */
.tool-page__title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

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

/* === Devise Forms === */
.devise-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.devise-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 400px;
}

.devise-form h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
}

.devise-form .field {
  margin-bottom: 16px;
}

.devise-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--color-text-muted);
}

.devise-form input[type="email"],
.devise-form input[type="password"],
.devise-form input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 150ms ease;
}

.devise-form input:focus {
  border-color: var(--color-primary);
}

.devise-form .actions {
  margin-top: 20px;
}

.devise-form .actions input[type="submit"] {
  width: 100%;
  padding: 10px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.devise-form .actions input[type="submit"]:hover {
  background: var(--color-primary-hover);
}

.devise-links {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  text-align: center;
}

.devise-links a {
  color: var(--color-primary);
}

.devise-links a:hover {
  text-decoration: underline;
}

/* === Admin === */
.admin-invitations__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-invitations__title {
  font-size: 24px;
  font-weight: 700;
}

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 10px 16px;
  text-align: left;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
}

.admin-table th {
  background: var(--color-bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}

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

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.admin-badge--accepted, .admin-badge--online { background: #ecfdf5; color: #065f46; }
.admin-badge--pending { background: #fef3c7; color: #92400e; }
.admin-badge--admin { background: #eef2ff; color: var(--color-primary); }
.admin-badge--user { background: var(--color-bg); color: var(--color-text-muted); }
.admin-badge--external { background: #fef2f2; color: #991b1b; }
.admin-badge--offline { background: var(--color-bg); color: var(--color-text-muted); }
.admin-badge--deactivated { background: #fef2f2; color: #991b1b; }

.admin-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  max-width: 480px;
  margin-top: 20px;
}

.admin-form .field {
  margin-bottom: 16px;
}

.admin-form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--color-text-muted);
}

.admin-form input[type="email"],
.admin-form input[type="text"],
.admin-form__select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 150ms ease;
  background: white;
}

.admin-form input:focus,
.admin-form__select:focus {
  border-color: var(--color-primary);
}

.admin-form .actions {
  margin-top: 20px;
  display: flex;
  gap: 8px;
}

.admin-table__user-link { display: block; }
.admin-table__user-link:hover strong { color: var(--color-primary); }

.admin-table__nowrap { white-space: nowrap; }

.admin-table__path {
  font-size: 13px;
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.user-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.user-stats__item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 20px;
  min-width: 140px;
}

.user-stats__label {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 4px;
}

.user-stats__value {
  font-size: 18px;
  font-weight: 700;
}

/* === Modal === */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal--open { display: flex; }

.modal__content {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 28px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  animation: modal-in 0.15s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.modal__body {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal__body strong { color: var(--color-text); }

.modal__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* === Responsive === */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }

  .sidebar .sidebar__label {
    opacity: 0;
    width: 0;
  }

  .main-content {
    margin-left: var(--sidebar-collapsed-width);
    padding: 20px;
  }
}
