/**
 * Admin Dashboard Styles
 * Traditional admin interface design
 */

/* CSS Variables - Unified Typography System */
:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-danger: #dc2626;
    --color-warning: #f59e0b;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-text: #111111;
    --color-text-body: #0C2A1F;
    --color-text-light: #404040;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text-body);
    line-height: 1.5;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Login Screen */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 48px;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 24px; /* Mobile */
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--color-text);
    line-height: 1.25;
}

@media (min-width: 768px) {
    .login-title {
        font-size: 28px; /* Desktop */
    }
}

.login-subtitle {
    font-size: 14px;
    text-align: center;
    margin-bottom: 32px;
    color: var(--color-text-light);
}

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

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

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

.form-input {
    min-height: 48px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 16px;
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-text-body);
    transition: all 0.2s;
    line-height: 1.4;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    min-height: 48px;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
    line-height: 1.4;
}

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

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

.login-error {
    background-color: #fee2e2;
    color: var(--color-error);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

/* Main App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.app-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.app-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
}

.header-actions {
    display: flex;
    gap: 12px;
}

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

.btn-secondary:hover {
    background-color: #e2e8f0;
}

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

.btn-success:hover:not(:disabled) {
    background-color: #059669;
}

.btn-success:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

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

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

.btn-danger:disabled {
    background-color: #fca5a5;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Main Content */
.app-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Chat Panel */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
}

.chat-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.chat-message-user {
    align-self: flex-end;
}

.chat-message-assistant,
.chat-message-system {
    align-self: flex-start;
}

.chat-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
}

.chat-message-user .chat-message-content {
    background-color: var(--color-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-assistant .chat-message-content {
    background-color: var(--color-bg);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}

.chat-message-system .chat-message-content {
    background-color: #fef3c7;
    color: #92400e;
    font-size: 14px;
    font-style: italic;
}

.typing-indicator .chat-message-content {
    display: flex;
    gap: 4px;
    padding: 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-text-light);
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Chat Input */
.chat-input {
    border-top: 1px solid var(--color-border);
    padding: 16px 24px;
    background: var(--color-surface);
}

.chat-input-container {
    display: flex;
    gap: 12px;
}

.chat-textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 15px;
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--color-text-body);
    resize: none;
    min-height: 48px;
    max-height: 120px;
    line-height: 1.4;
}

.chat-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Editor Panel */
.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
}

.editor-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-title {
    font-size: 18px;
    font-weight: 600;
}

.editor-actions {
    display: flex;
    gap: 12px;
}

.editor-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.json-editor {
    width: 100%;
    height: 100%;
    min-height: 400px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
}

.json-editor:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.validation-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.validation-success {
    background-color: #d1fae5;
    color: #065f46;
}

.validation-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.validation-error ul {
    margin-top: 8px;
    margin-left: 20px;
}

.validation-error li {
    margin-bottom: 4px;
}

/* Empty State */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    text-align: center;
    color: var(--color-text-light);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

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

.empty-state-text {
    font-size: 15px;
    margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 32px 24px;
        margin: 16px;
    }

    .app-header {
        padding: 12px 16px;
    }

    .header-actions {
        gap: 8px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-message {
        max-width: 90%;
    }

    .chat-input {
        padding: 12px 16px;
    }

    .editor-content {
        padding: 16px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

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

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

/* Dashboard Styles */
#dashboard-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.dashboard-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
}

.dashboard-header .btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px;
    color: var(--color-text-light);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.loading-state p {
    font-size: 16px;
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.error-state p {
    color: var(--color-error);
    font-size: 16px;
}

/* Funnels Grid */
.funnels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
}

/* Funnel Card */
.funnel-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

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

.funnel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.funnel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    flex: 1;
}

