* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
}

.container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.consent-card {
    max-width: 480px;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: -0.5px;
}

.subtitle {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.15s;
    outline: none;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group select {
    padding: 0.625rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.15s;
    outline: none;
    background: #ffffff;
    color: #1a1a2e;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.phone-row {
    display: flex;
    gap: 0.5rem;
}

.phone-row select {
    flex: 0 0 auto;
    width: auto;
    min-width: 100px;
}

.phone-row input {
    flex: 1;
}

.btn {
    display: block;
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s;
}

.btn-primary {
    background: #2563eb;
    color: #ffffff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-passkey {
    background: #1e1e1e;
    color: #ffffff;
    border: none;
    margin-top: 0;
}

.btn-passkey:hover {
    background: #333333;
}

.btn-passkey:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.2rem 0;
    color: #9ca3af;
    font-size: 0.85rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.divider span {
    padding: 0 0.75rem;
}

.btn-group {
    margin-top: 0.75rem;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.field-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

.footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.footer-link a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.footer-link a:hover {
    text-decoration: underline;
}

/* Guide links on login page */
.guide-links {
    display: flex;
    gap: 0.625rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.guide-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.15s, background-color 0.15s;
}

.guide-link:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.guide-link-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563eb;
}

.guide-link-desc {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

/* QR Code container for MFA setup */
.qr-container {
    text-align: center;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.qr-container p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

/* Secret key display */
.secret-key {
    text-align: center;
    margin-bottom: 1.25rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.secret-key p {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.375rem;
}

.secret-key code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    color: #1a1a2e;
    word-break: break-all;
    letter-spacing: 1px;
}

/* Backup codes display */
.backup-codes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.backup-codes code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9rem;
    text-align: center;
    padding: 0.375rem;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #d1d5db;
}

/* Consent page scopes */
.consent-scopes {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.consent-scopes input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

/* Dashboard layout */
.dashboard-container {
    min-height: 100vh;
    background: #f0f2f5;
}

.dashboard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.nav-brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2563eb;
    letter-spacing: -0.5px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-email {
    font-size: 0.875rem;
    color: #6b7280;
}

.btn-logout {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    color: #374151;
    cursor: pointer;
    font-weight: 500;
}

.btn-logout:hover {
    background: #f3f4f6;
}

.dashboard-main {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem;
}

.dashboard-header {
    margin-bottom: 1.5rem;
}

.dashboard-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a2e;
}

.dashboard-grid {
    display: grid;
    gap: 1.25rem;
}

.dash-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
}

.dash-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f2f5;
}

.dash-info {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.dash-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dash-label {
    font-size: 0.875rem;
    color: #6b7280;
}

.dash-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1a2e;
}

.dash-actions {
    margin-top: 1.25rem;
    display: flex;
    gap: 0.75rem;
}

.dash-actions .btn {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    display: inline-block;
}

/* Features page */
.features-container {
    min-height: 100vh;
    background: #f0f2f5;
}

.features-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.features-nav .nav-brand a {
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-nav {
    padding: 0.375rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: #374151;
    border: 1px solid #d1d5db;
    transition: background-color 0.15s;
}

.btn-nav:hover {
    background: #f3f4f6;
}

.btn-nav-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.btn-nav-primary:hover {
    background: #1d4ed8;
}

.features-hero {
    text-align: center;
    padding: 3rem 2rem 2rem;
    max-width: 640px;
    margin: 0 auto;
}

.features-hero h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
}

.features-hero .subtitle {
    font-size: 1.05rem;
    line-height: 1.6;
}

.features-main {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 2rem 3rem;
}

.feature-section {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    margin-bottom: 1.25rem;
}

.feature-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.feature-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.375rem;
}

.feature-desc {
    color: #6b7280;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.feature-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.625rem;
    margin-top: 1.25rem;
}

.feature-details h4:first-child {
    margin-top: 0;
}

.feature-details ol,
.feature-details ul {
    padding-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-details li {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.7;
    margin-bottom: 0.25rem;
}

.feature-details p {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 0.625rem;
}

.feature-details a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.feature-details a:hover {
    text-decoration: underline;
}

.feature-details code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8rem;
    background: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    color: #1a1a2e;
}

.feature-note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: #1e40af;
    line-height: 1.6;
    margin-top: 1rem;
}

.endpoint-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.75rem;
}

.endpoint-table tr {
    border-bottom: 1px solid #f0f2f5;
}

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

.endpoint-table td {
    padding: 0.5rem 0.5rem;
    font-size: 0.85rem;
    color: #374151;
}

