/* === BUBU DATA CSS === */
/* Hell, professionell, clean — Akzentfarbe: #10b981 */

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --primary-light: #d1fae5;
    --bg: #f9fafb;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --error: #ef4444;
    --error-bg: #fef2f2;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --radius: 10px;
    --radius-sm: 6px;
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
}

/* === Auth Page === */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f0fdf4 0%, #f9fafb 100%);
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
}

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

.auth-logo h1 {
    font-size: 1.75rem;
    color: var(--text);
    margin-top: 0.5rem;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.auth-hint {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.auth-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

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

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
}

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

/* === Forms === */
.form-group {
    margin-bottom: 1rem;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: 'Nunito', sans-serif;
    background: var(--card-bg);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-group {
    display: flex;
    gap: 1.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: background 0.15s, transform 0.05s;
    text-decoration: none;
}

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

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

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

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

.btn-secondary:hover:not(:disabled) {
    background: #d1d5db;
}

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

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

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* === Alerts === */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    white-space: pre-line;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid #fecaca;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #a7f3d0;
}

/* === QR Code Section === */
.qr-section {
    text-align: center;
    margin: 1.5rem 0;
}

.qr-code {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 0 auto 1rem;
}

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

.secret-display p {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.totp-secret {
    display: inline-block;
    font-family: monospace;
    font-size: 0.875rem;
    background: var(--bg);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    user-select: all;
}

/* === Dashboard Layout === */
.dashboard-page {
    background: var(--bg);
}

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

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

.sidebar-logo {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo span {
    font-family: 'Quicksand', sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: background 0.1s, color 0.1s;
    margin-bottom: 0.25rem;
}

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

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.nav-item.logout-link {
    color: var(--error);
}

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

.storage-info {
    margin-bottom: 0.75rem;
}

.storage-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.375rem;
}

.storage-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.375rem;
}

.storage-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
}

.storage-bar-large {
    height: 10px;
    margin: 0.5rem 0;
}

.storage-text {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* === Main Content === */
.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

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

.content-header h1 {
    font-size: 1.5rem;
    color: var(--text);
}

.header-right .user-email {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* === Upload Zone === */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 1rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone p {
    color: var(--text-light);
    margin-top: 0.5rem;
}

.upload-link {
    color: var(--primary);
    font-weight: 600;
}

.upload-hint {
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.upload-folder-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.upload-folder-select label {
    font-size: 0.875rem;
    font-weight: 600;
}

.upload-folder-select select {
    padding: 0.375rem 0.625rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

/* === Data Table === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

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

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

.data-table td.actions {
    white-space: nowrap;
}

/* === Buttons in Table === */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: background 0.1s;
    text-decoration: none;
    color: var(--text-light);
    margin-right: 0.25rem;
}

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

.btn-delete:hover {
    background: var(--error-bg);
    color: var(--error);
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--error-bg);
    color: var(--error);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
    font-size: 0.9375rem;
}

/* === Action Bar === */
.action-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form input,
.inline-form select {
    padding: 0.5rem 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.inline-form input {
    min-width: 200px;
}

.agent-count {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* === MCP Info Box === */
.mcp-info-box {
    background: var(--primary-light);
    border: 1px solid #a7f3d0;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.mcp-info-box h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.mcp-info-box p {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.mcp-url {
    display: inline-block;
    background: white;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    cursor: pointer;
    user-select: all;
    word-break: break-all;
}

.mcp-hint {
    color: var(--text-light);
    font-size: 0.8125rem;
}

/* === Account Section === */
.account-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.account-section h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.account-form {
    max-width: 400px;
}

/* === Modal === */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
}

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

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

/* === Token Display === */
.token-display {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--warning-bg);
    border: 1px solid #fde68a;
    border-radius: var(--radius-sm);
}

.token-display h3 {
    color: var(--warning);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.token-value {
    display: block;
    font-family: monospace;
    font-size: 0.875rem;
    background: white;
    padding: 0.625rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    word-break: break-all;
    cursor: pointer;
    user-select: all;
    margin-bottom: 0.5rem;
}

.token-display p {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* === Admin === */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.admin-form {
    margin-bottom: 1rem;
}

.admin-footer {
    text-align: center;
    margin-top: 1.5rem;
}

.admin-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* === Responsive === */
@media (max-width: 768px) {
    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    
    .sidebar-nav {
        display: flex;
        gap: 0.25rem;
        padding: 0.5rem;
        overflow-x: auto;
    }
    
    .nav-item {
        margin-bottom: 0;
        white-space: nowrap;
    }
    
    .sidebar-footer {
        border-top: 1px solid var(--border);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .storage-info {
        flex: 1;
        margin-bottom: 0;
        margin-right: 1rem;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .dashboard-layout {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.8125rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.625rem;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .upload-zone {
        padding: 1.5rem 1rem;
    }
}
/* === BUBU DATA Brand Footer === */
.brand-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}
.brand-footer a {
    color: #10b981;
    text-decoration: none;
    font-weight: 600;
}
.brand-footer a:hover {
    text-decoration: underline;
}