.funnel-version {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.funnel-version-outdated {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--color-warning);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.funnel-id {
    font-size: 13px;
    color: var(--color-text-light);
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.funnel-created {
    font-size: 13px;
    color: var(--color-text-light);
    margin-bottom: 16px;
}

/* Funnel Stats */
.funnel-stats {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.stat-section {
    background: var(--color-bg);
    padding: 12px;
    border-radius: 8px;
}

.stat-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
}

.stat-row.stat-total {
    border-top: 1px solid var(--color-border);
    margin-top: 4px;
    padding-top: 8px;
    font-weight: 600;
}

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

.stat-value {
    color: var(--color-text);
    font-weight: 600;
    font-family: var(--font-mono);
}

.completion-rate {
    color: var(--color-success);
}

/* Funnel Actions */
.funnel-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    align-items: stretch;
}

.btn-small {
    padding: 10px 8px;
    font-size: 13px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-action {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 0;
}

.btn-action:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.btn-action.btn-delete {
    color: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-action.btn-delete:hover {
    background: var(--color-danger);
    color: white;
    border-color: var(--color-danger);
}

/* Responsive Dashboard */
@media (max-width: 1200px) {
    .funnels-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    #dashboard-container {
        padding: 16px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

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

    .funnel-card {
        padding: 16px;
    }

    .funnel-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .btn-small {
        font-size: 12px;
        padding: 8px 10px;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    margin: 20px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--color-text);
}

.modal-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.modal-step {
    transition: opacity 0.3s ease;
}

.modal-step.hidden {
    display: none;
}

.modal-info {
    background: var(--color-bg);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
}

.info-label {
    font-weight: 600;
    color: var(--color-text);
}

.info-value {
    font-family: var(--font-mono);
    color: var(--color-text-light);
}

.modal-body .json-editor {
    min-height: 400px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid var(--color-border);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }
}

/* Delete Confirmation Modal */
.modal-small {
    max-width: 500px;
}

.delete-warning {
    background-color: #fef2f2;
    border: 2px solid var(--color-error);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.delete-warning p {
    margin-bottom: 12px;
    color: var(--color-text);
}

.delete-warning strong {
    color: var(--color-error);
}

.delete-warning ul {
    margin-left: 24px;
    margin-top: 8px;
    color: var(--color-text-light);
}

.delete-warning li {
    margin-bottom: 4px;
}

.delete-error {
    background-color: #fee2e2;
    color: var(--color-error);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 12px;
}

/* Clickable Stats */
.stat-clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.stat-clickable:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.stat-link {
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

.stat-section-clickable {
    position: relative;
}

/* Leads Viewer Modal */
.modal-large {
    max-width: 1200px;
}

.leads-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.leads-stats {
    display: flex;
    gap: 12px;
}

.stat-badge {
    padding: 6px 16px;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.stat-badge:hover {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.stat-badge.active {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.data-table thead {
    background-color: var(--color-bg);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--color-text-light);
    border-bottom: 2px solid var(--color-border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

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

.data-table tbody tr:hover {
    background-color: var(--color-bg);
}

.type-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.type-actual {
    background-color: var(--color-success);
    color: white;
}

.type-test {
    background-color: var(--color-warning);
    color: white;
}

.btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.btn-link:hover {
    color: var(--color-primary-dark);
}

/* Lead Detail Overlay */
.lead-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lead-details {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.lead-details h3 {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 24px;
}

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

.detail-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
}

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

.detail-label {
    font-weight: 600;
    color: var(--color-text-light);
}

.detail-value {
    font-family: var(--font-mono);
    color: var(--color-text);
}

.answer-item {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--color-bg);
    border-radius: 8px;
}

.answer-question {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--color-text);
}

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

/* Responsive Leads Table */
@media (max-width: 768px) {
    .modal-large {
        width: 95%;
    }

    .leads-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .leads-stats {
        flex-wrap: wrap;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }

    .lead-details {
        padding: 20px;
    }
}

/* Form Inputs and Validation Errors */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    background: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.2s ease;
}

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

.form-input::placeholder {
    color: var(--color-text-light);
    opacity: 0.6;
}

.input-error {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.1);
    border-left: 3px solid #dc2626;
    border-radius: 4px;
    color: #dc2626;
    font-size: 14px;
    line-height: 1.4;
}

.input-error.hidden {
    display: none;
}

.input-help {
    margin-top: 12px;
    padding: 12px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--color-primary);
    border-radius: 4px;
    font-size: 14px;
    color: var(--color-text-light);
}

.input-help strong {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text);
}

.input-help ul {
    margin: 0;
    padding-left: 20px;
}

.input-help li {
    margin-bottom: 4px;
}

/* ========================================
   Users Admin Styles
   ======================================== */

.users-admin-container {
    padding: 24px;
    max-width: 1600px;
    margin: 0 auto;
}

/* Stats Grid */
.users-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-bottom: 4px;
}

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

.stat-card-primary .stat-card-value { color: var(--color-primary); }
.stat-card-success .stat-card-value { color: var(--color-success); }
.stat-card-warning .stat-card-value { color: var(--color-warning); }
.stat-card-info .stat-card-value { color: #3b82f6; }
.stat-card-danger .stat-card-value { color: var(--color-error); }

/* Users Toolbar */
.users-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.users-search {
    flex: 1;
    min-width: 250px;
}

.users-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.form-select {
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-body);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    min-width: 140px;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Users Table */
.users-table-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

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

.users-table thead {
    background: var(--color-bg);
}

.users-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.users-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.users-table th.sortable:hover {
    background: var(--color-border);
}

.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    vertical-align: middle;
}

.users-table tbody tr:hover {
    background: var(--color-bg);
}

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

/* User Cell Styles */
.user-email {
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 4px;
}

.user-org {
    font-weight: 500;
    color: var(--color-text);
}

.user-id {
    font-size: 12px;
    color: var(--color-text-light);
    font-family: var(--font-mono);
}

/* Plan Badges */
.plan-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

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

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

.plan-badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge-active {
    background: #d1fae5;
    color: #065f46;
}

.status-badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Leads Display */
.leads-at-limit {
    color: var(--color-error);
    font-weight: 600;
}

.leads-near-limit {
    color: var(--color-warning);
    font-weight: 500;
}

/* Features Cell */
.features-cell {
    font-size: 16px;
}

.features-cell span {
    margin-right: 4px;
    cursor: help;
}

/* User Detail Modal */
.user-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.user-detail-modal {
    background: var(--color-surface);
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.user-detail-modal .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-detail-modal .modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.user-detail-modal .modal-body {
    padding: 24px;
    overflow-y: auto;
}

.user-detail-modal .detail-section {
    margin-bottom: 24px;
}

.user-detail-modal .detail-section:last-child {
    margin-bottom: 0;
}

.user-detail-modal .detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.user-detail-modal .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.user-detail-modal .detail-row:last-child {
    border-bottom: none;
}

.user-detail-modal .detail-label {
    font-weight: 500;
    color: var(--color-text-light);
}

.user-detail-modal .detail-value {
    font-family: var(--font-mono);
    color: var(--color-text);
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

/* Navigation Tabs */
.admin-nav {
    display: flex;
    gap: 8px;
    background: var(--color-bg);
    padding: 8px;
    border-radius: 8px;
    margin-right: 16px;
}

.admin-nav-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    color: var(--color-text-light);
    transition: all 0.2s;
}

.admin-nav-btn:hover {
    background: var(--color-surface);
    color: var(--color-text);
}

.admin-nav-btn.active {
    background: var(--color-primary);
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .users-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .users-admin-container {
        padding: 16px;
    }

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

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

    .users-search {
        min-width: 100%;
    }

    .users-filters {
        justify-content: flex-start;
    }

    .users-table-container {
        overflow-x: auto;
    }

    .users-table {
        min-width: 800px;
    }

    .stat-card-value {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .users-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card-value {
        font-size: 20px;
    }
}

/* ========================================
   Bulk Actions & Multi-select
   ======================================== */

.bulk-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    margin-bottom: 16px;
}

.bulk-actions-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #92400e;
}

.bulk-actions-right {
    display: flex;
    gap: 8px;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-danger:disabled {
    background: #fca5a5;
    cursor: not-allowed;
}

/* Checkbox styling */
.checkbox-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    width: 20px;
    height: 20px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: white;
    border: 2px solid var(--color-border);
    border-radius: 4px;
    transition: all 0.2s;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--color-primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Funnel card checkbox */
.funnel-checkbox {
    margin-right: 10px;
    flex-shrink: 0;
}

.funnel-card .funnel-header {
    display: flex;
    align-items: center;
}

.funnel-card .funnel-header h3 {
    flex: 1;
    margin: 0;
}

/* Selected card state */
.funnel-card-selected {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2) !important;
    background: #eff6ff !important;
}

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
}

