/*
 * Auth + admin styles. Layered on top of hub.css — reuses its design
 * tokens (--orange, --gray-*, --radius, ...) and its button / pill /
 * card primitives. Kept in a separate file so the tenant-facing shell
 * doesn't drag in admin chrome.
 */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.4;
    font-size: 14px;
}

a { color: var(--orange-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Centred auth shell (login, awaiting-approval, rejected, suspended) ── */

.auth-shell {
    /* hub.css sets `body { display: flex }` for the merchant sidebar
     * layout; without `flex: 1 1 auto; width: 100%;` this shell would
     * collapse to the card's intrinsic width and render pinned to the
     * left edge. */
    flex: 1 1 auto;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: var(--gray-50);
}

.auth-shell--dark { background: var(--gray-900); }

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.auth-brand {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
}

.auth-tagline {
    font-size: 13px;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 28px;
}

.auth-error {
    background: var(--red-bg);
    color: var(--red-text);
    border: 1px solid #F5B5B9;
    border-radius: var(--radius);
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-info {
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label { font-size: 12px; font-weight: 600; color: var(--gray-700); }
.auth-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13.5px;
    font-family: inherit;
    background: #fff;
    color: var(--gray-900);
    outline: none;
    transition: border-color 0.12s;
}
.auth-input:focus { border-color: var(--orange); }
.auth-submit {
    margin-top: 6px;
    padding: 10px 16px;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
    transition: background 0.12s;
}
.auth-submit:hover { background: var(--orange-dark); }

.auth-footer-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 12.5px;
    color: var(--gray-500);
}

/* ── Admin shell (topbar + content area, no merchant sidebar) ── */

.admin-app {
    /* See the `.auth-shell` comment — body is display:flex for the
     * merchant layout, so admin chrome needs to claim full viewport
     * width explicitly. */
    flex: 1 1 auto;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
}

.admin-topbar {
    background: var(--gray-900);
    color: #fff;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-topbar-left { display: flex; align-items: center; gap: 24px; }

.admin-brand {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}
.admin-brand:hover { text-decoration: none; color: #fff; }

.admin-nav { display: flex; gap: 16px; }
.admin-nav a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    text-decoration: none;
}
.admin-nav a:hover,
.admin-nav a.active {
    color: #fff;
    text-decoration: none;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.7);
}
.admin-topbar-right a { color: rgba(255, 255, 255, 0.85); text-decoration: none; }
.admin-topbar-right a:hover { color: #fff; text-decoration: underline; }

.admin-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px;
    width: 100%;
}

.admin-flash {
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}
.admin-flash--success {
    background: var(--green-bg);
    color: var(--green-text);
    border: 1px solid #B7E6C9;
}
.admin-flash--error {
    background: var(--red-bg);
    color: var(--red-text);
    border: 1px solid #F5B5B9;
}

.admin-h1 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }

/* ── Status tabs (pending / active / suspended / rejected / all) ── */

.admin-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-tab {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--gray-700);
    font-size: 12.5px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.1s;
}
.admin-tab:hover { background: var(--gray-100); text-decoration: none; }
.admin-tab.active {
    background: var(--gray-900);
    color: #fff;
    border-color: var(--gray-900);
}
.admin-tab-count {
    font-size: 11px;
    color: var(--gray-500);
}
.admin-tab.active .admin-tab-count { color: rgba(255, 255, 255, 0.8); }

/* ── Admin table (tenant list) ── */

.admin-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-empty {
    padding: 28px;
    color: var(--gray-500);
    text-align: center;
    font-size: 13px;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table thead {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
}
.admin-table th,
.admin-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--gray-50); }

.admin-mono { font-family: 'Roboto Mono', monospace; font-size: 12.5px; }

/* ── Detail page ── */

.admin-detail {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.admin-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.admin-detail-title { font-size: 20px; font-weight: 700; }
.admin-detail-sub { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.admin-detail-uuid { font-size: 11.5px; color: var(--gray-400); font-family: 'Roboto Mono', monospace; margin-top: 6px; }

.admin-dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    font-size: 13px;
}
.admin-dl-row { display: flex; flex-direction: column; gap: 2px; }
.admin-dl-row--full { grid-column: 1 / -1; }
.admin-dl-label { font-size: 11.5px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.3px; }
.admin-dl-value { color: var(--gray-900); }

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    align-items: flex-start;
}

.admin-action-btn {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: background 0.12s;
}
.admin-action-btn--approve { background: var(--green); color: #fff; }
.admin-action-btn--approve:hover { background: #14A05F; }
.admin-action-btn--reject { background: var(--red-bg); color: var(--red-text); border: 1px solid #F5B5B9; }
.admin-action-btn--reject:hover { background: #F9D1D4; }
.admin-action-btn--suspend { background: var(--amber-bg); color: var(--amber-text); border: 1px solid #F5D08F; }
.admin-action-btn--unsuspend { background: var(--green-bg); color: var(--green-text); border: 1px solid #B7E6C9; }

.admin-reject-form {
    background: var(--red-bg);
    border: 1px solid #F5B5B9;
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 480px;
}
.admin-reject-form textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #F5B5B9;
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 72px;
}

.admin-back-link {
    display: inline-block;
    font-size: 13px;
    margin-bottom: 16px;
    color: var(--gray-500);
}
.admin-back-link:hover { color: var(--orange-dark); }

/* ── Status pills: reuse the .pill-* classes from hub.css for consistency ── */
.status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: capitalize;
}
.status-pill--pending   { background: var(--amber-bg); color: var(--amber-text); }
.status-pill--active    { background: var(--green-bg); color: var(--green-text); }
.status-pill--suspended { background: #FFF0D6; color: #8C5A00; }
.status-pill--rejected  { background: var(--red-bg);   color: var(--red-text); }
