/* =====================================================================
   PayrollHub HRMS — Theme
   Premium SaaS look · Glassmorphism · Blue / Emerald · Dark & Light
   ===================================================================== */

:root {
    /* Brand palette */
    --ph-primary:      #2563eb;   /* blue-600  */
    --ph-primary-dark: #1e40af;
    --ph-primary-soft: #dbeafe;
    --ph-accent:       #10b981;   /* emerald-500 */
    --ph-accent-dark:  #059669;

    /* Semantic status */
    --ph-success: #10b981;
    --ph-warning: #f59e0b;
    --ph-danger:  #ef4444;
    --ph-info:    #0ea5e9;

    /* Light surface */
    --ph-bg:        #f4f7fb;
    --ph-surface:   #ffffff;
    --ph-glass:     rgba(255, 255, 255, 0.65);
    --ph-border:    rgba(15, 23, 42, 0.08);
    --ph-text:      #0f172a;
    --ph-muted:     #64748b;
    --ph-sidebar:   #0f1c3f;
    --ph-sidebar-text: #cbd5e1;

    --ph-radius:    16px;
    --ph-radius-sm: 10px;
    --ph-shadow:    0 8px 30px rgba(2, 6, 23, 0.08);
    --ph-shadow-sm: 0 2px 10px rgba(2, 6, 23, 0.06);
    --ph-sidebar-w: 260px;

    --ph-font: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
    --ph-head: 'Poppins', 'Inter', sans-serif;
}

[data-theme="dark"] {
    --ph-bg:      #0b1220;
    --ph-surface: #131c31;
    --ph-glass:   rgba(19, 28, 49, 0.7);
    --ph-border:  rgba(255, 255, 255, 0.08);
    --ph-text:    #e2e8f0;
    --ph-muted:   #94a3b8;
    --ph-sidebar: #0a1122;
    --ph-sidebar-text: #94a3b8;
    --ph-primary-soft: rgba(37, 99, 235, 0.18);
    --ph-shadow:  0 8px 30px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

body {
    font-family: var(--ph-font);
    background: var(--ph-bg);
    color: var(--ph-text);
    margin: 0;
    min-height: 100vh;
    transition: background .25s ease, color .25s ease;
}

h1, h2, h3, h4, h5, .fw-head { font-family: var(--ph-head); font-weight: 600; }
a { text-decoration: none; }

/* ---------- Auth (login) ---------- */
.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.25), transparent 60%),
        radial-gradient(1000px 500px at 110% 110%, rgba(16, 185, 129, 0.22), transparent 55%),
        var(--ph-bg);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--ph-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--ph-border);
    border-radius: 22px;
    box-shadow: var(--ph-shadow);
    padding: 38px 34px;
}
.auth-logo {
    width: 56px; height: 56px; border-radius: 16px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--ph-primary), var(--ph-accent));
    color: #fff; font-size: 26px; margin-bottom: 16px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--ph-sidebar-w);
    background: var(--ph-sidebar);
    color: var(--ph-sidebar-text);
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    padding: 18px 14px;
    z-index: 1040;
    transition: transform .28s ease;
    overflow-y: auto;
}
.sidebar .brand {
    display: flex; align-items: center; gap: 12px;
    color: #fff; padding: 8px 10px 18px; font-family: var(--ph-head);
    font-weight: 600; font-size: 18px;
}
.sidebar .brand .logo-badge {
    width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--ph-primary), var(--ph-accent));
    color: #fff; font-size: 18px;
}
.nav-section { font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
    color: #64748b; margin: 16px 12px 8px; }
.nav-link-ph {
    display: flex; align-items: center; gap: 12px;
    color: var(--ph-sidebar-text);
    padding: 11px 13px; border-radius: 12px;
    margin-bottom: 4px;               /* keeps active/hover pills from visually joining */
    font-size: 14.5px; font-weight: 500;
    transition: background .18s, color .18s;
}
.nav-link-ph i { width: 20px; text-align: center; font-size: 15px; }
.nav-link-ph:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-link-ph.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(16, 185, 129, 0.85));
    color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.main {
    flex: 1; margin-left: var(--ph-sidebar-w);
    display: flex; flex-direction: column; min-width: 0;
}

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 1030;
    background: var(--ph-glass);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ph-border);
    padding: 12px 22px;
    display: flex; align-items: center; gap: 16px;
}
.topbar .search {
    flex: 1; max-width: 420px;
    background: var(--ph-surface); border: 1px solid var(--ph-border);
    border-radius: 12px; padding: 9px 14px;
    display: flex; align-items: center; gap: 10px; color: var(--ph-muted);
}
.topbar .search input {
    border: 0; outline: 0; background: transparent; color: var(--ph-text);
    width: 100%; font-size: 14px;
}
.icon-btn {
    width: 40px; height: 40px; border-radius: 12px;
    border: 1px solid var(--ph-border); background: var(--ph-surface);
    color: var(--ph-text); display: inline-flex; align-items: center; justify-content: center;
    vertical-align: middle; cursor: pointer; padding: 0; line-height: 1;
    transition: background .15s, transform .15s;
}
.icon-btn:hover { transform: translateY(-1px); color: var(--ph-primary); }
/* keep row-action buttons on one baseline */
td .icon-btn, td form { vertical-align: middle; }
td form.d-inline { margin: 0; }
.stat-icon i, .qa-icon i, .logo-badge i, .nav-link-ph i { line-height: 1; }

