/* ============================================
   Transparency Analytics — Client Portal
   Clean, professional, mobile-responsive
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2d3748;
    background: #f7f8fa;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #2b6cb0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Header --- */
.site-header {
    background: #1a2332;
    color: #fff;
    padding: 0 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: relative;
    z-index: 100;
    border-top: 3px solid #3182ce;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 1rem;
}

.brand-link {
    color: #fff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-link:hover {
    text-decoration: none;
    opacity: 0.9;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.brand-tagline {
    font-size: 0.75rem;
    color: #a0aec0;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-greeting {
    font-size: 0.9rem;
    color: #cbd5e0;
    white-space: nowrap;
}

/* --- Header Login Form --- */
.header-login-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Inputs --- */
.input-sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    border: 1px solid #4a5568;
    border-radius: 4px;
    background: #2d3748;
    color: #fff;
    width: 140px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-sm::placeholder {
    color: #a0aec0;
}

.input-sm:focus {
    outline: none;
    border-color: #63b3ed;
    box-shadow: 0 0 0 2px rgba(99, 179, 237, 0.3);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: #3182ce;
    color: #fff;
}

.btn-primary:hover {
    background: #2b6cb0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-outline {
    background: transparent;
    color: #cbd5e0;
    border: 1px solid #4a5568;
}

.btn-outline:hover {
    background: #2d3748;
    color: #fff;
}

.btn-success {
    background: #38a169;
    color: #fff;
}

.btn-success:hover {
    background: #2f855a;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* --- Main Content --- */
.site-main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* --- Flash Messages --- */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border-left: 4px solid;
    animation: flashIn 0.3s ease-out;
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.flash-error {
    background: #fff5f5;
    color: #c53030;
    border-left-color: #c53030;
}

.flash-success {
    background: #f0fff4;
    color: #276749;
    border-left-color: #38a169;
}

.flash-info {
    background: #ebf8ff;
    color: #2b6cb0;
    border-left-color: #3182ce;
}

/* --- Splash Page --- */
.splash {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.splash-content {
    max-width: 600px;
    padding: 2rem 0;
}

.splash h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1a2332;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.splash-lead {
    font-size: 1.15rem;
    color: #4a5568;
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.splash-sub {
    font-size: 1rem;
    color: #718096;
    margin-bottom: 2rem;
}

.splash-contact {
    font-size: 0.85rem;
    color: #a0aec0;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.splash-contact a {
    color: #3182ce;
}

/* --- Dashboard --- */
.dashboard-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a2332;
}

.file-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.file-section-header {
    background: #edf2f7;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0;
}

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

.file-table th {
    text-align: left;
    padding: 0.65rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
    background: #f7fafc;
}

.file-table td {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    border-bottom: 1px solid #edf2f7;
    color: #4a5568;
}

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

.file-table tr:hover td {
    background: #f7fafc;
}

.file-table td:first-child {
    font-weight: 500;
    color: #2d3748;
}

.file-empty {
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: #a0aec0;
    font-size: 0.9rem;
    font-style: italic;
}

.download-link {
    color: #3182ce;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: background 0.15s;
}

.download-link:hover {
    color: #2b6cb0;
    background: #ebf8ff;
    text-decoration: none;
}

/* --- Upload Form --- */
.upload-section {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.upload-section h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #2d3748;
}

.upload-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.upload-form input[type="file"] {
    font-size: 0.85rem;
    color: #4a5568;
}

.upload-hint {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 0.5rem;
    width: 100%;
}

/* --- Footer --- */
.site-footer {
    background: #1a2332;
    color: #a0aec0;
    padding: 1.25rem 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Mobile Login Form (shown below header on small screens) --- */
.mobile-login {
    display: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .header-login-form {
        display: none;
    }

    .mobile-login {
        display: block;
        background: #243044;
        padding: 1.25rem 1.5rem;
        margin: -2rem -1.5rem 1.5rem;
        border-bottom: 1px solid #2d3748;
    }

    .mobile-login-form {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        max-width: 400px;
        margin: 0 auto;
    }

    .mobile-login-form .input-sm {
        width: 100%;
        padding: 0.65rem 0.8rem;
        font-size: 1rem;
        background: #1a2332;
    }

    .mobile-login-form .btn {
        width: 100%;
        padding: 0.65rem;
        font-size: 1rem;
    }

    .splash h1 {
        font-size: 1.5rem;
    }

    .splash-lead {
        font-size: 1rem;
    }

    .splash {
        min-height: 50vh;
    }

    .file-table th:nth-child(2),
    .file-table td:nth-child(2) {
        display: none;
    }

    .header-inner {
        min-height: 56px;
    }

    .brand-name {
        font-size: 1.1rem;
    }

    .user-greeting {
        font-size: 0.8rem;
    }

    .upload-form {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .site-main {
        padding: 1.25rem 1rem;
    }

    .mobile-login {
        margin: -1.25rem -1rem 1rem;
    }

    .file-table th:nth-child(3),
    .file-table td:nth-child(3) {
        display: none;
    }

    .file-section-header {
        font-size: 0.85rem;
        padding: 0.65rem 1rem;
    }

    .file-table th,
    .file-table td {
        padding: 0.5rem 1rem;
    }
}
