/* ==========================================================================
   NIGAMA CONNECT ADMIN — MANAGEMENT & SECURITY CREDENTIALS CONSOLE
   Theme: Dual Dark & Light Luxury Glassmorphic Design System
   Compatible with Python Server 1 (/api/admin/security/*)
   ========================================================================== */

.management-content {
    flex: 1;
    padding: 32px;
    max-width: 1520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
    font-family: var(--nc-font-sans, 'Plus Jakarta Sans', sans-serif);
    color: var(--nc-text-primary, #F8FAFC);
}

/* ── Hero Banner ─────────────────────────────────────────────────────── */
.management-banner {
    background: linear-gradient(135deg, rgba(15, 29, 56, 0.95) 0%, rgba(11, 21, 40, 0.95) 50%, rgba(15, 163, 217, 0.2) 100%);
    border: 1px solid rgba(15, 163, 217, 0.35);
    border-radius: 20px;
    padding: 32px 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(15, 163, 217, 0.15);
    backdrop-filter: blur(28px) saturate(180%);
}

:root[data-theme="light"] .management-banner {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 60%, rgba(15, 163, 217, 0.15) 100%);
    border-color: rgba(15, 163, 217, 0.3);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08), 0 0 20px rgba(15, 163, 217, 0.15);
}

.banner-title {
    font-family: var(--nc-font-heading, 'Outfit', sans-serif);
    font-size: 26px;
    font-weight: 800;
    color: var(--nc-text-primary, #FFFFFF);
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.banner-subtitle {
    font-size: 14px;
    color: var(--nc-text-secondary, #94A3B8);
    max-width: 650px;
    line-height: 1.6;
    margin: 0;
}

.banner-subtitle strong {
    color: var(--nc-brand-primary, #0FA3D9);
}

.banner-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 40px;
    color: #34D399;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    animation: pulseStatusRing 2s infinite;
}

/* ── Metrics Stats Bar ───────────────────────────────────────────────── */
.security-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.security-metric-card {
    background: var(--nc-surface-card, #0B1528);
    border: 1px solid var(--nc-border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(20px);
    transition: all 0.25s ease;
}

:root[data-theme="light"] .security-metric-card {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.metric-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.metric-icon-wrap.cyan { background: rgba(15, 163, 217, 0.15); border: 1px solid rgba(15, 163, 217, 0.3); color: #0FA3D9; }
.metric-icon-wrap.green { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); color: #10B981; }
.metric-icon-wrap.gold { background: rgba(245, 158, 11, 0.15); border: 1px solid rgba(245, 158, 11, 0.3); color: #F59E0B; }
.metric-icon-wrap.violet { background: rgba(139, 92, 246, 0.15); border: 1px solid rgba(139, 92, 246, 0.3); color: #8B5CF6; }

.metric-info {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nc-text-secondary, #94A3B8);
    margin-bottom: 4px;
}

.metric-value {
    font-family: var(--nc-font-heading, 'Outfit', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: var(--nc-text-primary, #FFFFFF);
}

/* ── Credentials Management Section ──────────────────────────────────── */
.credentials-section-title {
    font-family: var(--nc-font-heading, 'Outfit', sans-serif);
    font-size: 20px;
    font-weight: 800;
    color: var(--nc-text-primary, #FFFFFF);
    margin: 0 0 18px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.credentials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
}

.credential-card {
    background: var(--nc-surface-card, #0B1528);
    border: 1px solid var(--nc-border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 20px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(24px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] .credential-card {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.credential-card.login-card {
    border-top: 4px solid var(--nc-brand-gold, #F59E0B);
}

.credential-card.access-card {
    border-top: 4px solid var(--nc-brand-primary, #0FA3D9);
}

.credential-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.credential-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-card .credential-icon-box {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #F59E0B;
}

.access-card .credential-icon-box {
    background: rgba(15, 163, 217, 0.15);
    border: 1px solid rgba(15, 163, 217, 0.35);
    color: #0FA3D9;
}

.credential-icon-box svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
}

.credential-title-wrap {
    flex: 1;
}

.credential-title {
    font-family: var(--nc-font-heading, 'Outfit', sans-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--nc-text-primary, #FFFFFF);
    margin: 0 0 6px 0;
}

.credential-desc {
    font-size: 13px;
    color: var(--nc-text-secondary, #94A3B8);
    margin: 0;
    line-height: 1.5;
}

.credential-meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--nc-border-subtle, rgba(255, 255, 255, 0.05));
    border-radius: 12px;
    padding: 16px 18px;
}

:root[data-theme="light"] .credential-meta-list {
    background: #F8FAFC;
    border-color: rgba(15, 23, 42, 0.06);
}

.meta-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.meta-item-label {
    color: var(--nc-text-secondary, #94A3B8);
    font-weight: 500;
}

.meta-item-value {
    color: var(--nc-text-primary, #FFFFFF);
    font-weight: 600;
    font-family: var(--nc-font-mono, monospace);
}

.meta-item-value.password-dots {
    letter-spacing: 3px;
    font-size: 16px;
    color: var(--nc-brand-primary, #0FA3D9);
}

.credential-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    font-family: var(--nc-font-sans, 'Plus Jakarta Sans', sans-serif);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    color: #FFFFFF;
    margin-top: auto;
}

.login-card .credential-action-btn {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
}

.login-card .credential-action-btn:hover {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    box-shadow: 0 8px 26px rgba(245, 158, 11, 0.55);
    transform: translateY(-2px);
}

.access-card .credential-action-btn {
    background: linear-gradient(135deg, #0FA3D9 0%, #0284C7 100%);
    box-shadow: 0 4px 18px rgba(15, 163, 217, 0.35);
}

.access-card .credential-action-btn:hover {
    background: linear-gradient(135deg, #38BDF8 0%, #0FA3D9 100%);
    box-shadow: 0 8px 26px rgba(15, 163, 217, 0.55);
    transform: translateY(-2px);
}

.credential-action-btn svg {
    width: 17px !important;
    height: 17px !important;
    max-width: 17px !important;
    max-height: 17px !important;
    stroke: currentColor;
    flex-shrink: 0;
}

/* ── Audit Logs Section ──────────────────────────────────────────────── */
.audit-logs-section {
    background: var(--nc-surface-card, #0B1528);
    border: 1px solid var(--nc-border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 20px;
    padding: 28px 32px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] .audit-logs-section {
    background: #FFFFFF;
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

.audit-logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.audit-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--nc-text-secondary, #94A3B8);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--nc-border-subtle, rgba(255, 255, 255, 0.08));
}

.audit-table td {
    padding: 14px 16px;
    color: var(--nc-text-primary, #FFFFFF);
    border-bottom: 1px solid var(--nc-border-subtle, rgba(255, 255, 255, 0.05));
}

.audit-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

/* ── Interactive 2-Step OTP Modal ────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-card {
    background: var(--nc-surface-card, #0B1528);
    border: 1px solid var(--nc-border-glow-primary, rgba(15, 163, 217, 0.45));
    border-radius: 24px;
    padding: 36px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 35px rgba(15, 163, 217, 0.2);
    position: relative;
}

:root[data-theme="light"] .modal-card {
    background: #FFFFFF;
    border-color: rgba(15, 163, 217, 0.4);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18), 0 0 30px rgba(15, 163, 217, 0.2);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--nc-text-secondary, #94A3B8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #EF4444;
    color: #FFFFFF;
}

.modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.modal-icon-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(15, 163, 217, 0.12);
    border: 2px dashed #0FA3D9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    color: #0FA3D9;
}

.modal-icon-ring svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
}

.modal-title {
    font-family: var(--nc-font-heading, 'Outfit', sans-serif);
    font-size: 22px;
    font-weight: 800;
    color: var(--nc-text-primary, #FFFFFF);
    margin: 0 0 8px 0;
}

.modal-subtitle {
    font-size: 13.5px;
    color: var(--nc-text-secondary, #94A3B8);
    margin: 0;
    line-height: 1.5;
}

/* Modal Steps */
.modal-step {
    display: none;
}

.modal-step.active {
    display: block;
    animation: stepSlide 0.3s ease;
}

@keyframes stepSlide {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

.form-group-custom {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-label-custom {
    font-size: 13px;
    font-weight: 600;
    color: var(--nc-text-secondary, #94A3B8);
}

.form-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input-custom {
    width: 100%;
    padding: 12px 42px 12px 16px;
    background: rgba(15, 29, 56, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #FFFFFF;
    font-family: var(--nc-font-sans, sans-serif);
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

:root[data-theme="light"] .form-input-custom {
    background: #F8FAFC;
    border-color: rgba(15, 23, 42, 0.15);
    color: #0F172A;
}

.form-input-custom:focus {
    outline: none;
    border-color: #0FA3D9;
    box-shadow: 0 0 0 3px rgba(15, 163, 217, 0.25);
}

.password-eye-btn {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--nc-text-muted, #64748B);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-eye-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* OTP Digit Boxes */
.otp-boxes-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0 20px 0;
}

.otp-box-digit {
    width: 52px;
    height: 60px;
    text-align: center;
    font-size: 26px;
    font-weight: 800;
    font-family: var(--nc-font-mono, monospace);
    color: #38BDF8;
    background: rgba(15, 29, 56, 0.8);
    border: 2px solid rgba(15, 163, 217, 0.3);
    border-radius: 12px;
    transition: all 0.2s ease;
}

:root[data-theme="light"] .otp-box-digit {
    background: #F8FAFC;
    border-color: rgba(15, 163, 217, 0.35);
    color: #0284C7;
}

.otp-box-digit:focus {
    outline: none;
    border-color: #0FA3D9;
    box-shadow: 0 0 16px rgba(15, 163, 217, 0.4);
    transform: translateY(-2px);
}

.countdown-timer-wrap {
    text-align: center;
    font-size: 13px;
    color: var(--nc-text-secondary, #94A3B8);
    margin-bottom: 24px;
}

.countdown-timer-value {
    color: #FFA24D;
    font-weight: 700;
    font-family: var(--nc-font-mono, monospace);
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .security-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .credentials-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .security-metrics-grid {
        grid-template-columns: 1fr;
    }
    .otp-boxes-container {
        gap: 8px;
    }
    .otp-box-digit {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
}
