/* ═══════════════════════════════════════════════════════════════════════════════
   Staff Portal — CSS Foundation
   EN: Styles for staff portal pages (Dashboard, Attendance, Leave, etc.)
   VI: Styles cho trang nhan vien (Dashboard, Cham cong, Nghi phep, v.v.)
   Reuses admin design tokens from admin.css
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═════════════════════════════════════════════════════════════════════════
   STAFF LAYOUT — Sidebar + Content (mirrors admin-layout)
   ═════════════════════════════════════════════════════════════════════════ */

.staff-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background-color: var(--admin-bg-page);
    font-family: var(--admin-font);
    color: var(--admin-text-primary);
}

/* ═════════════════════════════════════════
   SIDEBAR
   ═════════════════════════════════════════ */

.staff-sidebar {
    width: var(--admin-sidebar-width);
    min-width: var(--admin-sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--admin-bg-elevated);
    border-right: 1px solid var(--admin-border-subtle);
    overflow-y: auto;
    z-index: 50;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.staff-sidebar__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border-bottom: 1px solid var(--admin-border-subtle);
}

.staff-sidebar__logo-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 800;
}

.staff-sidebar__logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.staff-sidebar__logo-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--admin-text-primary);
}

.staff-sidebar__logo-sub {
    font-size: 11px;
    color: var(--admin-text-tertiary);
}

.staff-sidebar__nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.staff-nav-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--admin-text-tertiary);
    padding: 16px 12px 8px 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.staff-nav-label:first-child {
    padding-top: 0;
}

.staff-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border-radius: var(--admin-radius-md);
    border: none;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.staff-nav-item i,
.staff-nav-item svg {
    width: 20px;
    height: 20px;
    color: var(--admin-text-secondary);
    flex-shrink: 0;
}

.staff-nav-item span {
    font-size: 14px;
    font-weight: 500;
    color: var(--admin-text-secondary);
    white-space: nowrap;
}

.staff-nav-item:hover {
    background-color: var(--admin-bg-interactive);
}

.staff-nav-item:hover i,
.staff-nav-item:hover span {
    color: var(--admin-text-primary);
}

.staff-nav-item--active {
    background-color: #22C55E;
}

.staff-nav-item--active i,
.staff-nav-item--active svg {
    color: #FFFFFF;
}

.staff-nav-item--active span {
    color: #FFFFFF;
    font-weight: 600;
}

.staff-nav-item--active:hover {
    background-color: #22C55E;
    opacity: 0.9;
}

/* Badge for notifications */
.staff-badge {
    margin-left: auto;
    background: #EF4444;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* User section at bottom */
.staff-sidebar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--admin-border-subtle);
    margin-top: auto;
}

.staff-user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #22C55E 0%, #16A34A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
}

.staff-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.staff-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--admin-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staff-user-role {
    font-size: 11px;
    color: var(--admin-text-tertiary);
}

.staff-sidebar__user button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.staff-sidebar__user button:hover {
    background: var(--admin-bg-interactive);
}

.staff-sidebar__user button i {
    width: 18px;
    height: 18px;
    color: var(--admin-text-tertiary);
}

/* ═════════════════════════════════════════
   MAIN CONTENT
   ═════════════════════════════════════════ */

.staff-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Mobile bar */
.staff-mobile-bar {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--admin-bg-elevated);
    border-bottom: 1px solid var(--admin-border-subtle);
}

.staff-mobile-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}

.staff-mobile-toggle i {
    width: 20px;
    height: 20px;
    color: var(--admin-text-primary);
}

.staff-mobile-bar__title {
    font-size: 16px;
    font-weight: 700;
    color: var(--admin-text-primary);
}

/* Staff page content wrapper */
.staff-page {
    padding: var(--admin-content-padding);
}

.staff-page-header {
    margin-bottom: var(--admin-gap-xl);
}

.staff-page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--admin-text-primary);
    margin: 0 0 4px;
}

.staff-page-subtitle {
    font-size: 14px;
    color: var(--admin-text-tertiary);
    margin: 0;
}

/* Staff stat cards */
.staff-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--admin-gap-md);
    margin-bottom: var(--admin-gap-xl);
}

.staff-stat-card {
    background: var(--admin-bg-elevated);
    border: 1px solid var(--admin-border-default);
    border-radius: var(--admin-radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.staff-stat-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.staff-stat-card__icon i {
    width: 20px;
    height: 20px;
}

.staff-stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--admin-text-primary);
}

.staff-stat-card__label {
    font-size: 13px;
    color: var(--admin-text-tertiary);
}

/* Staff action button */
.staff-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #22C55E;
    color: #FFFFFF;
    border: none;
    border-radius: var(--admin-radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.staff-btn-primary:hover {
    background: #16A34A;
}

.staff-btn-primary i {
    width: 16px;
    height: 16px;
}

.staff-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--admin-bg-interactive);
    color: var(--admin-text-primary);
    border: 1px solid var(--admin-border-default);
    border-radius: var(--admin-radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.staff-btn-secondary:hover {
    background: var(--admin-bg-elevated);
}

/* Staff table */
.staff-table-card {
    background: var(--admin-bg-elevated);
    border: 1px solid var(--admin-border-default);
    border-radius: var(--admin-radius-lg);
    overflow: hidden;
}

.staff-table-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--admin-border-subtle);
}

.staff-table-card__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--admin-text-primary);
}

/* Status badges */
.staff-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.staff-status--success {
    background: rgba(34, 197, 94, 0.12);
    color: #22C55E;
}

.staff-status--warning {
    background: rgba(245, 158, 11, 0.12);
    color: #F59E0B;
}

.staff-status--danger {
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
}

.staff-status--info {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
}

.staff-status--neutral {
    background: rgba(139, 139, 144, 0.12);
    color: var(--admin-text-tertiary);
}

/* Overlay for mobile sidebar */
.staff-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 49;
}

/* ═════════════════════════════════════════
   RESPONSIVE
   ═════════════════════════════════════════ */

@media (max-width: 768px) {
    .staff-sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
    }

    .staff-sidebar--open {
        left: 0;
    }

    .staff-sidebar-overlay {
        display: block;
    }

    .staff-mobile-bar {
        display: flex;
    }

    .staff-page {
        padding: 16px;
    }

    .staff-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