/* Modal close button */
.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 0 8px;
    transition: color 0.15s;
}

.modal-close:hover {
    color: var(--color-text);
}

/* Modal body */
.modal-body {
    padding: 24px;
}

/* Modal footer */
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   View Toggle (Grid/List)
   ======================================== */

.view-toggle {
    display: flex;
    background: var(--color-border);
    border-radius: 6px;
    padding: 2px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--color-text-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle-btn:hover {
    color: var(--color-text);
}

.view-toggle-btn.active {
    background: var(--color-surface);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* ========================================
   Funnels List View (Table)
   ======================================== */

.funnels-list-container {
    background: var(--color-surface);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.funnels-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.funnels-list-table th,
.funnels-list-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.funnels-list-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.funnels-list-table tbody tr:hover {
    background: #f8fafc;
    cursor: pointer;
}

.funnels-list-table tbody tr:last-child td {
    border-bottom: none;
}

/* Column widths */
.funnels-list-table .col-checkbox {
    width: 40px;
}

.funnels-list-table .col-name {
    min-width: 180px;
}

.funnels-list-table .col-id code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-text-light);
}

.funnels-list-table .col-leads {
    width: 100px;
    text-align: center;
}

.funnels-list-table .col-leads .lead-count {
    cursor: pointer;
    color: var(--color-primary);
    font-weight: 500;
}

.funnels-list-table .col-leads .lead-count:hover {
    text-decoration: underline;
}

.funnels-list-table .col-version {
    width: 80px;
    text-align: center;
}

.funnels-list-table .version-badge {
    display: inline-block;
    background: #e0e7ff;
    color: #4338ca;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.funnels-list-table .col-created {
    width: 120px;
    color: var(--color-text-light);
}

.funnels-list-table .col-actions {
    width: 140px;
    text-align: right;
}

/* Icon buttons for list view */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--color-text-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 14px;
}

