/* ==========================================================================
   Employee Payslip Portal - Modern Enterprise UI Design System
   Dynamic CSS Variables injected from database Branding Settings
   ========================================================================== */

:root {
    --primary-color: #d95870;
    --primary-hover: #c4455d;
    --primary-light: #fdf2f4;
    --secondary-color: #1f1633;
    --accent-color: #ea8b9b;
    --background-color: #faf7f8;
    --card-bg: #ffffff;
    --text-color: #1f1633;
    --text-muted: #645b74;
    --button-color: #d95870;
    --border-color: #ede5e9;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(31, 22, 51, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(31, 22, 51, 0.08), 0 2px 4px -1px rgba(31, 22, 51, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(31, 22, 51, 0.1), 0 4px 6px -2px rgba(31, 22, 51, 0.05);
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Layout - App Shell
   ========================================================================== */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--secondary-color);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0,0,0,0.15);
}

.sidebar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent-color);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 10px;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-menu-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 12px 14px 6px;
    font-weight: 600;
}

.sidebar-item {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-link.active {
    background: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0,0,0,0.2);
    font-size: 0.8rem;
    color: #94a3b8;
}

.main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--background-color);
    transition: margin-left 0.3s ease;
}

.topbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.content-body {
    padding: 30px;
    flex-grow: 1;
}

.footer {
    padding: 16px 30px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   UI Components
   ========================================================================== */

.card-custom {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-custom-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.05rem;
}

.card-custom-body {
    padding: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-val {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-color);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 4px;
}

/* Buttons */
.btn-brand {
    background-color: var(--button-color);
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-brand:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(217, 88, 112, 0.35);
}

/* Badges */
.badge-status {
    padding: 5px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-active { background: #dcfce7; color: #15803d; }
.badge-deactivated { background: #fee2e2; color: #b91c1c; }
.badge-pending { background: #fef3c7; color: #b45309; }
.badge-approved { background: #dbeafe; color: #1d4ed8; }
.badge-rejected { background: #f3f4f6; color: #4b5563; }

/* Tables */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table-custom td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.table-custom tbody tr:hover {
    background-color: #f1f5f9;
}

/* Auth Cards */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    padding: 20px;
}

.auth-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo img {
    max-height: 60px;
    max-width: 200px;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* Modal and Dropdowns */
.nav-user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.nav-user-dropdown:hover {
    background: #f1f5f9;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}
