/**
 * PicProof Partner Dashboard - Glassmorphism Style
 * @copyright reDim GmbH | @link https://www.redim.de | @contact team@redim.de
 */

/* Local Inter Font */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/inter-v20-latin-regular.woff2') format('woff2'),
         url('../fonts/inter-v20-latin-regular.woff') format('woff');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/inter-v20-latin-500.woff2') format('woff2'),
         url('../fonts/inter-v20-latin-500.woff') format('woff');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/inter-v20-latin-600.woff2') format('woff2'),
         url('../fonts/inter-v20-latin-600.woff') format('woff');
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/inter-v20-latin-700.woff2') format('woff2'),
         url('../fonts/inter-v20-latin-700.woff') format('woff');
}

:root {
    --primary: #1A365D;
    --primary-light: #2D4A7C;
    --secondary: #0D9488;
    --secondary-light: #14B8A6;
    --success: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;
    --text: #1E293B;
    --text-light: #64748B;
    --text-white: rgba(255, 255, 255, 0.9);
    --text-white-muted: rgba(255, 255, 255, 0.6);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-bg-light: rgba(255, 255, 255, 0.5);
    --glass-bg-dark: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-blur: blur(20px);

    --sidebar-width: 260px;

    /* Gradient Background */
    --gradient-start: #667eea;
    --gradient-mid: #764ba2;
    --gradient-end: #f093fb;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
    background-attachment: fixed;
}

/* Animated background shapes */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 200, 255, 0.2) 0%, transparent 40%);
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, 2%) rotate(5deg); }
    50% { transform: translate(-1%, 3%) rotate(-3deg); }
    75% { transform: translate(3%, -2%) rotate(3deg); }
}

/* Screens */
.screen { display: none; }
.screen.active { display: flex; }

/* ==================== Login Screen ==================== */
#login-screen {
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    width: 100%;
    max-width: 420px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header .logo {
    height: 56px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.login-form .form-group { margin-bottom: 1.5rem; }

.login-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.login-form input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.error-message {
    color: var(--error);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.error-message.show { display: block; }

.login-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
}

.login-footer a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.login-footer a:hover { color: var(--secondary-light); }

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn:hover::before { opacity: 1; }

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #0F766E 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.5);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    color: var(--text);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: var(--glass-bg-dark);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error) 0%, #DC2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #16A34A 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.5);
}

.btn-block { width: 100%; }
.btn-small { padding: 0.5rem 1rem; font-size: 0.8125rem; border-radius: 8px; }

/* ==================== Dashboard Layout ==================== */
#dashboard-screen {
    min-height: 100vh;
}

/* ==================== Sidebar ==================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(26, 54, 93, 0.85);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-small {
    height: 36px;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    margin: 0.25rem 0.75rem;
    color: var(--text-white-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-icon { font-size: 1.25rem; margin-right: 0.875rem; }
.nav-label { font-size: 0.9375rem; font-weight: 500; }

/* Admin Navigation */
.admin-nav { margin-top: 0.5rem; }

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 1.5rem;
}

.nav-section-title {
    display: block;
    padding: 0.5rem 1.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    padding: 0.875rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-white-muted);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    transform: translateY(-2px);
}

/* ==================== Main Content ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    padding: 2rem 2.5rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.content-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.partner-name {
    color: var(--text-white-muted);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ==================== Sections ==================== */
.section { display: none; width: 100%; }
.section.active { display: block; width: 100%; animation: fadeIn 0.4s ease; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section-actions { margin-bottom: 1.5rem; }

.section-header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--secondary) 0%, #0F766E 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ==================== Cards ==================== */
.card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    padding: 1.75rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.card h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.card-description {
    color: var(--text-light);
    font-size: 0.9375rem;
}

/* ==================== Quickstart ==================== */
.quickstart { display: flex; flex-direction: column; gap: 1.25rem; }

.quickstart-step {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.quickstart-step:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateX(8px);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--secondary) 0%, #0F766E 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.step-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--primary);
}

.step-content p {
    font-size: 0.875rem;
    color: var(--text-light);
}

.step-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-family: 'SF Mono', Monaco, monospace;
}