.endpoint-label {
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    width: 120px;
}

.features-footer {
    text-align: center;
    padding: 2rem;
    color: #9ca3af;
    font-size: 0.8rem;
    border-top: 1px solid #e5e7eb;
}

/* Code blocks for integration guide */
.code-block {
    background: #1e293b;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.code-label {
    background: #334155;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #475569;
}

.code-block pre {
    color: #e2e8f0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.8rem;
    line-height: 1.65;
    padding: 1rem;
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}

.toc-list {
    padding-left: 1.25rem;
}

.toc-list li {
    font-size: 0.9rem;
    line-height: 2;
}

.toc-list a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.toc-list a:hover {
    text-decoration: underline;
}

/* Sign-in chooser page */
.chooser-card {
    max-width: 420px;
}

.social-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #9ca3af;
    font-size: 0.8rem;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #e5e7eb;
}

.social-divider span {
    padding: 0 0.75rem;
    white-space: nowrap;
}

.social-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
    border: 1px solid #d1d5db;
}

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

.btn-flexid {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
    margin-bottom: 0.25rem;
}

.btn-flexid:hover {
    background: #1d4ed8;
}

.btn-flexid .social-icon {
    fill: #ffffff;
    color: #ffffff;
}

.btn-google {
    background: #ffffff;
    color: #374151;
}

.btn-google:hover {
    background: #f9fafb;
    border-color: #4285F4;
}

.btn-facebook {
    background: #1877F2;
    color: #ffffff;
    border-color: #1877F2;
}

.btn-facebook:hover {
    background: #166fe5;
}

.btn-github {
    background: #24292f;
    color: #ffffff;
    border-color: #24292f;
}

.btn-github:hover {
    background: #1b1f23;
}

.btn-linkedin {
    background: #0A66C2;
    color: #ffffff;
    border-color: #0A66C2;
}

.btn-linkedin:hover {
    background: #095ba5;
}

.btn-apple {
    background: #000000;
    color: #ffffff;
    border-color: #000000;
}

.btn-apple:hover {
    background: #1a1a1a;
}

/* Invert icon colors for dark-background buttons */
.btn-facebook .social-icon,
.btn-github .social-icon,
.btn-linkedin .social-icon,
.btn-apple .social-icon {
    filter: brightness(0) invert(1);
}

/* htmx loading indicator */
.htmx-request .btn-primary {
    opacity: 0.7;
    pointer-events: none;
}

.htmx-request .btn-primary::after {
    content: " ...";
}

/* ── Admin Panel ────────────────────────────────────────────────────── */

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

.admin-sidebar {
    width: 240px;
    background: #1e293b;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 20;
}

.admin-sidebar-brand {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #334155;
}

.admin-sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #60a5fa;
    letter-spacing: -0.5px;
}

.admin-sidebar-brand .brand-sub {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.125rem;
}

.admin-sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.admin-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.15s, color 0.15s;
}

.admin-sidebar-nav a:hover {
    background: #334155;
    color: #f1f5f9;
}

.admin-sidebar-nav a.active {
    background: #2563eb;
    color: #ffffff;
}

.admin-sidebar-nav .nav-icon {
    width: 18px;
    text-align: center;
    font-style: normal;
}

.admin-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #334155;
    font-size: 0.8rem;
}

.admin-sidebar-footer .admin-email {
    color: #94a3b8;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.admin-sidebar-footer a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.8rem;
}

.admin-sidebar-footer a:hover {
    color: #e2e8f0;
}

.admin-content {
    flex: 1;
    margin-left: 240px;
    background: #f0f2f5;
    min-height: 100vh;
}

.admin-topbar-global {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
}

.admin-topbar h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
}

