/* Global Styles - Modern Blue Theme */
:root {
    --primary-blue: #2563EB;
    --primary-blue-hover: #1D4ED8;
    --primary-blue-light: #DBEAFE;
    --bg-gray: #F8FAFC;
    --bg-white: #FFFFFF;
    --text-dark: #1E293B;
    --text-gray: #64748B;
    --border-gray: #E2E8F0;
    --success-green: #10B981;
    --warning-orange: #F59E0B;
    --error-red: #EF4444;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --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);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-gray);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    /* Match light, clean background like the reference */
    background: var(--bg-gray);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
}

.login-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.login-title {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

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

.link-primary {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.link-primary:hover {
    text-decoration: underline;
}

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

/* Add extra spacing before buttons */
.login-form .btn {
    margin-top: 20px;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    outline: none;
    transition: all 0.2s;
}

.form-input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

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

/* Buttons */
.btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background-color: var(--primary-blue-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background-color: var(--text-gray);
    cursor: not-allowed;
    transform: none;
}

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

.btn-secondary:hover {
    background-color: var(--bg-gray);
}

.btn-full {
    width: 100%;
}

.btn-logout {
    padding: 8px 16px;
    background: none;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: var(--bg-gray);
}

.btn-icon {
    display: inline-flex;
    padding: 6px;
    background: none;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: var(--bg-gray);
    color: var(--primary-blue);
}

/* Sidebar Layout */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-gray);
    padding: 24px 0;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    margin-bottom: 32px;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-gray);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

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

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

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 24px;
    min-height: 100vh;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

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

.user-menu span {
    font-weight: 500;
    color: var(--text-dark);
}

/* Cards */
.card {
    background-color: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    padding: 24px;
}

.button-group {
    display: flex;
    gap: 12px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    background-color: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

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

.metric-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
}

.metric-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-dark);
}

.metric-value.small {
    font-size: 20px;
}

/* Date Inputs */
.date-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 16px;
    align-items: end;
}

/* Make the Generate button visually match the date input height */
.date-inputs .btn {
    height: 50px;
    padding-top: 0;
    padding-bottom: 0;
}

/* Ensure the specific Generate button gets the intended height */
#generateBtn {
    height: 50px !important;
    padding-top: 0;
    padding-bottom: 0;
}

/* Match input height locally within the date picker row only */
.date-inputs .form-input {
    height: 50px;
}



/* Table */
.table-container {
    overflow-x: auto;
}

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

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

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.table-footer {
    padding: 12px 24px;
    border-top: 1px solid var(--border-gray);
    font-size: 14px;
    color: var(--text-gray);
}

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

/* Pagination bar */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-gray);
    border-radius: 0 0 8px 8px;
    gap: 12px;
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-size: 14px;
}

.pagination-select {
    padding: 6px 10px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    min-height: 36px;
}

.pagination-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    color: var(--text-dark);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background-color: var(--bg-gray);
    border-color: var(--primary-blue);
}

.pagination-separator {
    width: 1px;
    height: 20px;
    background-color: var(--border-gray);
}

.pagination-center {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-size: 14px;
}

.pagination-input {
    width: 70px;
    padding: 6px 10px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    min-height: 36px;
    text-align: center;
}

/* Header Controls */
.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-gray);
    z-index: 1;
}

.search-input {
    padding: 8px 12px 8px 40px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    background-color: white;
    font-size: 14px;
    min-height: 36px;
    width: 200px;
}

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

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Modal styles - Recreated to match reference design exactly */
.modal-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: 9999;
    backdrop-filter: blur(2px);
}

.modal {
    position: relative;
    width: 700px;
    max-width: 90vw;
    max-height: 85vh;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 28px 32px 16px 32px;
    border-bottom: none;
    background: #FFFFFF;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #000000;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.modal-subtitle {
    font-size: 13px;
    color: #000000;
    font-weight: 400;
    margin-top: 4px;
    line-height: 1.4;
}

.modal-body {
    padding: 8px 32px 32px 32px;
    flex: 1;
    overflow-y: auto;
    background: #F9FAFB;
}

