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

:root {
    --bg: #f0f4f8;
    --bg-white: #ffffff;
    --bg-sidebar: #1a365d;
    --primary: #2b6cb0;
    --primary-dark: #1a4e8a;
    --primary-light: #ebf4ff;
    --text: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;
    --border: #e2e8f0;
    --success: #38a169;
    --danger: #e53e3e;
    --warning: #d69e2e;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

/* Top bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-sidebar);
    padding: 0 2rem;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-brand {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.med-icon { font-size: 1.3rem; }
.med-icon.lg { font-size: 2.5rem; }

.topbar-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.topbar-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.topbar-link:hover, .topbar-link.active {
    color: white;
    background: rgba(255,255,255,0.1);
}

.topbar-user {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
}

.topbar-btn, .topbar-btn-outline {
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 0.35rem 1rem;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.topbar-btn {
    background: var(--primary);
}

.topbar-btn:hover {
    background: var(--primary-dark);
}

.topbar-btn-outline {
    border: 1px solid rgba(255,255,255,0.3);
}

.topbar-btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

/* Content */
.content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--text);
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; text-align: center; }
.btn-lg { padding: 0.7rem 2rem; font-size: 1rem; }

.btn-outline-sm {
    background: none;
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.85rem;
}

.btn-outline-sm:hover {
    background: var(--primary-light);
}

/* Tables */
.data-table {
    width: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-collapse: collapse;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table thead {
    background: #f7fafc;
}

.data-table th {
    padding: 0.7rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #f7fafc; }

/* Search */
.search-form { margin-bottom: 1.5rem; }

.search-bar {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: var(--bg-white);
    box-shadow: var(--shadow);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.15);
}

/* Reports */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.report-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.report-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.dept-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.report-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(43, 108, 176, 0.15);
}

/* Report output */
.report-output {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    min-height: 200px;
}

/* Alert */
.alert {
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-danger {
    background: #fed7d7;
    color: var(--danger);
    border: 1px solid #feb2b2;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Login */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
}

.login-container { width: 100%; max-width: 400px; padding: 1.5rem; }

.login-card {
    background: var(--bg-white);
    border-radius: 10px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 { font-size: 1.4rem; margin: 0.5rem 0 0.2rem; }
.login-header p { color: var(--text-secondary); font-size: 0.9rem; }

.login-form { display: flex; flex-direction: column; gap: 1rem; }

.login-help {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.login-help code {
    background: #f7fafc;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.8rem;
    color: var(--primary);
}

/* Landing */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
}

.landing-card {
    text-align: center;
    max-width: 600px;
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.shield-icon { font-size: 3rem; margin-bottom: 1rem; }

.landing-card h1 {
    font-size: 2rem;
    color: var(--bg-sidebar);
}

.landing-card h2 {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 1rem;
}

.landing-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.landing-features {
    text-align: left;
    margin-bottom: 2rem;
}

.lf-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.lf-item:last-child { border-bottom: none; }

.lf-icon { font-size: 1.5rem; }

.lf-item strong { font-size: 0.95rem; }
.lf-item p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.1rem; }

.landing-notice {
    max-width: 600px;
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    background: #fffbeb;
    border: 1px solid #fbd38d;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: #744210;
}

.landing-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
}

@media (max-width: 768px) {
    .report-grid { grid-template-columns: 1fr; }
    .topbar { padding: 0 1rem; }
    .topbar-links { gap: 0.5rem; }
    .content { padding: 1rem; }
}