/* ==================== Tables ==================== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table th, .table td {
    padding: 1rem 1.25rem;
    text-align: left;
}

.table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
}

.table td {
    font-size: 0.9375rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, 0.5);
}

.table .empty {
    text-align: center;
    color: var(--text-light);
    padding: 3rem;
    font-style: italic;
}

.key-preview, .token-preview {
    font-family: 'SF Mono', Monaco, monospace;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.375rem 0.625rem;
    border-radius: 8px;
    font-size: 0.8125rem;
}

/* ==================== Badges ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-test { background: rgba(254, 243, 199, 0.8); color: #92400E; }
.badge-live { background: rgba(220, 252, 231, 0.8); color: #166534; }
.badge-success { background: rgba(220, 252, 231, 0.8); color: #166534; }
.badge-pending { background: rgba(254, 243, 199, 0.8); color: #92400E; }
.badge-failed { background: rgba(254, 226, 226, 0.8); color: #991B1B; }

/* Admin Badges */
.badge-admin { background: rgba(224, 231, 255, 0.8); color: #3730A3; }
.badge-active { background: rgba(220, 252, 231, 0.8); color: #166534; }
.badge-inactive { background: rgba(243, 244, 246, 0.8); color: #6B7280; }
.badge-starter { background: rgba(243, 244, 246, 0.8); color: #4B5563; }
.badge-pro { background: rgba(219, 234, 254, 0.8); color: #1D4ED8; }
.badge-enterprise { background: rgba(224, 231, 255, 0.8); color: #4338CA; }

/* Session Status Badges */
.badge-status-pending { background: rgba(254, 243, 199, 0.8); color: #92400E; }
.badge-status-processing { background: rgba(219, 234, 254, 0.8); color: #1D4ED8; }
.badge-status-completed { background: rgba(220, 252, 231, 0.8); color: #166534; }
.badge-status-failed { background: rgba(254, 226, 226, 0.8); color: #991B1B; }
.badge-status-expired { background: rgba(243, 244, 246, 0.8); color: #6B7280; }
.badge-status-cancelled { background: rgba(243, 244, 246, 0.8); color: #6B7280; }

/* ==================== Usage Bar ==================== */
.usage-bar-container { margin: 1.5rem 0; }

.usage-bar {
    height: 14px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--secondary-light) 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.3);
}

.usage-text {
    margin-top: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ==================== Usage Chart ==================== */
.usage-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 160px;
    padding: 1rem 0;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--secondary) 0%, var(--secondary-light) 100%);
    border-radius: 8px 8px 0 0;
    min-height: 4px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.2);
}

.chart-bar:hover {
    filter: brightness(1.1);
    transform: scaleY(1.05);
    transform-origin: bottom;
}

.chart-bar::after {
    content: attr(data-value);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-light);
    padding-bottom: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.chart-bar:hover::after { opacity: 1; }

/* ==================== Code Block ==================== */
.code-block {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    color: #E2E8F0;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    overflow-x: auto;
    font-size: 0.8125rem;
    line-height: 1.7;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.code-block code {
    font-family: 'SF Mono', Monaco, 'Fira Code', monospace;
}

/* ==================== Modals ==================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.active { display: flex; }

.modal-content {
    background: var(--glass-bg-dark);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-lg .modal-content {
    max-width: 560px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-close {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 1.25rem;
    color: var(--text-light);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

/* Modal footer button (not the X close) */
.modal-footer .btn.modal-close {
    width: auto;
    height: auto;
    font-size: 0.9375rem;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--secondary) 0%, #0F766E 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.4);
}

.modal-footer .btn.modal-close:hover {
    background: linear-gradient(135deg, #0F766E 0%, var(--secondary) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.5);
}

.modal-body { padding: 1.75rem; }
.modal-body .form-group { margin-bottom: 1.5rem; }

.modal-body label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="password"],
.modal-body select {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

.modal-body input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.modal-body label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0 0 24px 24px;
}

/* ==================== Copy Field ==================== */
.copy-field {
    display: flex;
    gap: 0.5rem;
}

.copy-field input {
    flex: 1;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
}

.btn-copy {
    padding: 0.875rem 1.25rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ==================== Alert ==================== */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-warning {
    background: rgba(254, 243, 199, 0.8);
    color: #92400E;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==================== Settings ==================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.5rem;
}

.settings-form .form-group {
    margin-bottom: 1.5rem;
}

.settings-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.settings-form input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.settings-form input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

/* ==================== 2FA Status ==================== */
.twofa-status {
    margin-top: 1.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.status-badge.status-active {
    background: rgba(220, 252, 231, 0.8);
    color: #166534;
}

.status-badge.status-inactive {
    background: rgba(254, 226, 226, 0.8);
    color: #991B1B;
}

.twofa-status p {
    color: var(--text-light);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

/* ==================== 2FA Setup Modal ==================== */
.twofa-setup-steps {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.setup-step {
    display: flex;
    gap: 1.25rem;
}

.setup-step .step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--secondary) 0%, #0F766E 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.setup-step .step-content {
    flex: 1;
}

.setup-step h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-weight: 600;
}

.setup-step p {
    font-size: 0.9375rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.qr-code-container {
    background: white;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: inline-block;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.qr-code-container svg {
    display: block;
    width: 180px;
    height: 180px;
}

.secret-manual {
    margin-top: 1rem;
}

.secret-manual p {
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.secret-manual .copy-field input {
    font-family: 'SF Mono', Monaco, monospace;
    letter-spacing: 0.1em;
}

.verify-code-form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.verify-code-form input {
    flex: 1;
    max-width: 160px;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 1.5rem;
    font-family: 'SF Mono', Monaco, monospace;
    letter-spacing: 0.25em;
    text-align: center;
}

.verify-code-form input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

/* ==================== 2FA Login ==================== */
.twofa-input-group {
    text-align: center;
}

.twofa-input-group input {
    width: 220px;
    padding: 1.25rem;
    font-size: 2rem;
    font-family: 'SF Mono', Monaco, monospace;
    letter-spacing: 0.35em;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
}

.twofa-input-group input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.15);
}

/* ==================== Toast Notifications ==================== */
.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 20px 40px -8px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    min-width: 340px;
    max-width: 440px;
    pointer-events: auto;
    transform: translateX(calc(100% + 2rem)) scale(0.9);
    opacity: 0;
    overflow: hidden;
    position: relative;
}

.toast.show {
    animation: toastSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.hiding {
    animation: toastSlideOut 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

@keyframes toastSlideIn {
    0% {
        transform: translateX(calc(100% + 2rem)) scale(0.9);
        opacity: 0;
    }
    50% { opacity: 1; }
    70% { transform: translateX(-8px) scale(1.02); }
    100% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    0% {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100% + 2rem)) scale(0.9);
        opacity: 0;
    }
}

.toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    position: relative;
    overflow: hidden;
}

.toast-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, transparent 50%);
}

.toast-icon svg {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
}

.toast-content {
    flex: 1;
    min-width: 0;
    padding: 0.125rem 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--text-light);
    word-break: break-word;
    line-height: 1.5;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.125rem;
    line-height: 1;
    opacity: 0;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: -0.25rem;
}

.toast:hover .toast-close { opacity: 0.5; }

.toast-close:hover {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 16px 16px;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Toast Types */
.toast-success {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(220,252,231,0.4) 100%);
}
.toast-success .toast-icon {
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}
.toast-success .toast-title { color: #166534; }
.toast-success .toast-progress { background: linear-gradient(90deg, #22C55E, #16A34A); }

.toast-error {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(254,226,226,0.4) 100%);
}
.toast-error .toast-icon {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}
.toast-error .toast-title { color: #991B1B; }
.toast-error .toast-progress { background: linear-gradient(90deg, #EF4444, #DC2626); }

.toast-warning {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(254,243,199,0.4) 100%);
}
.toast-warning .toast-icon {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}
.toast-warning .toast-title { color: #92400E; }
.toast-warning .toast-progress { background: linear-gradient(90deg, #F59E0B, #D97706); }

.toast-info {
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(219,234,254,0.4) 100%);
}
.toast-info .toast-icon {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
.toast-info .toast-title { color: #1D4ED8; }
.toast-info .toast-progress { background: linear-gradient(90deg, #3B82F6, #2563EB); }

/* Icon animations */
.toast.show .toast-icon {
    animation: iconPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s both;
}

@keyframes iconPop {
    0% { transform: scale(0) rotate(-45deg); }
    60% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

/* Hover effect */
.toast {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.toast:hover {
    transform: translateX(-4px);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 25px 50px -12px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .nav-item {
        padding: 0.75rem 1rem;
        flex-direction: column;
        margin: 0;
        min-width: max-content;
    }

    .nav-item:hover { transform: none; }
    .nav-icon { margin-right: 0; margin-bottom: 0.25rem; font-size: 1.125rem; }
    .nav-label { font-size: 0.75rem; }
    .sidebar-footer { display: none; }
    .admin-nav { display: none; }

    .main-content {
        margin-left: 0;
        padding: 1.5rem 1rem;
    }

    .content-header h2 { font-size: 1.5rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
    .settings-grid { grid-template-columns: 1fr; }

    .toast-container {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: 1rem;
    }

    .toast {
        min-width: auto;
        max-width: none;
        transform: translateY(calc(100% + 2rem)) scale(0.9);
    }

    .toast.show {
        animation: toastSlideInMobile 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    .toast.hiding {
        animation: toastSlideOutMobile 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
    }

    @keyframes toastSlideInMobile {
        0% {
            transform: translateY(calc(100% + 2rem)) scale(0.9);
            opacity: 0;
        }
        50% { opacity: 1; }
        70% { transform: translateY(-8px) scale(1.02); }
        100% {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
    }

    @keyframes toastSlideOutMobile {
        0% {
            transform: translateY(0) scale(1);
            opacity: 1;
        }
        100% {
            transform: translateY(calc(100% + 2rem)) scale(0.9);
            opacity: 0;
        }
    }
}

/* ==================== API Key Display ==================== */
.key-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-display .key-value {
    font-family: 'SF Mono', Monaco, 'Fira Code', monospace;
    font-size: 0.8125rem;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.key-display[data-revealed="true"] .key-value {
    max-width: none;
    word-break: break-all;
    white-space: normal;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

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

.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon svg {
    width: 14px;
    height: 14px;
}

.btn-copy-key:hover {
    background: var(--secondary);
    border-color: var(--secondary);
}
