/* ==========================================================
   BizzOn TD-Report Design System
   Left Sidebar + Protected Viewer Layout
   ========================================================== */

:root {
    --bg-base: #090d16;
    --bg-sidebar: #0b1120;
    --bg-card: rgba(15, 23, 42, 0.75);
    --bg-input: rgba(15, 23, 42, 0.6);
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.35);
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);
    --primary-hover: #1d4ed8;
    
    --accent: #38bdf8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(59, 130, 246, 0.6);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    
    --sidebar-width: 290px;
    --header-height: 64px;
    
    --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 25px rgba(59, 130, 246, 0.08);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================
   Background Ambient Blobs & Effects
   ========================================================== */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #2563eb, #0284c7);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #6366f1, #3b82f6);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #0ea5e9, #06b6d4);
    top: 40%;
    left: 60%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(40px, 30px) scale(1.1); }
    100% { transform: translate(-30px, 50px) scale(0.95); }
}

/* ==========================================================
   Auth / Login Page
   ========================================================== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(ellipse at top, #111a2e 0%, #090d16 100%);
}

.auth-container {
    width: 100%;
    max-width: 460px;
    z-index: 1;
    position: relative;
    animation: fadeIn 0.5s ease;
}

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

.auth-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-card);
}

.brand-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.brand-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    margin-bottom: 8px;
}

.brand-title span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Forms & Inputs */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 44px;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(15, 23, 42, 0.85);
}

.input-wrapper input::placeholder {
    color: var(--text-dim);
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    pointer-events: none;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--text-main);
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    user-select: none;
    font-size: 0.85rem;
    color: var(--text-muted);
    gap: 10px;
}

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

.checkmark {
    width: 18px;
    height: 18px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.checkbox-container input:checked ~ .checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 13px 22px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.5);
}

.btn-primary:hover {
    box-shadow: 0 12px 25px -4px rgba(37, 99, 235, 0.65);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    margin-bottom: 20px;
}

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

.alert-info {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #7dd3fc;
}

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

.auth-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* ==========================================================
   Dashboard with Left Sidebar Layout
   ========================================================== */
.sidebar-layout {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
}

/* Left Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    z-index: 150;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-text .company {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #ffffff;
    line-height: 1.1;
}

.logo-text .portal {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--accent);
}

.btn-close-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 10px 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    text-transform: uppercase;
}

.badge-count {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
}

/* Sidebar Navigation Items */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-muted);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.06);
}

.sidebar-nav-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.22) 0%, rgba(56, 189, 248, 0.12) 100%);
    border-color: rgba(59, 130, 246, 0.45);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
}

.nav-item-num {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.sidebar-nav-item:hover .nav-item-num {
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.3);
}

.sidebar-nav-item.active .nav-item-num {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.nav-item-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.nav-item-title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.sidebar-nav-item.active .nav-item-desc {
    color: #93c5fd;
}

.active-indicator {
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: var(--accent);
    position: absolute;
    right: 10px;
    box-shadow: 0 0 8px var(--accent);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(2, 6, 23, 0.3);
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
}

.user-status-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.user-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6ee7b7;
}

.user-sub {
    font-size: 0.7rem;
    color: var(--text-dim);
}

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

.sidebar-action-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.sidebar-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.btn-logout-sidebar {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.08);
}

.btn-logout-sidebar:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
}

/* ==========================================================
   Main Content Area
   ========================================================== */
.app-main-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: #0f172a;
}

.main-top-header {
    height: var(--header-height);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    z-index: 100;
}

.header-left-meta {
    display: flex;
    align-items: center;
    gap: 14px;
}

.btn-toggle-sidebar {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.report-badge {
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.report-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.header-right-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================
   Viewer Iframe Container
   ========================================================== */
.viewer-main-container {
    flex: 1;
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: #f8fafc;
    overflow: hidden;
}

.iframe-wrapper {
    width: 100%;
    height: 100%;
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    gap: 12px;
}

.empty-state h2 {
    color: #1e293b;
    font-size: 1.25rem;
}

/* ==========================================================
   Modal Dialog
   ========================================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: #0f172a;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

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

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.btn-close-modal:hover {
    color: #ffffff;
}

.modal-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-body input {
    width: 100%;
    background: rgba(2, 6, 23, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.modal-body input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: rgba(2, 6, 23, 0.4);
    border-top: 1px solid var(--border-subtle);
}

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

/* ==========================================================
   Mobile Responsive Adjustments
   ========================================================== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 140;
}

@media (max-width: 900px) {
    .btn-toggle-sidebar {
        display: flex;
    }
    
    .btn-close-sidebar {
        display: block;
    }
    
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
    }
    
    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
    }
    
    .sidebar-backdrop.open {
        display: block;
    }
    
    .btn-text {
        display: none;
    }
    
    .main-top-header {
        padding: 0 16px;
    }
    
    .report-heading {
        font-size: 1rem;
    }
}
