/* BMN Report Generator - Modern Corporate Theme */

:root {
    --primary: #1F4E79;
    --primary-dark: #163A5C;
    --primary-light: #2D6BA4;
    --secondary: #0D2137;
    --accent: #4A90D9;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --purple: #8B5CF6;

    --bg-dark: #0F1419;
    --bg-card: #1A2332;
    --bg-card-hover: #243447;
    --border-color: #2D3F52;

    --text-primary: #FFFFFF;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --sidebar-width: 260px;
    --header-height: 70px;
    --radius: 12px;
    --radius-sm: 8px;

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--secondary) 0%, var(--bg-dark) 100%);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

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

.logo {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo svg {
    width: 24px;
    height: 24px;
    color: white;
}

.logo-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

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

.nav-item.active {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: var(--shadow);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.top-bar {
    height: var(--header-height);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-bar h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Sections */
.section {
    display: none;
    padding: 32px;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10B981, #059669);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
}

.stat-info {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

.mt-4 {
    margin-top: 24px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

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

.table th {
    background: var(--secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

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

.table td {
    font-size: 0.9rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--primary);
    color: white;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 78, 121, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

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

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

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

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* Generate Grid */
.generate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.generate-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

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

.generate-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.generate-icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.generate-card h4 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.generate-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    min-height: 40px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    border-left: 4px solid var(--success);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .section {
        padding: 16px;
    }

    .stats-grid,
    .generate-grid {
        grid-template-columns: 1fr;
    }
}

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

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

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

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

/* Number formatting */
.number {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
}

/* Upload boxes */
.upload-container {
    max-width: 900px;
    margin: 0 auto;
}

.upload-info {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.template-downloads {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 16px;
    background: var(--secondary);
    border-radius: var(--radius-sm);
}

.template-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.upload-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.upload-box {
    background: var(--secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-box:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
}

.upload-box.selected {
    border-color: var(--success);
    border-style: solid;
    background: rgba(16, 185, 129, 0.1);
}

.upload-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-icon svg {
    width: 28px;
    height: 28px;
    color: var(--primary);
}

.upload-box h4 {
    margin-bottom: 8px;
}

.upload-box p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.file-name {
    display: block;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.upload-actions {
    text-align: center;
    margin-top: 24px;
}

/* Generate preview */
.generate-container {
    max-width: 800px;
    margin: 0 auto;
}

.generate-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 32px 0;
}

.preview-sheet {
    background: var(--secondary);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.preview-sheet h4 {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 4px;
}

.preview-sheet p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .upload-grid {
        grid-template-columns: 1fr;
    }

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