.btn-icon:hover {
    background: #e2e8f0;
    color: var(--color-text);
}

.btn-icon-danger {
    color: #dc2626;
}

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

/* Selected row state */
.funnel-row-selected {
    background: #eff6ff !important;
}

.funnel-row-selected td:first-child {
    border-left: 3px solid var(--color-primary);
}

/* Responsive: Hide some columns on mobile */
@media (max-width: 768px) {
    .funnels-list-table .col-id,
    .funnels-list-table .col-version,
    .funnels-list-table .col-created {
        display: none;
    }

    .funnels-list-table th,
    .funnels-list-table td {
        padding: 10px 12px;
    }
}

/* ========================================
   Orphaned/Error Funnel Styling
   ======================================== */

/* Card view - orphaned funnel */
.funnel-card-orphaned {
    border-color: #fca5a5 !important;
    background: #fef2f2 !important;
}

.funnel-card-orphaned:hover {
    border-color: #f87171 !important;
}

.funnel-version-error {
    background: #dc2626 !important;
    color: white !important;
}

/* List view - orphaned row */
.funnel-row-orphaned {
    background: #fef2f2 !important;
}

.funnel-row-orphaned:hover {
    background: #fee2e2 !important;
}

.version-badge-error {
    background: #dc2626 !important;
    color: white !important;
}

.text-muted {
    color: var(--color-text-light);
    font-style: italic;
}

/* ========================================
   Paused Funnel Styling
   ======================================== */

/* Card view - paused funnel */
.funnel-card-paused {
    border-color: #dc2626 !important;
    border-width: 2px !important;
    background: #fef2f2 !important;
    opacity: 0.9;
}

.funnel-card-paused:hover {
    border-color: #b91c1c !important;
    opacity: 1;
}

/* Paused status badge (in header) - BIG AND RED */
.funnel-status {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse-badge 2s infinite;
}

.funnel-status-paused {
    background: #dc2626;
    color: white;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.5);
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* List view - paused row */
.funnel-row-paused {
    background: #fef2f2 !important;
}

.funnel-row-paused:hover {
    background: #fee2e2 !important;
}

/* Small status badge for list view - also red */
.status-badge-small {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
    animation: pulse-badge 2s infinite;
}

.status-paused {
    background: #dc2626;
    color: white;
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
}

/* Button variants for status toggle */
.btn-action-warning {
    color: #b45309 !important;
}

