/* ===== HR Dashboard — Purple, Pink & Sky Blue theme ===== */
:root {
    --purple:      #5B21B6;
    --purple-deep: #2E1065;
    --purple-mid:  #7C3AED;
    --pink:        #EC4899;
    --pink-light:  #F9A8D4;
    --pink-pale:   #FDF2F8;
    --sky:         #38BDF8;
    --sky-light:   #BAE6FD;
    --sky-pale:    #E0F2FE;
    --white:       #FFFFFF;
    --off-white:   #F8F6FC;
    --text-dark:   #241033;
    --text-mid:    #5B4A6B;
    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, "Segoe UI", Arial, sans-serif;
    background: var(--off-white);
    color: var(--text-dark);
    line-height: 1.6;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--sky); text-decoration: none; }

@keyframes fadeDown { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(20px);  } to { opacity:1; transform:translateY(0); } }
@keyframes scaleIn  { from { opacity:0; transform:scale(0.85); } to { opacity:1; transform:scale(1); } }
@keyframes navSlideDown { from{transform:translateY(-100%);opacity:0;} to{transform:translateY(0);opacity:1;} }

/* ---------- Top Navbar ---------- */
.navbar {
    background: var(--purple-deep);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.35);
    animation: navSlideDown 0.5s ease both;
}
.navbar .brand {
    font-family: 'Playfair Display', serif;
    color: var(--sky-light);
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.02em;
}
.navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}
.navbar .nav-right span.muted { color: rgba(255,255,255,0.65); }
.navbar .nav-right a {
    color: rgba(255,255,255,0.78);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 4px;
}
.navbar .nav-right a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--sky);
    border-radius: 1px;
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.navbar .nav-right a:hover { color: var(--sky); }
.navbar .nav-right a:hover::after { transform: scaleX(1); }
.navbar .logout-btn {
    background: transparent;
    border: 1px solid rgba(56,189,248,0.4);
    border-radius: 18px;
    padding: 6px 16px;
    cursor: pointer;
    font-weight: 600;
    color: var(--sky-light);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.navbar .logout-btn:hover { background: var(--sky); color: var(--purple-deep); transform: translateY(-1px); }

/* ---------- Layout ---------- */
.page-wrap {
    max-width: 1000px;
    margin: 28px auto;
    padding: 0 16px;
    animation: fadeUp 0.5s ease both;
}

.card {
    background: var(--white);
    border: 1px solid rgba(91,33,182,0.1);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(91,33,182,0.06);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card-body { padding: 22px; }

/* ---------- Profile / "Feed" header ---------- */
.profile-cover {
    height: 170px;
    background: linear-gradient(135deg, var(--purple-deep) 0%, var(--purple) 55%, var(--sky) 130%);
    background-size: cover;
    background-position: center;
}
.profile-photo-wrap {
    margin-top: -58px;
    padding: 0 24px;
}
.profile-photo {
    width: 116px;
    height: 116px;
    border-radius: 50%;
    border: 4px solid var(--white);
    object-fit: cover;
    background: var(--sky-pale);
    box-shadow: 0 4px 18px rgba(0,0,0,0.18);
    animation: scaleIn 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.1s both;
}
.profile-info { padding: 8px 24px 22px; }
.profile-info h1 { margin: 0 0 4px; font-size: 24px; color: var(--purple); font-weight: 700; }
.profile-info .headline { color: var(--text-dark); font-size: 16px; margin: 0 0 4px; }
.profile-info .sub { color: var(--text-mid); font-size: 14px; margin: 2px 0; }

/* ---------- Section titles ---------- */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--purple);
    margin: 0 0 14px;
    position: relative;
    display: inline-block;
    padding-bottom: 6px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    height: 3px; width: 40px;
    background: linear-gradient(90deg, var(--purple), var(--pink), var(--sky));
    border-radius: 2px;
}

.bio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 24px;
}
.bio-item label {
    display: block;
    font-size: 11px;
    color: var(--sky);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 600;
    margin-bottom: 2px;
}
.bio-item span { font-size: 15px; color: var(--text-dark); }

/* ---------- Forms ---------- */
form { display: flex; flex-direction: column; gap: 10px; }
label { font-size: 13px; font-weight: 600; color: var(--purple-mid); margin-top: 6px; }
input, select, textarea {
    padding: 10px 12px;
    border: 1px solid rgba(91,33,182,0.25);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(56,189,248,0.18);
}
textarea { resize: vertical; min-height: 80px; }

button, .btn {
    background: linear-gradient(135deg, var(--purple), var(--purple-mid));
    color: var(--white);
    border: none;
    border-radius: 24px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    display: inline-block;
}
button:hover, .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(91,33,182,0.3);
    background: linear-gradient(135deg, var(--purple-mid), var(--sky));
    color: var(--white);
}
.btn-outline {
    background: transparent;
    color: var(--purple);
    border: 1.5px solid var(--purple);
}
.btn-outline:hover { background: var(--sky-pale); color: var(--purple); box-shadow: none; }