/* Individual file item in modal - white card style */
.modal-list-item {
    display: block;
    padding: 24px 26px;
    margin-bottom: 16px;
    background: #FFFFFF;
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.modal-list-item:last-child {
    margin-bottom: 0;
}

/* Row-based layout for file info */
.modal-file-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 20px;
}

.modal-file-row:last-of-type {
    margin-bottom: 20px;
}

.modal-file-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-info-label {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.modal-info-value {
    font-size: 15px;
    color: #111827;
    font-weight: 600;
    line-height: 1.4;
}

/* Download report button - styled to match reference */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.download-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.download-btn:hover {
    background: #E5E7EB;
    border-color: #9CA3AF;
}

/* Close button in header */
.modal-header .btn-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #9CA3AF;
    font-size: 28px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.modal-header .btn-icon:hover {
    background: #F3F4F6;
    color: #111827;
}

/* Modal Form Styles */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

.modal-form .form-input {
    padding: 12px 16px;
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

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

.modal-form select.form-input {
    cursor: pointer;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border-gray);
}

/* Status Messages */
.status-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    display: none;
}

.status-message.info {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

.status-message.success {
    background-color: #D1FAE5;
    color: var(--success-green);
    border: 1px solid var(--success-green);
}

.status-message.error {
    background-color: #FEE2E2;
    color: var(--error-red);
    border: 1px solid var(--error-red);
}

.error-message {
    background-color: #FEE2E2;
    color: var(--error-red);
    border: 1px solid var(--error-red);
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
}

.success-message {
    background-color: #F0FDF4;
    border: 1px solid #BBF7D0;
    color: #166534;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 16px;
}

/* Progress Bar Styles */
.loading-progress {
    background: var(--bg-white);
    border: 1px solid var(--border-gray);
    border-radius: 12px;
    padding: 24px;
    margin-top: 16px;
    box-shadow: var(--shadow);
}

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

.progress-header span:first-child {
    font-weight: 600;
    color: var(--text-dark);
}

.progress-header span:last-child {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 18px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--bg-gray);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-blue), #3B82F6);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.step {
    text-align: center;
    padding: 12px 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
    background-color: var(--bg-gray);
    transition: all 0.3s ease;
}

.step.active {
    background-color: var(--primary-blue-light);
    color: var(--primary-blue);
    font-weight: 600;
}

/* Button Improvements */
.btn-success {
    background-color: var(--success-green);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success:disabled {
    background-color: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* File naming improvements */
.report-filename {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    color: var(--text-gray);
    background-color: var(--bg-gray);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid var(--border-gray);
}

/* Admin delete button */
.btn-danger {
    background-color: var(--error-red);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.btn-danger:hover {
    background-color: #DC2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger:disabled {
    background-color: #9CA3AF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Simple Dialog - Clean and minimal design */
.simple-dialog {
    position: relative;
    width: 420px;
    max-width: 90vw;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px 36px 32px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: dialogFadeIn 0.3s ease-out;
}

@keyframes dialogFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.simple-icon-wrapper {
    margin-bottom: 24px;
}

.simple-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.simple-icon.success {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
}

.simple-icon.warning {
    background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
    color: #C2185B;
}

.simple-title {
    font-size: 22px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0 0 14px 0;
    letter-spacing: -0.3px;
}

.simple-message {
    font-size: 15px;
    color: #666666;
    margin: 0 0 28px 0;
    line-height: 1.6;
    max-width: 340px;
}

.simple-primary-btn {
    width: 100%;
    padding: 13px 28px;
    background: #2196F3;
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.simple-primary-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.simple-primary-btn.danger {
    background: #E91E63;
    box-shadow: 0 2px 8px rgba(233, 30, 99, 0.3);
}

.simple-primary-btn.danger:hover {
    background: #C2185B;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
}

.simple-secondary-btn {
    width: 100%;
    padding: 13px 28px;
    background: #F5F5F5;
    color: #666666;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.simple-secondary-btn:hover {
    background: #EEEEEE;
    color: #424242;
    border-color: #BDBDBD;
}

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

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

/* Responsive */
/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    cursor: pointer;
    padding: 8px;
    color: #333;
    background: none;
    border: none;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .date-inputs {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .step {
        font-size: 12px;
        padding: 8px 6px;
    }
}