.btn-action-warning:hover {
    background: #fef3c7 !important;
}

.btn-action-success {
    color: #059669 !important;
}

.btn-action-success:hover {
    background: #d1fae5 !important;
}

/* Icon button color variants */
.btn-icon-warning {
    color: #b45309;
}

.btn-icon-warning:hover {
    background: #fef3c7;
    color: #b45309;
}

.btn-icon-success {
    color: #059669;
}

.btn-icon-success:hover {
    background: #d1fae5;
    color: #059669;
}

/* ========================================
   Search Box
   ======================================== */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    width: 200px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input::placeholder {
    color: var(--color-text-light);
}

.search-icon {
    position: absolute;
    left: 10px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0.5;
}

/* ========================================
   Sortable Table Headers
   ======================================== */

.funnels-list-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s;
}

.funnels-list-table th.sortable:hover {
    background: #e2e8f0;
}

.funnels-list-table th.sortable.sorted {
    background: #e0e7ff;
    color: var(--color-primary);
}

.sort-indicator {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.7;
}

/* ========================================
   Database Admin Styles
   ======================================== */

.database-admin-container {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

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

.database-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
}

.database-section {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    padding: 24px;
    margin-bottom: 24px;
}

.database-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
}

/* Encryption Summary Cards */
.encryption-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.encryption-summary .stat-card {
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.encryption-summary .stat-card-value {
    font-size: 24px;
    font-weight: 700;
}

.encryption-summary .stat-card-label {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 4px;
}

.stat-card-primary {
    background: #eff6ff;
    color: #1e40af;
}

.stat-card-success {
    background: #ecfdf5;
    color: #065f46;
}

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

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

.stat-card-info {
    background: #f0f9ff;
    color: #075985;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
}

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

.data-table code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.data-table-compact {
    font-size: 12px;
}

.data-table-compact th,
.data-table-compact td {
    padding: 6px 10px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

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

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

/* Tables Grid */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.table-card {
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.table-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.table-card-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.table-row-count {
    font-size: 12px;
    color: var(--color-text-light);
    background: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.table-card-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.column-tag {
    display: inline-block;
    background: white;
    border: 1px solid var(--color-border);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--color-text-light);
}

.column-pk {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.column-more {
    background: #f1f5f9;
    color: var(--color-text-light);
    font-style: italic;
}

/* Table Browser */
.table-browser-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.table-browser-header h3 {
    margin: 0;
}

.table-info-bar {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text);
    margin-bottom: 16px;
}

.table-scroll {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

.table-browser-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.pagination-info {
    font-size: 13px;
    color: var(--color-text-light);
}

/* Cell Value Formatting */
.null-value {
    color: #94a3b8;
    font-style: italic;
}

.bool-true {
    color: #059669;
    font-weight: 500;
}

.bool-false {
    color: #dc2626;
    font-weight: 500;
}

/* Empty/Error Messages */
.empty-message {
    text-align: center;
    padding: 24px;
    color: var(--color-text-light);
    font-style: italic;
}

.error-message {
    color: #dc2626;
    background: #fef2f2;
    padding: 12px;
    border-radius: 6px;
}

/* Encryption Table Container */
.encryption-table-container {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

/* Button Small */
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Loading Spinner for Database Admin */
.database-admin-container .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .database-admin-container {
        padding: 16px;
    }

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

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

    .table-info-bar {
        flex-direction: column;
        gap: 8px;
    }
}

/* ========================================
   Rename Modal Styles
   ======================================== */

.rename-info {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.rename-info p {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.rename-info p:last-child {
    margin-bottom: 0;
}

.rename-warning {
    color: #b45309;
    background: #fef3c7;
    padding: 8px 12px;
    border-radius: 4px;
    margin-top: 12px !important;
    font-size: 13px !important;
}

.form-hint {
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 6px;
}

.form-hint code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.rename-validation {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
    min-height: 36px;
}

.validation-info {
    background: #f0f9ff;
    color: #075985;
}

.validation-error {
    background: #fef2f2;
    color: #991b1b;
}

.validation-success {
    background: #ecfdf5;
    color: #065f46;
}

.rename-status {
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
}

.status-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

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

/* Modal small size adjustment */
.modal-content.modal-small {
    max-width: 500px;
}
