/* ============================================
   LEFTYMAIL - Modern Webmail CSS
   ============================================ */

/* CSS Variables */
:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --secondary: #6b7280;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --bg-dark: #0f0f11;
    --bg-card: #18181b;
    --bg-hover: #27272a;
    --bg-input: #1f1f23;

    --border: #2e2e32;
    --border-light: #3f3f46;

    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: 0.2s ease;
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    min-height: 100vh;
}

/* ============================================
   LOGIN PAGE
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0f11 0%, #1a1a2e 50%, #0f0f11 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(79, 70, 229, 0.1) 0%,
        transparent 50%
    );
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.login-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    box-shadow: var(--shadow-xl);
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-light) 100%
    );
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    box-shadow: 0 10px 40px rgba(79, 70, 229, 0.3);
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 8px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-dark) 100%
    );
    color: white;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    text-align: center;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-light) 100%
    );
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 8px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    margin-bottom: 4px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-light);
}

.nav-item-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-item-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-stats {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    padding: 20px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

/* ============================================
   INBOX LIST
   ============================================ */

.inbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.inbox-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.inbox-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.inbox-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.inbox-card:hover::before {
    opacity: 1;
}

.inbox-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 16px;
}

.inbox-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--primary-light) 100%
    );
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.inbox-details {
    flex: 1;
    min-width: 0;
}

.inbox-email {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
    margin-bottom: 4px;
}

.inbox-date {
    font-size: 13px;
    color: var(--text-muted);
}

.inbox-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.inbox-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(79, 70, 229, 0.15);
    color: var(--primary-light);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.inbox-badge.empty {
    background: var(--bg-hover);
    color: var(--text-muted);
}

.inbox-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: var(--transition);
}

.inbox-card:hover .inbox-actions {
    opacity: 1;
}

/* ============================================
   MESSAGES LIST
   ============================================ */

.messages-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.message-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}

.message-row:last-child {
    border-bottom: none;
}

.message-row:hover {
    background: var(--bg-hover);
}

.message-checkbox {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.message-from {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-subject {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-preview {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-meta {
    text-align: right;
    flex-shrink: 0;
}

.message-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.message-size {
    font-size: 11px;
    color: var(--text-muted);
}

/* ============================================
   EMAIL VIEW
   ============================================ */

.email-view {
    max-width: 900px;
    margin: 0 auto;
}

.email-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.email-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
}

.email-subject {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.email-meta {
    display: flex;
    gap: 16px;
}

.email-sender {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.email-sender-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.email-sender-info {
    flex: 1;
}

.email-sender-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.email-sender-address {
    font-size: 13px;
    color: var(--text-muted);
}

.email-date {
    font-size: 13px;
    color: var(--text-muted);
    text-align: right;
}

.email-recipients {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

.email-recipients strong {
    color: var(--text-muted);
}

.email-body {
    padding: 32px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.email-body-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.email-body-html {
    all: initial;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
}

.email-body-html * {
    max-width: 100%;
}

.email-body-html img {
    max-width: 100%;
    height: auto;
}

.email-body-html a {
    color: var(--primary-light);
}

.email-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
}

.email-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.email-tab:hover {
    background: var(--bg-hover);
}

.email-tab.active {
    background: var(--primary);
    color: white;
}

/* Email iframe for HTML content */
.email-iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    background: #18181b;
    border-radius: var(--radius-md);
}

.email-body-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    padding: 8px 0;
}

/* ============================================
   CREATE EMAIL
   ============================================ */

.create-container {
    max-width: 500px;
}

.create-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.create-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.input-group {
    display: flex;
    gap: 0;
}

.input-group .form-input {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    border-right: none;
}

.input-group select {
    padding: 14px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
}

.input-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin-top: 16px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ============================================
   STATS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(79, 70, 229, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 16px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ============================================
   LOADING & TOAST
   ============================================ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 17, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1001;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

.hidden {
    display: none !important;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary-light);
}

.mt-2 {
    margin-top: 8px;
}
.mt-4 {
    margin-top: 16px;
}
.mb-2 {
    margin-bottom: 8px;
}
.mb-4 {
    margin-bottom: 16px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

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

@media (max-width: 640px) {
    .login-container {
        padding: 32px 24px;
    }

    .page-header {
        padding: 16px 20px;
    }

    .page-content {
        padding: 16px 20px;
    }

    .email-header {
        padding: 20px;
    }

    .email-body {
        padding: 20px;
    }

    .email-meta {
        flex-direction: column;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ============================================
   COOLDOWN BUTTON STYLES
   ============================================ */

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   ADMIN TOGGLE SWITCH
   ============================================ */

.admin-toggle-header {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-right: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.toggle-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* ============================================
   QUOTA BAR STYLES
   ============================================ */

/* Header quota display */
.quota-header-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-right: 12px;
}

.quota-header-display .quota-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
}

.quota-bar-mini {
    width: 80px;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

/* Sidebar quota display */
.quota-info {
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--bg-hover);
    border-radius: var(--radius-md);
}

.quota-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.quota-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.quota-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.quota-bar {
    height: 6px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.quota-bar-fill {
    height: 100%;
    background: linear-gradient(
        90deg,
        var(--primary) 0%,
        var(--primary-light) 100%
    );
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Quota bar color changes based on usage */
.quota-bar-fill.warning {
    background: linear-gradient(90deg, var(--warning) 0%, #fbbf24 100%);
}

.quota-bar-fill.danger {
    background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

/* ============================================
   API KEYS ADMIN PAGE
   ============================================ */

.create-api-key-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.create-api-key-form h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

.api-keys-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-key-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: var(--transition);
}

.api-key-card:hover {
    border-color: var(--border-light);
}

.api-key-card.inactive {
    opacity: 0.6;
    background: var(--bg-hover);
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.api-key-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.api-key-preview {
    font-family: monospace;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-hover);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.api-key-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.api-key-badge.admin {
    background: rgba(79, 70, 229, 0.2);
    color: var(--primary-light);
}

.api-key-badge.revoked {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.api-key-details {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.api-key-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.api-key-stat .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-key-stat .stat-value {
    font-size: 14px;
    color: var(--text-primary);
}

.api-key-display {
    display: block;
    background: var(--bg-dark);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    margin: 12px 0;
    word-break: break-all;
    color: var(--primary-light);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Quota input group */
.quota-input-group {
    display: flex;
    gap: 8px;
}

.quota-input-group .form-input {
    flex: 1;
}

.quota-input-group input[type="number"] {
    text-align: center;
}
