/*
 * admin.css — Shared REVO admin panel styles
 * @rdl:admin-css
 *
 * Loaded by:
 *   - app/templates/admin/base.html  (all inner admin pages)
 *   - app/templates/admin/login.html
 *   - app/templates/admin/login_totp.html
 *   - app/templates/admin/totp_setup.html
 *
 * Design tokens, shared components, and responsive rules.
 * Page-specific styles remain in {% block extra_styles %} per page.
 */


/* ── Design tokens ─────────────────────────────────────────────────────────── */
:root {
  --a-red:        #BE1522;
  --a-red-dk:     #a01020;
  --a-nav-bg:     #1a1a1a;
  --a-body-bg:    #f4f6f8;
  --a-surface:    #ffffff;
  --a-border:     #e2e6ea;
  --a-text:       #1e2328;
  --a-muted:      #6b7280;
  --a-focus-ring: rgba(190, 21, 34, 0.22);
}


/* ── Skip link (accessibility) ─────────────────────────────────────────────── */
.revo-skip-link {
  position: absolute;
  top: -48px;
  left: 0;
  background: var(--a-red);
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 9999;
  border-radius: 0 0 4px 0;
  transition: top 0.1s;
}
.revo-skip-link:focus { top: 0; }


/* ── Global focus rings ────────────────────────────────────────────────────── */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--a-focus-ring);
  outline-offset: 2px;
}


/* ── Auth pages — shared card layout ───────────────────────────────────────── */

.revo-auth-body {
  font-family: 'Lato', sans-serif;
  background: var(--a-body-bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.revo-auth-card {
  background: var(--a-surface);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
  padding: 2.5rem 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}
.revo-auth-card--wide { max-width: 440px; }

.revo-auth-logo {
  display: block;
  height: 64px;
  width: auto;
  margin: 0 auto 1rem;
}

.revo-auth-rule {
  border: none;
  border-top: 1px solid var(--a-border);
  margin: 0 0 1.5rem;
}

.revo-auth-step-label {
  font-size: 0.72rem;
  color: var(--a-muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
  font-family: 'Lato', sans-serif;
}

.revo-auth-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--a-text);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  font-family: 'Lato', sans-serif;
}

.revo-auth-subtitle {
  font-size: 0.85rem;
  color: var(--a-muted);
  text-align: center;
  margin-bottom: 1.6rem;
  line-height: 1.5;
  font-family: 'Lato', sans-serif;
}

.revo-auth-footer {
  text-align: center;
  margin-top: 1.4rem;
  font-size: 0.78rem;
  color: var(--a-muted);
  font-family: 'Lato', sans-serif;
}
.revo-auth-footer a { color: var(--a-muted); text-decoration: none; }
.revo-auth-footer a:hover { color: var(--a-red); }


/* ── Form components ───────────────────────────────────────────────────────── */

.revo-field { margin-bottom: 1rem; }

.revo-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: 'Lato', sans-serif;
}

.revo-input,
.revo-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--a-text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  background: #fff;
}
.revo-input:focus,
.revo-select:focus {
  border-color: var(--a-red);
  box-shadow: 0 0 0 3px var(--a-focus-ring);
}

/* Large monospace code input (TOTP) */
.revo-input--code {
  font-size: 1.5rem;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 0.75rem 0.9rem;
}

.revo-field-hint {
  font-size: 0.75rem;
  color: var(--a-muted);
  margin-top: 0.25rem;
}

.revo-field-error {
  font-size: 0.75rem;
  color: #991b1b;
  margin-top: 0.2rem;
  display: none;
}
.revo-field-error.visible { display: block; }


/* ── Alert / error block ───────────────────────────────────────────────────── */
.revo-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  border-radius: 6px;
  padding: 0.65rem 0.9rem;
  font-size: 0.88rem;
  margin-bottom: 1rem;
  font-family: 'Lato', sans-serif;
}


