/* HRM Portal — shared styles */

:root {
    --hrm-primary: #4f46e5;
    --hrm-primary-dark: #4338ca;
    --hrm-sidebar-bg: #0f172a;
    --hrm-sidebar-hover: rgba(255, 255, 255, 0.06);
    --hrm-body-bg: #f4f6fb;
    --hrm-border: #e6e9f0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    background-color: var(--hrm-body-bg);
    color: #1e293b;
    letter-spacing: -0.01em;
}

.btn {
    font-weight: 500;
    border-radius: 0.55rem;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--hrm-primary-dark);
    border-color: var(--hrm-primary-dark);
}

.card {
    border: 1px solid var(--hrm-border);
    border-radius: 0.9rem;
}

.form-control,
.form-select {
    border-radius: 0.55rem;
    border-color: #d8dce6;
    padding: 0.5rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--hrm-primary);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.12);
}

/* ---------- Login ---------- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.login-page::before { width: 320px; height: 320px; top: -80px; left: -80px; }
.login-page::after { width: 420px; height: 420px; bottom: -140px; right: -120px; }

.login-card {
    width: 100%;
    max-width: 430px;
    border-radius: 1.25rem;
    position: relative;
    z-index: 1;
    border: none;
}

.brand-logo {
    width: 64px;
    height: 64px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.35);
}

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

.sidebar {
    width: 256px;
    background: var(--hrm-sidebar-bg);
    color: #94a3b8;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
}

.sidebar .sidebar-brand {
    padding: 1.35rem 1.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar .nav {
    padding: 0.75rem;
}

.sidebar .nav-link {
    color: #94a3b8;
    padding: 0.7rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    border-radius: 0.6rem;
    font-weight: 500;
    margin-bottom: 0.15rem;
    transition: all 0.15s ease;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
}

.sidebar .nav-link:hover {
    background: var(--hrm-sidebar-hover);
    color: #fff;
}

.sidebar .nav-link.active {
    background: var(--hrm-primary);
    color: #fff;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

/* Submenu */
.sidebar .nav-link.has-submenu {
    justify-content: flex-start;
}

.sidebar .nav-link.has-submenu span {
    flex-grow: 1;
}

.sidebar .nav-link.active-parent {
    color: #fff;
    background: var(--hrm-sidebar-hover);
}

.sidebar .submenu-caret {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.sidebar .nav-link.has-submenu[aria-expanded="true"] .submenu-caret {
    transform: rotate(180deg);
}

.sidebar .submenu {
    padding: 0.15rem 0 0.25rem 0.9rem;
    margin-left: 0.55rem;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar .submenu .nav-link {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.sidebar .submenu .nav-link i {
    font-size: 0.95rem;
}

.sidebar .sidebar-footer {
    margin-top: auto;
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.main-content {
    margin-left: 256px;
    flex-grow: 1;
    width: calc(100% - 256px);
}

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--hrm-border);
    padding: 0.85rem 1.75rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 700;
}

/* ---------- Cards / stats ---------- */
.stat-card {
    border-radius: 0.9rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.trend-up { color: #16a34a; font-size: 0.78rem; font-weight: 600; }
.trend-down { color: #dc2626; font-size: 0.78rem; font-weight: 600; }

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--hrm-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* ---------- Table ---------- */
.table > :not(caption) > * > * {
    padding: 0.85rem 1rem;
}

.table thead th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    font-weight: 600;
    border-bottom: 1px solid var(--hrm-border);
}

.table tbody tr {
    border-color: #f1f3f9;
}

.avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.logo-preview {
    width: 120px;
    height: 120px;
    border-radius: 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
}

.chart-box {
    position: relative;
    height: 280px;
}

.chart-box-sm {
    position: relative;
    height: 260px;
}

@media (max-width: 991.98px) {
    .sidebar { position: static; width: 100%; }
    .main-content { margin-left: 0; width: 100%; }
    .app-wrapper { flex-direction: column; }
    .topbar { position: static; }
}