.admin-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-body {
    padding: 1.5rem 2rem;
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.stat-card.stat-primary { border-left: 4px solid #2563eb; }
.stat-card.stat-success { border-left: 4px solid #16a34a; }
.stat-card.stat-warning { border-left: 4px solid #d97706; }
.stat-card.stat-danger { border-left: 4px solid #dc2626; }
.stat-card.stat-info { border-left: 4px solid #0891b2; }

/* Admin tables */
.admin-table-container {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

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

.admin-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
}

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

.admin-table tr:hover td {
    background: #f8fafc;
}

.admin-table a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.admin-table a:hover {
    text-decoration: underline;
}

/* Toolbar / search */
.admin-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.admin-toolbar .search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
}

.admin-toolbar .search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.admin-toolbar select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #ffffff;
    outline: none;
    cursor: pointer;
}

.admin-toolbar select:focus {
    border-color: #2563eb;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fef2f2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* Pagination */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    font-size: 0.8rem;
    color: #6b7280;
}

.admin-pagination .page-info {
    font-size: 0.8rem;
}

.admin-pagination .page-links {
    display: flex;
    gap: 0.25rem;
}

.admin-pagination .page-links a,
.admin-pagination .page-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    color: #374151;
    background: #ffffff;
    cursor: pointer;
}

.admin-pagination .page-links a:hover {
    background: #f3f4f6;
    border-color: #2563eb;
    color: #2563eb;
}

.admin-pagination .page-links .active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.admin-pagination .page-links .disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Detail card */
.admin-detail-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.admin-detail-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #f0f2f5;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item .detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-item .detail-value {
    font-size: 0.875rem;
    color: #1a1a2e;
    word-break: break-all;
}

/* Action buttons group */
.admin-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #d1d5db;
    cursor: pointer;
    text-decoration: none;
    background: #ffffff;
    color: #374151;
    transition: background-color 0.15s, border-color 0.15s;
    width: auto;
}

.btn-admin:hover {
    background: #f3f4f6;
}

.btn-admin-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.btn-admin-primary:hover {
    background: #1d4ed8;
}

.btn-admin-danger {
    background: #ffffff;
    color: #dc2626;
    border-color: #fecaca;
}

.btn-admin-danger:hover {
    background: #fef2f2;
}

.btn-admin-success {
    background: #ffffff;
    color: #16a34a;
    border-color: #bbf7d0;
}

.btn-admin-success:hover {
    background: #f0fdf4;
}

.btn-admin-warning {
    background: #ffffff;
    color: #d97706;
    border-color: #fde68a;
}

.btn-admin-warning:hover {
    background: #fffbeb;
}

/* Admin form */
.admin-form {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    max-width: 600px;
}

.admin-form .form-group {
    margin-bottom: 1.25rem;
}

.admin-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}

.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form input[type="tel"],
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-form select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.admin-form .form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.admin-form .form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.admin-form .form-check label {
    margin-bottom: 0;
    font-weight: 400;
}

.admin-form .form-help {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.admin-form .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Quick actions on dashboard */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.quick-action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 500;
    transition: border-color 0.15s, background-color 0.15s;
}

.quick-action-link:hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

/* Analytics charts */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.analytics-grid-full {
    grid-column: 1 / -1;
}

.chart-container {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.06);
    padding: 1.25rem;
}

.chart-container h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid #f0f2f5;
}

.chart-canvas-wrapper {
    position: relative;
    height: 280px;
}

.date-range-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.date-range-selector a {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    color: #374151;
    background: #ffffff;
}

.date-range-selector a:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.date-range-selector a.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }

    .admin-content {
        margin-left: 0;
    }

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

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

    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-form {
        max-width: 100%;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .app-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Branding ────────────────────────────────────────────────────────── */

.brand-logo {
    max-height: 48px;
    margin-bottom: 0.5rem;
}

/* ── App Launcher ────────────────────────────────────────────────────── */

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.app-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: box-shadow 0.2s;
}

.app-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.app-card-icon {
    font-size: 2rem;
    color: #2563eb;
}

.app-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: #1a1a2e;
}

.app-card-type {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.app-card-info {
    font-size: 0.8rem;
    color: #9ca3af;
    font-style: italic;
}

.btn-sm {
    padding: 0.35rem 1rem;
    font-size: 0.85rem;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

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

/* ── Session Management ──────────────────────────────────────────────── */

.session-current {
    border-left: 4px solid #22c55e;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

/* ── SDK Examples ────────────────────────────────────────────────────── */

.code-block-wrapper {
    position: relative;
    margin-top: 0.75rem;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #374151;
    color: #e5e7eb;
    border: none;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    z-index: 1;
}

.copy-btn:hover {
    background: #4b5563;
}

/* Password requirements checklist */
.password-requirements {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    font-size: 0.8rem;
}

.password-requirements li {
    padding: 0.15rem 0;
    color: #6b7280;
    transition: color 0.15s;
}

.password-requirements li::before {
    content: '\2022';
    margin-right: 0.4rem;
}

.password-requirements li.met {
    color: #16a34a;
}

.password-requirements li.met::before {
    content: '\2713';
}

.password-requirements li.unmet {
    color: #dc2626;
}

.password-requirements li.unmet::before {
    content: '\2717';
}