/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn-revo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  background: var(--a-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Lato', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1;
}
.btn-revo:hover { background: var(--a-red-dk); color: #fff; }
.btn-revo:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-revo--full { width: 100%; }

/* Secondary: outlined ghost */
.btn-revo-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.35rem 0.9rem;
  background: transparent;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  line-height: 1.4;
}
.btn-revo-ghost:hover { background: #f3f4f6; border-color: #9ca3af; }
.btn-revo-ghost:disabled { opacity: 0.45; cursor: not-allowed; }

/* Destructive */
.btn-revo-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.35rem 0.9rem;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.12s;
  line-height: 1.4;
}
.btn-revo-danger:hover { background: #fee2e2; }


/* ── Role badges (nav bar) ─────────────────────────────────────────────────── */

.role-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 3px;
  padding: 2px 6px;
  margin-left: 5px;
  vertical-align: middle;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.role-badge--super     { background: #f59e0b; color: #000; }
.role-badge--inventory { background: #3b82f6; color: #fff; }
.role-badge--media     { background: #06b6d4; color: #000; }


/* ── Status / action badges (tables) ──────────────────────────────────────── */

.badge-revo {
  display: inline-block;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-revo--success  { background: #dcfce7; color: #15803d; }
.badge-revo--warning  { background: #fef3c7; color: #92400e; }
.badge-revo--danger   { background: #fee2e2; color: #991b1b; }
.badge-revo--info     { background: #dbeafe; color: #1d4ed8; }
.badge-revo--neutral  { background: #f3f4f6; color: #374151; }
.badge-revo--dark     { background: #e5e7eb; color: #111827; }


/* ── Revo table ────────────────────────────────────────────────────────────── */

.revo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.revo-table th {
  background: #111;
  color: #fff;
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.revo-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}
.revo-table tbody tr:nth-child(even) td { background: #f9fafb; }
.revo-table tbody tr:hover td { background: #f1f5f9; }
.revo-table tbody tr:nth-child(even):hover td { background: #f1f5f9; }


/* ── Card ──────────────────────────────────────────────────────────────────── */

.revo-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.revo-card__header {
  padding: 0.7rem 1.25rem;
  background: #f8f9fa;
  border-bottom: 1px solid var(--a-border);
  font-size: 0.78rem;
  font-weight: 700;
  color: #374151;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.revo-card__body { padding: 1.25rem; }


/* ── Flash / notification bar ──────────────────────────────────────────────── */

.revo-flash {
  display: none;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 600;
}
.revo-flash.ok   { display: block; background: #dcfce7; color: #15803d; }
.revo-flash.warn { display: block; background: #fef3c7; color: #92400e; }
.revo-flash.err  { display: block; background: #fee2e2; color: #b91c1c; }


/* ── Empty state ───────────────────────────────────────────────────────────── */

.revo-empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--a-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}
.revo-empty-state__icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}
.revo-empty-state__title {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 0.35rem;
}


/* ── TOTP setup — step list ────────────────────────────────────────────────── */

.revo-steps { list-style: none; padding: 0; margin: 0 0 0.5rem; }
.revo-step {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}
.revo-step__num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--a-red);
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.revo-step__body { flex: 1; font-size: 0.88rem; color: #444; line-height: 1.5; }
.revo-step__body p { margin-bottom: 0.5rem; }
.revo-step__body strong { color: var(--a-text); }

.revo-qr-wrap {
  text-align: center;
  margin: 0.5rem 0;
}
.revo-qr-wrap img {
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 6px;
  background: #fff;
  max-width: 180px;
}

.revo-manual-label {
  font-size: 0.75rem;
  color: #999;
  margin-bottom: 0.25rem;
}
.revo-manual-code {
  background: #f7f7f7;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  word-break: break-all;
  color: #333;
  margin-top: 0.5rem;
  cursor: text;
  user-select: all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.revo-copy-btn {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-family: inherit;
  cursor: pointer;
  color: #555;
  flex-shrink: 0;
  transition: background 0.12s;
}
.revo-copy-btn:hover { background: #f0f0f0; }

.revo-divider {
  border: none;
  border-top: 1px solid #eee;
  margin: 1.4rem 0;
}


/* ── Utility ───────────────────────────────────────────────────────────────── */
.mono { font-family: 'Courier New', monospace; font-size: 0.85em; }


/* ── Responsive ────────────────────────────────────────────────────────────── */

/* Table horizontal scroll wrapper for dense tables */
.revo-table-wrap { overflow-x: auto; }

@media (max-width: 640px) {
  .admin-nav__links {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .admin-nav__links::-webkit-scrollbar { display: none; }

  .admin-content {
    padding: 1rem 1rem 4rem;
    max-width: 100%;
  }

  .revo-auth-card {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .revo-auth-logo { height: 48px; }
}
