/* Global Design Tokens */

:root {
    /* Brand Colors - Premium Corporate Blue Theme */
    --primary-color: #0f4c81;
    /* Classic Blue */
    --primary-dark: #092c4c;
    /* Deep Navy */
    --primary-light: #e3f2fd;
    /* Light Blue BG */
    --accent-color: #4facfe;
    /* Vibrant Blue Gradient Start */
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);

    /* Semantic Colors */
    --success-color: #00b894;
    --danger-color: #d63031;
    --warning-color: #fdcb6e;
    --info-color: #74b9ff;

    /* Neutrals */
    --text-main: #2d3436;
    --text-muted: #636e72;
    --text-light: #b2bec3;
    --bg-body: #f5f7fa;
    --bg-card: #ffffff;
    --border-color: #dfe6e9;

    /* Typography */
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Spacing & Layout */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 15px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

/* Utility Class Layouts */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.d-flex {
    display: flex;
}

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

.justify-between {
    justify-content: space-between;
}

.flex-column {
    flex-direction: column;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

.w-100 {
    width: 100%;
}

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

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Components: Card */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Components: Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 6px rgba(15, 76, 129, 0.2);
}

.btn-primary:hover {
    box-shadow: 0 6px 12px rgba(15, 76, 129, 0.3);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
}

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

.btn-danger:hover {
    background: #b71c1c;
}

/* Components: Forms */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bg-body);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    background: white;
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 172, 254, 0.1);
}

.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    width: 100%;
    padding-right: 40px;
    /* Make space for the icon */
}

.password-toggle-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    z-index: 10;
}

.password-toggle-icon:hover {
    color: var(--primary-color);
}

/* Components: Table */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.modern-table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    padding: 16px;
    text-align: left;
}

.modern-table td {
    padding: 16px;
    border-bottom: 1px solid var(--bg-body);
    color: var(--text-main);
}

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

.modern-table tr:hover td {
    background: #fcfcfc;
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.clickable-row:hover td {
    background: var(--primary-light) !important;
}

/* Dashboard Specifics */
.dashboard-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.dashboard-title {
    font-size: 1.5rem;
    background: var(--accent-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url('../images/bg-glass.png') no-repeat center center fixed;
    background-size: cover;
    padding: 20px;
}

.auth-box {
    width: 100%;
    max-width: 900px;
    /* Increased max-width for split view */
    background: rgba(255, 255, 255, 0.75);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    /* Glass effect */
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    border-radius: var(--radius-lg);
    display: flex;
    /* Enable split layout */
    overflow: hidden;
}

.auth-split-image {
    flex: 1;
    background: url('../images/auth-side.png') no-repeat center center;
    background-size: cover;
    min-height: 550px;
    display: none;
    /* Hidden on mobile by default */
}

/* Show image side on larger screens */
@media (min-width: 768px) {
    .auth-split-image {
        display: block;
    }
}

.auth-split-form {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-header {
    margin-bottom: 25px;
    text-align: center;
}

.auth-logo {
    height: 60px;
    margin-bottom: 15px;
    object-fit: contain;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

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

/* Modal */
.modal-overlay {
    background: rgba(15, 76, 129, 0.3);
    backdrop-filter: blur(4px);
    /* ... rest managed by JS/inline styles for display ... */
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: white;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 450px;
    text-align: center;
}

/* Print Overrides - CRITICAL for IFA Form */
@media print {
    body {
        background: white;
        margin: 0;
        padding: 0;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .no-print,
    .btn,
    .dashboard-header,
    .admin-controls,
    .form-footer-actions {
        display: none !important;
    }

    .ifa-container {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    /* Restore plain styling for form for printing */
    .ifa-container input,
    .ifa-container select,
    .ifa-container textarea {
        background: transparent !important;
        border: none !important;
        border-bottom: 1px dotted #000 !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}