.content { padding: 26px 22px 40px; }

/* ---------- Cards ---------- */
.glass-card {
    background: var(--ph-surface);
    border: 1px solid var(--ph-border);
    border-radius: var(--ph-radius);
    box-shadow: var(--ph-shadow-sm);
    transition: transform .18s, box-shadow .18s;
}
.glass-card:hover { transform: translateY(-3px); box-shadow: var(--ph-shadow); }

.stat-card { padding: 20px; display: flex; align-items: center; gap: 16px; }
.stat-card .stat-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: grid; place-items: center; font-size: 20px; color: #fff; flex-shrink: 0;
}
.stat-card .stat-value { font-size: 24px; font-weight: 700; font-family: var(--ph-head); line-height: 1; }
.stat-card .stat-label { color: var(--ph-muted); font-size: 13px; margin-top: 4px; }
.bg-grad-blue    { background: linear-gradient(135deg, #2563eb, #1e40af); }
.bg-grad-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.bg-grad-amber   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.bg-grad-rose    { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.bg-grad-violet  { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.bg-grad-sky     { background: linear-gradient(135deg, #0ea5e9, #0284c7); }

.section-title { font-size: 17px; font-weight: 600; font-family: var(--ph-head); margin: 0; }
.text-muted-ph { color: var(--ph-muted); }

.btn-primary-ph {
    background: linear-gradient(135deg, var(--ph-primary), var(--ph-primary-dark));
    border: 0; color: #fff; border-radius: 12px; padding: 10px 18px;
    font-weight: 500; transition: transform .15s, box-shadow .15s;
}
.btn-primary-ph:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35); color: #fff; }
.btn-accent-ph {
    background: linear-gradient(135deg, var(--ph-accent), var(--ph-accent-dark));
    border: 0; color: #fff; border-radius: 12px; padding: 10px 18px; font-weight: 500;
}
.quick-action {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 20px 12px; text-align: center; color: var(--ph-text); cursor: pointer;
}
.quick-action .qa-icon {
    width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
    background: var(--ph-primary-soft); color: var(--ph-primary); font-size: 19px;
}
.quick-action:hover .qa-icon { background: var(--ph-primary); color: #fff; }

.form-control-ph {
    background: var(--ph-surface); border: 1px solid var(--ph-border);
    color: var(--ph-text); border-radius: 12px; padding: 11px 14px; width: 100%;
    font-size: 14.5px; outline: none; transition: border .15s, box-shadow .15s;
}
.form-control-ph:focus { border-color: var(--ph-primary); box-shadow: 0 0 0 3px var(--ph-primary-soft); }

.avatar-sm { width: 38px; height: 38px; border-radius: 11px; object-fit: cover;
    background: linear-gradient(135deg, var(--ph-primary), var(--ph-accent));
    color: #fff; display: grid; place-items: center; font-weight: 600; }

.sidebar-backdrop { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; }
    .sidebar-backdrop.show {
        display: block; position: fixed; inset: 0;
        background: rgba(2, 6, 23, 0.5); z-index: 1035;
    }
}

/* scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.4); border-radius: 8px; }
