/* ==========================================================================
   VYALA HRMS - PREMIUM ENTERPRISE STYLESHEET
   Complete HR Solution Architecture
   ========================================================================== */

:root {
    /* Brand Theme - Premium Slate & Deep Indigo */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-dark: #3730a3;
    
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --accent-light: #ecfeff;

    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-border: #334155;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;

    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* REQUIRED ATTENDANCE STATUS COLORS */
    /* P = Present (Green) */
    --status-p-bg: #dcfce7;
    --status-p-text: #166534;
    --status-p-border: #86efac;

    /* A = Absent (Red) */
    --status-a-bg: #fee2e2;
    --status-a-text: #991b1b;
    --status-a-border: #fca5a5;

    /* AB = Abscond (Dark Red) */
    --status-ab-bg: #7f1d1d;
    --status-ab-text: #ffffff;
    --status-ab-border: #991b1b;

    /* CL = Casual Leave (Blue) */
    --status-cl-bg: #dbeafe;
    --status-cl-text: #1e40af;
    --status-cl-border: #93c5fd;

    /* SL = Sick Leave (Orange) */
    --status-sl-bg: #ffedd5;
    --status-sl-text: #9a3412;
    --status-sl-border: #fdba74;

    /* Request Workflow Badges */
    --status-pending-bg: #fef3c7;
    --status-pending-text: #92400e;
    --status-approved-bg: #dcfce7;
    --status-approved-text: #166534;
    --status-rejected-bg: #fee2e2;
    --status-rejected-text: #991b1b;

    /* Shadows & Elevation */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px 0 rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 0.925rem;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* Layout Frame */
.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100vw;
}

/* SIDEBAR NAVIGATION */
.app-sidebar {
    width: 270px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: var(--transition);
    z-index: 100;
    border-right: 1px solid var(--sidebar-border);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 800;
    font-size: 1.25rem;
    color: #ffffff;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.brand-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
}

.brand-tagline {
    font-size: 0.725rem;
    color: var(--sidebar-text);
    font-weight: 500;
}

.sidebar-nav {
    padding: 1.25rem 0.85rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-section-title {
    font-size: 0.685rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    padding: 0 0.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.85rem;
    color: var(--sidebar-text);
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    margin-bottom: 0.2rem;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.25) 0%, rgba(79, 70, 229, 0.05) 100%);
    border-left: 3.5px solid var(--primary);
    color: #ffffff;
    font-weight: 600;
}

.nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background-color: #334155;
    color: #f8fafc;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.nav-badge.alert-badge {
    background-color: #ef4444;
    color: #ffffff;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--sidebar-border);
}

.agent-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.agent-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--primary);
}

.agent-info {
    display: flex;
    flex-direction: column;
}

.agent-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.85rem;
}

.agent-role {
    color: var(--sidebar-text);
    font-size: 0.725rem;
}

/* MAIN CONTENT CONTAINER */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
}

/* TOP HEADER */
.app-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.9rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    sticky: top;
    z-index: 50;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
}

.sidebar-toggle:hover {
    background-color: var(--border-light);
    color: var(--text-main);
}

.header-breadcrumb {
    display: flex;
    flex-direction: column;
}

.view-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.view-subtitle {
    font-size: 0.785rem;
    color: var(--text-muted);
}

.header-center {
    flex: 1;
    max-width: 480px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* DEPARTMENT SELECTOR DROPDOWN */
.dept-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-light);
    border: 1.5px solid rgba(79, 70, 229, 0.2);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-md);
}

.dept-select-label {
    font-size: 0.775rem;
    font-weight: 700;
    color: var(--primary-dark);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dept-select-dropdown {
    background: transparent;
    border: none;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--primary);
    outline: none;
    cursor: pointer;
    padding-right: 0.5rem;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 0.5rem 0.85rem 0.5rem 2.25rem;
    background-color: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--primary);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.btn-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: #ffffff;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.btn-icon:hover {
    background-color: var(--border-light);
    color: var(--text-main);
}

.badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: var(--radius-full);
}

/* BUTTON STYLES */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.15rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
}

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

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--border);
    color: var(--text-main);
}

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

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

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

