:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-bg: #f8f9fa;
}

body {
    background: #f8f9fa;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

.main-container {
    display: flex;
    flex-direction: column;
    background: white;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.header {
    background:
        radial-gradient(
            circle at top left,
            rgba(52, 152, 219, 0.22),
            transparent 26rem
        ),
        #0f172a;
    color: white;
    padding: 0.75rem 1.25rem;
    text-align: left;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header h1 {
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.header p {
    margin: 0.15rem 0 0 0;
    opacity: 0.72;
    font-size: 0.78rem;
}

.content-area {
    flex: 1 0 auto;
    padding: 1.25rem;
    min-height: 0;
}

.upload-zone {
    border: 3px dashed #dee2e6;
    border-radius: 10px;
    padding: 3rem;
    text-align: center;
    background: var(--light-bg);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-zone:hover {
    border-color: var(--secondary-color);
    background: #e3f2fd;
}

.upload-zone.dragover {
    border-color: var(--success-color);
    background: #e8f5e8;
}

.btn-primary {
    background: var(--secondary-color);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 500;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.category-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.9rem;
}

.category-1 {
    background: #ffebee;
    color: #c62828;
}
.category-2 {
    background: #fff3e0;
    color: #ef6c00;
}
.category-3 {
    background: #e8f5e8;
    color: #2e7d32;
}
.category-4 {
    background: #f3e5f5;
    color: #7b1fa2;
}

.processing-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
}

.processing-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.alert {
    border-radius: 10px;
    border: none;
}

.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: var(--light-bg);
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #ffffff;
    color: #a6a6a6;
    padding: 0.45rem 1.25rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.72rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.footer p {
    margin: 0;
}

.footer-brand {
    color: #4d4d4d;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.footer-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
}

.footer-dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: #d8d8d8;
}

.file-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.result-section {
    margin-bottom: 2rem;
}

.result-section h5 {
    color: var(--primary-color);
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.app-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.app-title {
    min-width: 0;
}

.app-title h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-header-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    min-width: 0;
}

.org-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 320px;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.78rem;
    white-space: nowrap;
}

.org-pill-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.plan-pill {
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    font-size: 0.68rem;
    font-weight: 700;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 34px;
    max-width: 280px;
    padding: 0.25rem 0.55rem 0.25rem 0.3rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    font-size: 0.82rem;
}

.user-menu-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.user-menu-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-btn:hover,
.user-menu-btn:focus {
    color: white;
    background: rgba(255, 255, 255, 0.14);
}

.user-dropdown-menu {
    min-width: 290px;
    padding: 0.45rem;
    border: 1px solid #eeeeee;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
}

.user-dropdown-summary {
    display: grid;
    gap: 0.18rem;
    margin-bottom: 0.35rem;
    padding: 0.75rem;
    border-radius: 13px;
    background: #f5f5f5;
}

.user-dropdown-summary strong {
    color: #000000;
    font-size: 0.9rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-summary span {
    color: #8d8d8d;
    font-size: 0.76rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-org {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    max-width: 100%;
    margin-top: 0.25rem;
    padding: 0.28rem 0.5rem;
    border-radius: 999px;
    background: #ffffff;
    color: #4d4d4d;
    font-size: 0.72rem;
    font-weight: 700;
}

.user-dropdown-item,
.user-dropdown-logout {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 38px;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #1f1f1f;
    font-size: 0.82rem;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
}

.user-dropdown-item i,
.user-dropdown-logout i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 9px;
    background: #f5f5f5;
    color: #465ad8;
    font-size: 0.75rem;
}

.user-dropdown-item:hover,
.user-dropdown-item:focus,
.user-dropdown-logout:hover,
.user-dropdown-logout:focus {
    background: #fafbff;
    color: #000000;
}

.user-dropdown-logout {
    color: #b42318;
}

.user-dropdown-logout i {
    color: #b42318;
}

.user-dropdown-divider {
    margin: 0.35rem 0;
    border-top: 1px solid #eeeeee;
}

.auth-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 768px) {
    .header {
        padding: 0.7rem 0.9rem;
    }

    .app-header-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .content-area {
        padding: 0.9rem;
    }

    .footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
        padding: 0.45rem 0.9rem;
    }
}