/* ---------- Tables (HR dashboard employee list) ---------- */
table { width: 100%; border-collapse: collapse; }
th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid rgba(91,33,182,0.08);
    font-size: 14px;
}
th {
    color: var(--white);
    background: var(--purple);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
tr:hover td { background: var(--sky-pale); }
.row-actions a { margin-right: 12px; font-size: 13px; font-weight: 600; }
.badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}
.badge-active { background: #e3f6e9; color: #1e7a3d; }
.badge-inactive { background: var(--pink-pale); color: var(--pink); }

/* ---------- Auth pages ---------- */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(160deg, var(--purple-deep) 0%, var(--purple) 55%, var(--pink) 100%);
    position: relative;
    overflow: hidden;
}
.auth-body::before {
    content:'';
    position:absolute; inset:0;
    background: radial-gradient(ellipse at 70% 30%, rgba(56,189,248,0.18) 0%, transparent 60%);
    pointer-events: none;
}
.auth-card {
    background: var(--white);
    padding: 34px;
    border-radius: var(--radius);
    width: 100%;
    max-width: 360px;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    animation: fadeDown 0.5s ease both;
}
.auth-card h2 {
    color: var(--purple);
    margin-top: 0;
    font-size: 26px;
}
.muted { color: #888; font-size: 13px; }

.alert {
    background: var(--pink-pale);
    color: var(--purple-deep);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 10px;
    border-left: 3px solid var(--pink);
}
.alert-success {
    background: #e3f6e9;
    color: #1e7a3d;
    border-left: 3px solid #1e7a3d;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.dashboard-header h2 { margin: 0; color: var(--purple); }

.empty-state {
    text-align: center;
    padding: 44px;
    color: var(--text-mid);
}

/* ===================================================================
   Sidebar + Topbar App Layout (HR side)
   =================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--purple-deep);
    color: var(--white);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    animation: fadeDown 0.4s ease both;
}
.sidebar .sidebar-brand {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    font-weight: 700;
    color: var(--sky-light);
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    letter-spacing: 0.02em;
}
.sidebar .sidebar-brand span {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 2px;
}
.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}
.sidebar-nav a svg { flex-shrink: 0; width: 18px; height: 18px; }
.sidebar-nav a:hover {
    background: rgba(56,189,248,0.12);
    color: var(--sky-light);
    padding-left: 18px;
}
.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--sky), #1c8fb8);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(56,189,248,0.3);
}
.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 10px 14px;
}
.sidebar-footer {
    padding: 14px 10px 18px;
}
.sidebar-footer form { margin: 0; }
.sidebar-footer .logout-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    color: rgba(255,255,255,0.75);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}
.sidebar-footer .logout-link:hover { background: rgba(91,33,182,0.4); color: var(--white); }
.sidebar-footer .logout-link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Main column ---------- */
.main-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
    height: 64px;
    background: var(--white);
    border-bottom: 1px solid rgba(91,33,182,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 20px;
}
.topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}
.topbar-search input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border-radius: 20px;
    border: 1px solid rgba(91,33,182,0.18);
    background: var(--off-white);
    font-size: 14px;
}
.topbar-search input:focus {
    background: var(--white);
    border-color: var(--sky);
    box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
.topbar-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    color: var(--purple-mid);
    pointer-events: none;
}
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-mid);
    white-space: nowrap;
}
.topbar-user .avatar-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), var(--pink));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* History timeline */
.history-list { display: flex; flex-direction: column; }
.history-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(91,33,182,0.07);
}
.history-item:last-child { border-bottom: none; }
.history-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--sky);
    margin-top: 5px;
    flex-shrink: 0;
}
.history-item .history-text { font-size: 14px; color: var(--text-dark); }
.history-item .history-time { font-size: 12px; color: #999; margin-top: 2px; }

/* Stat cards (dashboard overview) */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 2px 14px rgba(91,33,182,0.06);
    border-left: 4px solid var(--sky);
}
.stat-card .stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    color: var(--purple);
    font-weight: 700;
}
.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-mid);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

@media (max-width: 880px) {
    .sidebar { width: 76px; }
    .sidebar .sidebar-brand span,
    .sidebar-nav a .nav-label { display: none; }
    .sidebar .sidebar-brand { text-align: center; font-size: 0; padding: 22px 8px; }
    .sidebar .sidebar-brand::before { content: 'HR'; font-size: 18px; }
    .sidebar-nav a { justify-content: center; padding: 12px; }
    .sidebar-nav a:hover { padding-left: 12px; }
    .sidebar-footer .logout-link { justify-content: center; }
    .topbar { padding: 0 16px; }
    .topbar-search { max-width: 220px; }
}

/* Clickable employee table rows */
.emp-row { cursor: pointer; }
.emp-row:hover td { background: var(--sky-pale); }

/* Employee table photo thumbnail */
.emp-photo-cell { width: 44px; }
.emp-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--sky-pale);
    border: 1px solid rgba(91,33,182,0.12);
    display: block;
}