.btn-success {
    background-color: #16a34a;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-danger {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #b91c1c;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.785rem;
}

/* VIEW PANELS */
.view-panel {
    display: none;
    padding: 1.75rem;
    flex-direction: column;
    gap: 1.5rem;
}

.view-panel.active {
    display: flex;
}

/* CARDS & CONTAINERS */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-subtitle {
    font-size: 0.785rem;
    color: var(--text-muted);
}

/* KPI METRICS GRID */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.kpi-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.kpi-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.kpi-icon-wrapper.blue { background-color: #e0f2fe; color: #0284c7; }
.kpi-icon-wrapper.green { background-color: #dcfce7; color: #16a34a; }
.kpi-icon-wrapper.red { background-color: #fee2e2; color: #dc2626; }
.kpi-icon-wrapper.purple { background-color: #f3e8ff; color: #9333ea; }
.kpi-icon-wrapper.amber { background-color: #fef3c7; color: #d97706; }
.kpi-icon-wrapper.darkred { background-color: #7f1d1d; color: #ffffff; }

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.785rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

.kpi-meta {
    font-size: 0.725rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.text-success { color: #16a34a; font-weight: 600; }
.text-danger { color: #dc2626; font-weight: 600; }
.text-warning { color: #d97706; font-weight: 600; }
.text-info { color: #0284c7; font-weight: 600; }

/* CHARTS SECTION */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}

/* ATTENDANCE BADGES & COLORS */
.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

/* Required Exact Colors */
.status-present {
    background-color: var(--status-p-bg);
    color: var(--status-p-text);
    border-color: var(--status-p-border);
}

.status-absent {
    background-color: var(--status-a-bg);
    color: var(--status-a-text);
    border-color: var(--status-a-border);
}

.status-abscond {
    background-color: var(--status-ab-bg);
    color: var(--status-ab-text);
    border-color: var(--status-ab-border);
    box-shadow: 0 0 8px rgba(153, 27, 27, 0.4);
}

.status-cl {
    background-color: var(--status-cl-bg);
    color: var(--status-cl-text);
    border-color: var(--status-cl-border);
}

.status-sl {
    background-color: var(--status-sl-bg);
    color: var(--status-sl-text);
    border-color: var(--status-sl-border);
}

.badge-pending {
    background-color: var(--status-pending-bg);
    color: var(--status-pending-text);
}

.badge-approved {
    background-color: var(--status-approved-bg);
    color: var(--status-approved-text);
}

.badge-rejected {
    background-color: var(--status-rejected-bg);
    color: var(--status-rejected-text);
}

/* TABLES */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.custom-table th {
    background-color: var(--bg-app);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.custom-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    vertical-align: middle;
}

.custom-table tbody tr:hover {
    background-color: var(--primary-light);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 1px solid var(--border);
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    color: var(--text-main);
}

.user-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ATTENDANCE TRACKER GRID */
.attendance-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #ffffff;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.attendance-legend {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.785rem;
    font-weight: 600;
}

.attendance-table-container {
    overflow-x: auto;
    max-width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: #ffffff;
}

.attendance-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.785rem;
}

.attendance-table th, .attendance-table td {
    border: 1px solid var(--border-light);
    padding: 0.45rem 0.35rem;
    text-align: center;
    white-space: nowrap;
}

.attendance-table th {
    background-color: var(--bg-app);
    color: var(--text-muted);
    font-weight: 700;
}

.attendance-table .sticky-col {
    position: sticky;
    left: 0;
    background-color: #ffffff;
    z-index: 10;
    text-align: left;
    padding-left: 0.75rem;
    box-shadow: 2px 0 5px rgba(0,0,0,0.03);
}

.attendance-table th.sticky-col {
    background-color: var(--bg-app);
}

.attendance-cell-select {
    border: none;
    border-radius: var(--radius-sm);
    padding: 2px 4px;
    font-weight: 800;
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
    text-align: center;
    width: 36px;
    height: 28px;
}

.attendance-cell-select.val-P { background-color: var(--status-p-bg); color: var(--status-p-text); border: 1px solid var(--status-p-border); }
.attendance-cell-select.val-A { background-color: var(--status-a-bg); color: var(--status-a-text); border: 1px solid var(--status-a-border); }
.attendance-cell-select.val-AB { background-color: var(--status-ab-bg); color: var(--status-ab-text); border: 1px solid var(--status-ab-border); font-weight: 900; }
.attendance-cell-select.val-CL { background-color: var(--status-cl-bg); color: var(--status-cl-text); border: 1px solid var(--status-cl-border); }
.attendance-cell-select.val-SL { background-color: var(--status-sl-bg); color: var(--status-sl-text); border: 1px solid var(--status-sl-border); }

/* ABSCOND ALERT BANNER */
.abscond-alert-banner {
    background: linear-gradient(135deg, #7f1d1d, #991b1b);
    color: #ffffff;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 14px rgba(153, 27, 27, 0.3);
}

.abscond-alert-banner .alert-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.abscond-alert-banner i {
    font-size: 1.5rem;
}

/* DOCUMENT VAULT CARDS */
.docs-vault-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.doc-vault-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.doc-vault-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.doc-icon-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.doc-file-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.doc-meta {
    display: flex;
    flex-direction: column;
}

.doc-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
}

.doc-status {
    font-size: 0.725rem;
    color: var(--text-muted);
}

/* RECRUITMENT PIPELINE BOARD */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
    align-items: start;
}

.kanban-column {
    background-color: #f1f5f9;
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-height: 400px;
}

.column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.candidate-card {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-xs);
    cursor: grab;
    transition: var(--transition);
}

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

.candidate-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

.candidate-role {
    font-size: 0.785rem;
    color: var(--primary);
    font-weight: 600;
}

.candidate-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.725rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--border);
}

/* MODALS */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.25s ease-out;
}

.modal-content.modal-lg {
    max-width: 850px;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: var(--bg-app);
}

/* FORM CONTROLS */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-control {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
    background-color: #ffffff;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* PAYSLIP EXECUTIVE PRINTABLE FORMAT */
.payslip-container {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: var(--radius-md);
    color: #0f172a;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.payslip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.payslip-company-info h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}

.payslip-company-info p {
    font-size: 0.785rem;
    color: var(--text-muted);
}

.payslip-title-badge {
    text-align: right;
}

.payslip-title-badge h3 {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-main);
}

.payslip-grid-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem 1.5rem;
    background-color: var(--bg-app);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.825rem;
}

.payslip-info-item {
    display: flex;
    justify-content: space-between;
}

.payslip-info-label {
    color: var(--text-muted);
    font-weight: 600;
}

.payslip-info-value {
    font-weight: 700;
    color: var(--text-main);
}

.payslip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.payslip-table th, .payslip-table td {
    border: 1px solid var(--border);
    padding: 0.65rem 0.85rem;
}

.payslip-table th {
    background-color: var(--primary-light);
    color: var(--primary-dark);
    font-weight: 700;
}

.payslip-net-box {
    background: linear-gradient(135deg, var(--primary-light), #ffffff);
    border: 2px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.net-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.net-amount {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.payslip-footer-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 2.5rem;
    padding-top: 1rem;
}

.sig-box {
    text-align: center;
    border-top: 1px solid var(--text-muted);
    width: 180px;
    padding-top: 0.35rem;
    font-size: 0.785rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* PRINT MEDIA QUERIES FOR PAYSLIP */
@media print {
    body * {
        visibility: hidden;
    }
    #printablePayslip, #printablePayslip * {
        visibility: visible;
    }
    #printablePayslip {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        border: none;
    }
    .modal-overlay {
        background: none;
    }
    .modal-content {
        box-shadow: none;
        max-width: 100%;
    }
    .modal-header, .modal-footer {
        display: none !important;
    }
}

/* TOAST NOTIFICATION */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background-color: var(--sidebar-bg);
    color: #ffffff;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--primary);
}

.toast.toast-success { border-left-color: #22c55e; }
.toast.toast-error { border-left-color: #ef4444; }
.toast.toast-warning { border-left-color: #f59e0b; }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
