/* WUS Group CRM - Master Production Stylesheet 
   Client: W.U. Seneviratne & Company (Pvt) Ltd.
   Developed by: Hasantha Ranatunga (Leading Edge Solutions)
*/

:root {
    --brand-navy: #0a2540;
    --accent-blue: #0061ff;
    --accent-hover: #0052d6;
    --text-main: #2d3748;
    --text-muted: #718096;
    --bg-light: #f8f9fc;
    --white: #ffffff;
    --border-color: #edf2f7;
    --success-green: #48bb78;
    --warning-yellow: #f6ad55;
    --danger-red: #f56565;
}

/* 1. Global Reset & Base Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 2. Header & Navigation (Categorized) */
.main-header {
    background: var(--white);
    border-bottom: 2px solid var(--border-color);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo-box {
    background: var(--brand-navy);
    color: var(--white);
    font-weight: 800;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.2rem;
}

.brand-text b {
    display: block;
    color: var(--brand-navy);
    font-size: 1.1rem;
    line-height: 1.2;
}

.brand-text span {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 25px;
    list-style: none;
}

.nav-menu a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-menu a:hover { color: var(--accent-blue); }

/* --- Dropdown Navigation Logic --- */
.nav-item-dropdown { position: relative; display: inline-block; }

.dropdown-trigger { 
    cursor: pointer; 
    color: #4a5568;
    font-weight: 600;
    font-size: 0.9rem;
    padding-right: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.dropdown-trigger::after {
    content: '▾';
    font-size: 0.8rem;
    opacity: 0.5;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--white);
    min-width: 200px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 10px 0;
    z-index: 1001;
    top: 100%;
    left: 0;
}

.dropdown-content a {
    color: var(--text-main) !important;
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
}

.dropdown-content a:hover {
    background-color: var(--bg-light);
    color: var(--accent-blue) !important;
}

.nav-item-dropdown:hover .dropdown-content { display: block; }

.system-date {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    background: #f7fafc;
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name { font-weight: 700; color: var(--brand-navy); }
.logout-btn { color: var(--danger-red) !important; font-weight: 700; }

/* 3. Secure Portal Layout */
.hero-portal {
    background: linear-gradient(135deg, #0a2540 0%, #112d4e 100%);
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 60px 0;
    color: #fff;
}

.portal-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
}

.portal-branding h1 { font-size: 3.5rem; line-height: 1.1; margin: 20px 0; font-weight: 800; }
.portal-branding h1 .light { font-weight: 300; opacity: 0.8; }
.portal-branding p { font-size: 1.1rem; opacity: 0.7; max-width: 500px; line-height: 1.7; }

.health-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 15px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.status-dot { height: 10px; width: 10px; border-radius: 50%; margin-right: 10px; }
.status-dot.pulse { background: var(--success-green); animation: pulse-green 2s infinite; }

/* 4. Form & Document Layouts (FIXED ALIGNMENT) */
.form-card { max-width: 900px; margin: 0 auto; padding: 40px !important; }

.input-group { 
    margin-bottom: 20px; 
    display: block; 
}

.input-group label { 
    display: block; 
    font-size: 0.75rem; 
    font-weight: 700; 
    margin-bottom: 8px; 
    color: #4a5568; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.input-group input, .input-group select, .input-group textarea {
    width: 100%; 
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    background: #fff;
    transition: all 0.2s;
    color: var(--text-main);
}

.input-group input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(0, 97, 255, 0.1); }

/* Grid for financial items */
.form-row { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 30px; 
    margin-bottom: 10px; 
}

/* Calculation/Summary Box Styling */
.summary-box {
    background: #f8fafc;
    border: 2px solid #edf2f7;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.summary-row:last-child { border-bottom: none; margin-top: 10px; }

.summary-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.summary-value { font-family: 'Roboto Mono', monospace; font-weight: 700; color: var(--brand-navy); }

.grand-total-display {
    font-size: 1.5rem;
    color: var(--accent-blue);
    font-weight: 800;
}

/* 5. Dashboard & Modules */
.dashboard-wrapper { padding: 40px 0; }
.welcome-section { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.welcome-text h1 { font-size: 2.2rem; color: var(--brand-navy); font-weight: 800; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.card { background: var(--white); border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.02); padding: 30px; }

.stat-card { border-left: 5px solid var(--accent-blue); }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--brand-navy); margin: 5px 0; transition: all 0.5s ease; }
.stat-label { color: var(--text-muted); font-weight: 600; font-size: 0.9rem; }

/* 9. Utility & Footer */
.btn { padding: 14px 28px; border-radius: 8px; font-weight: 700; cursor: pointer; text-decoration: none; border: none; transition: all 0.2s; display: inline-block; text-align: center; }
.btn-primary { background: var(--accent-blue); color: var(--white); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }

.main-footer { background: var(--brand-navy); color: var(--white); padding: 80px 0 40px; margin-top: 80px; }

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(72, 187, 120, 0); }
    100% { box-shadow: 0 0 0 0 rgba(72, 187, 120, 0); }
}

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; gap: 10px; }
    .form-card { padding: 20px !important; }
}