/* CSS design variables for premium light-pink-themed layout */
:root {
    --bg-app: #fff5f7;
    --bg-sidebar: #ffe4e8;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-input: #ffffff;
    
    --border-color: rgba(244, 63, 94, 0.15);
    --border-hover: rgba(244, 63, 94, 0.3);
    
    --text-primary: #3f1b24;
    --text-secondary: #8c5f6c;
    --text-muted: #b5929c;
    
    --color-primary: #ec4899;
    --color-primary-hover: #db2777;
    --color-primary-glow: rgba(236, 72, 153, 0.15);
    
    --color-success: #059669;
    --color-success-bg: rgba(5, 150, 105, 0.1);
    
    --color-warning: #ea580c;
    --color-warning-bg: rgba(234, 88, 12, 0.1);
    
    --color-danger: #e11d48;
    --color-danger-bg: rgba(225, 29, 72, 0.1);
    
    --color-info: #0891b2;
    --color-info-bg: rgba(8, 145, 178, 0.1);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    --shadow-glow: 0 0 20px rgba(236, 72, 153, 0.2);
    --shadow-card: 0 10px 30px rgba(219, 39, 119, 0.06);
}

/* Core Settings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    font-weight: 500;
}

/* Watermark Background Elements */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    background-image: url('logo_besua.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.035;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: 'Thu Cầm Baby 2026';
    position: fixed;
    bottom: 4%;
    right: 4%;
    font-family: 'Outfit', sans-serif;
    font-size: 5rem;
    font-weight: 900;
    color: rgba(236, 72, 153, 0.025);
    pointer-events: none;
    z-index: 0;
    transform: rotate(-10deg);
    letter-spacing: -2px;
    white-space: nowrap;
}

/* Main Layout Grid */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Navigation Sidebar */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px 24px 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-dot {
    width: 12px;
    height: 12px;
    background-color: var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-primary);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; filter: brightness(1.2); }
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-primary), var(--text-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.brand-logo-img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

.brand-logo-img-sidebar {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
}

.nav-menu {
    margin-top: 24px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-normal);
    position: relative;
}

.nav-item i {
    width: 18px;
    height: 18px;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(236, 72, 153, 0.05);
    font-weight: 600;
}

.nav-item.active {
    color: var(--text-primary);
    background: radial-gradient(100% 100% at 0% 0%, rgba(236, 72, 153, 0.15) 0%, rgba(236, 72, 153, 0.03) 100%);
    box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.25);
    font-weight: 700;
}

.nav-item.active i {
    color: var(--color-primary);
    filter: drop-shadow(0 0 4px var(--color-primary-glow));
}

.badge {
    position: absolute;
    right: 16px;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 700;
}

.badge-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.user-quick-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-small {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.info-text {
    overflow: hidden;
}

.user-role {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Topbar Header */
.topbar {
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(255, 245, 247, 0.8);
    backdrop-filter: blur(12px);
    z-index: 10;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.live-clock {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.02);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.live-clock i {
    width: 14px;
    height: 14px;
    color: var(--color-primary);
}

.live-clock .divider {
    color: var(--text-muted);
}

/* Notification Center */
.notification-bell {
    position: relative;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.02);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
}

.notification-bell:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-hover);
}

.notification-bell i {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background-color: var(--color-danger);
    border: 2px solid var(--bg-app);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    width: 320px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
}

.notification-dropdown.active {
    display: flex;
}

.noti-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.noti-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.noti-header button {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 0.75rem;
    cursor: pointer;
}

.noti-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
}

.noti-list li {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    font-size: 0.8rem;
    transition: var(--transition-fast);
}

.noti-list li:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.noti-list li.unread {
    background-color: rgba(59, 130, 246, 0.03);
}

.noti-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.noti-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.noti-text {
    color: var(--text-primary);
    line-height: 1.4;
}

.noti-time {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* Profile Pill Container */
.profile-pill {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 4px 6px 4px 4px;
    gap: 10px;
}

.personal-btn {
    background-color: var(--text-primary);
    color: var(--bg-app);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.personal-btn:hover {
    opacity: 0.9;
}

.personal-btn i {
    width: 14px;
    height: 14px;
}

.profile-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-right: 8px;
}

.logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-danger);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.logout-btn:hover {
    background-color: var(--color-danger-bg);
}

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

/* Views wrapper settings */
.views-wrapper {
    flex-grow: 1;
    padding: 32px;
    overflow-y: auto;
}

.views-wrapper::-webkit-scrollbar {
    width: 6px;
}

.views-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.view-section {
    display: none;
    animation: fade-in 0.3s ease;
}

.view-section.active {
    display: block;
    opacity: 1;
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

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

.stat-icon-wrapper i {
    width: 24px;
    height: 24px;
}

.stat-icon-wrapper.success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

.stat-icon-wrapper.info {
    background-color: var(--color-info-bg);
    color: var(--color-info);
}

.stat-icon-wrapper.warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
}

.stat-icon-wrapper.danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2px 0;
    color: var(--text-primary);
}

.stat-subtext {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Dashboard Body columns */
.dashboard-body {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
}

.attendance-monitor-panel {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.live-dot-pulse {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-success);
    background-color: var(--color-success-bg);
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-dot-pulse::before {
    content: '';
    width: 6px;
    height: 6px;
    background-color: var(--color-success);
    border-radius: 50%;
    display: inline-block;
    animation: flash 1.5s infinite;
}

@keyframes flash {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Attendance Cards (Mirroring screenshot layout) */
.attendance-cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.attendance-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--transition-fast);
}

.attendance-card:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-card-hover);
}

.attendance-card-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.status-dot-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
}

.status-dot-indicator.active {
    background-color: var(--color-success);
    box-shadow: 0 0 6px var(--color-success);
}

.status-dot-indicator.break {
    background-color: var(--color-warning);
    box-shadow: 0 0 6px var(--color-warning);
}

.status-dot-indicator.inactive {
    background-color: var(--text-muted);
}

.emp-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.emp-info .emp-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.attendance-card-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.status-text-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-text-badge.success {
    color: var(--color-success);
}

.status-text-badge.warning {
    color: var(--color-warning);
}

.status-text-badge.danger {
    color: var(--color-danger);
}

.status-text-badge i {
    width: 14px;
    height: 14px;
}

.shift-pill-badge {
    background-color: white;
    color: #1e293b;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-align: center;
}

.shift-pill-badge .shift-time {
    display: block;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
}

.time-stamps {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.time-stamps .stamp-hl {
    color: var(--text-primary);
    font-weight: 600;
}

.break-stamps {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Checkin Simulator Widget */
.checkin-control-panel {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    height: fit-content;
}

.control-box {
    margin-top: 16px;
}

.control-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-glow);
}

select.form-control {
    cursor: pointer;
}

select.form-control option {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

/* Button UI Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.btn-block {
    display: flex;
    width: 100%;
}

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

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

.btn-success {
    background-color: var(--color-success);
    color: white;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-warning {
    background-color: var(--color-warning);
    color: white;
}

.btn-warning:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: rgba(236, 72, 153, 0.05);
    border-color: var(--border-hover);
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    color: var(--text-primary);
    background-color: rgba(236, 72, 153, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* Sections/Tables general */
.section-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box-wrapper {
    position: relative;
    width: 300px;
}

.search-box-wrapper i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-box-wrapper input {
    width: 100%;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px 10px 38px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    outline: none;
}

.search-box-wrapper input:focus {
    border-color: var(--color-primary);
}

.table-container {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    overflow-y: hidden;
    box-shadow: var(--shadow-card);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th {
    background-color: rgba(255, 255, 255, 0.01);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}

/* Avatar layout in tables */
.emp-table-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
}

.emp-name-text {
    font-weight: 600;
}

/* Status Badges */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
}

.status-pill.success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-pill.warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-pill.danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-pill.muted {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* Scheduler view elements */
.scheduler-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background-color: var(--bg-sidebar);
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.scheduler-week-picker {
    display: flex;
    align-items: center;
    gap: 16px;
}

.week-display-label {
    font-weight: 600;
    font-size: 0.95rem;
}

.scheduler-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.shift-morning { background-color: var(--color-info); }
.shift-afternoon { background-color: var(--color-warning); }
.shift-evening { background-color: var(--color-primary); }
.shift-full { background-color: var(--color-success); }
.shift-off { background-color: var(--text-muted); }

.scheduler-table th:not(.employee-col) {
    text-align: center;
    width: 11%;
}

.scheduler-table td:not(:first-child) {
    text-align: center;
    padding: 8px;
}

.cell-shift-select {
    width: 90%;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border-color);
    color: var(--text-primary);
    padding: 6px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    outline: none;
    text-align: center;
    text-align-last: center;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-fast);
}

.cell-shift-select:hover {
    border-color: var(--text-secondary);
    background-color: rgba(255, 255, 255, 0.04);
}

.cell-shift-select.val-S { background-color: var(--color-info-bg); color: var(--color-info); border-color: rgba(6, 182, 212, 0.3); }
.cell-shift-select.val-C { background-color: var(--color-warning-bg); color: var(--color-warning); border-color: rgba(245, 158, 11, 0.3); }
.cell-shift-select.val-T { background-color: var(--color-primary-glow); color: var(--color-primary); border-color: rgba(59, 130, 246, 0.3); }
.cell-shift-select.val-F { background-color: var(--color-success-bg); color: var(--color-success); border-color: rgba(16, 185, 129, 0.3); }
.cell-shift-select.val-OFF { background-color: rgba(255, 255, 255, 0.01); color: var(--text-muted); border-color: var(--border-color); }

/* Leave & Advance Two Column grids */
.two-column-layout {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 24px;
}

.table-card, .form-card {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

/* Payroll components */
.payroll-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.payroll-month-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.payroll-month-selector label {
    font-size: 0.9rem;
    font-weight: 500;
}

.payroll-month-selector input {
    width: 150px;
}

.payroll-actions {
    display: flex;
    gap: 12px;
}

.salary-highlight {
    font-weight: 700;
    color: var(--color-success);
}

/* Logs and Timeline */
.logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.log-timeline-wrapper {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
    max-height: 500px;
    overflow-y: auto;
}

.log-timeline {
    position: relative;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.log-item {
    position: relative;
}

.log-marker {
    position: absolute;
    left: -25px;
    top: 3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--text-muted);
    border: 2px solid var(--bg-sidebar);
}

.log-item.success .log-marker { background-color: var(--color-success); }
.log-item.warning .log-marker { background-color: var(--color-warning); }
.log-item.danger .log-marker { background-color: var(--color-danger); }
.log-item.info .log-marker { background-color: var(--color-info); }

.log-time-stamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

.log-msg {
    font-size: 0.8rem;
    color: var(--text-primary);
    margin-top: 2px;
}

/* Modal Backdrops & Dialogues */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(5, 8, 16, 0.8);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-backdrop.active {
    display: flex;
}

.modal-dialog {
    background-color: var(--bg-sidebar);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    width: 500px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    animation: modal-slide-up 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-dialog.payslip-dialog {
    width: 650px;
}

@keyframes modal-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.modal-body {
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Payslip styling details */
.payslip-container {
    color: #1e293b;
    background-color: white;
    padding: 30px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.6;
}

.payslip-title-block {
    text-align: center;
    margin-bottom: 24px;
    border-bottom: 2px solid #cbd5e1;
    padding-bottom: 16px;
}

.payslip-title-block h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
}

.payslip-title-block p {
    color: #64748b;
    font-size: 0.8rem;
    margin-top: 4px;
}

.payslip-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.payslip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.payslip-label {
    color: #475569;
    font-weight: 500;
}

.payslip-val {
    color: #0f172a;
    font-weight: 600;
}

.payslip-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.payslip-table th {
    background-color: #f1f5f9;
    color: #475569;
    padding: 10px;
    border: 1px solid #cbd5e1;
    font-weight: 600;
}

.payslip-table td {
    padding: 10px;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

.payslip-table tr.total-row td {
    background-color: #f8fafc;
    font-weight: 700;
    font-size: 0.95rem;
}

.payslip-footer-notes {
    margin-top: 24px;
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: center;
    border-top: 1px dashed #e2e8f0;
    padding-top: 12px;
}

/* Printable specifications */
@media print {
    body * {
        visibility: hidden;
    }
    #modal-payslip, #modal-payslip * {
        visibility: visible;
    }
    #modal-payslip {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: auto;
        background: white;
    }
    .modal-dialog.payslip-dialog {
        border: none;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    .modal-header, .no-print {
        display: none !important;
    }
    .payslip-container {
        border: none;
        padding: 0;
        margin: 0;
    }
}

/* Spreadsheet layout styling */
.sheet-style-container {
    overflow-x: auto;
    border-radius: var(--radius-md) !important;
}

.sheet-table {
    border-collapse: separate;
    border-spacing: 0;
}

.sheet-table th {
    background-color: #ffe4e8 !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid #f1ccd3 !important;
    border-right: 1px solid #f1ccd3 !important;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 5;
}

.sheet-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
    font-size: 0.8rem;
    padding: 10px 14px !important;
}

.sheet-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.03) !important;
}

/* QR code styling */
.qr-intro-card {
    background: rgba(59, 130, 246, 0.04);
    border: 1px dashed rgba(59, 130, 246, 0.2);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.qr-card {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

.qr-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.qr-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-align: center;
}

.qr-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-align: center;
}

.qr-code-wrapper {
    background-color: white;
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
}

/* Make canvas responsive but fit container */
.qr-code-wrapper canvas, .qr-code-wrapper img {
    width: 150px !important;
    height: 150px !important;
}

.qr-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.qr-actions button, .qr-actions a {
    flex: 1;
    text-decoration: none;
}

/* ==================================================== */
/* NÂNG CẤP BẢNG CHẤM CÔNG LƯỚI (MATRIX GRID STYLE) */
/* ==================================================== */
.matrix-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.78rem;
    text-align: center;
}

.matrix-table th {
    background-color: #ffe4e8 !important;
    color: var(--text-primary) !important;
    border-bottom: 2px solid #f1ccd3 !important;
    border-right: 1px solid #f1ccd3 !important;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 10px 4px !important;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}

.matrix-table td {
    border-bottom: 1px solid rgba(244, 63, 94, 0.08) !important;
    border-right: 1px solid rgba(244, 63, 94, 0.08) !important;
    padding: 8px 4px !important;
    white-space: nowrap;
    position: relative;
}

/* Sticky columns for Left side metadata */
.matrix-table .col-stt {
    left: 0;
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    position: sticky;
    background: #fff0f3 !important;
    z-index: 6;
}

.matrix-table .col-name {
    left: 40px;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    position: sticky;
    background: #fff0f3 !important;
    text-align: left;
    z-index: 6;
    font-weight: 700;
    border-right: 1.5px solid #f1ccd3 !important;
}

.matrix-table .col-role {
    left: 190px;
    width: 110px;
    min-width: 110px;
    max-width: 110px;
    position: sticky;
    background: #fff0f3 !important;
    text-align: left;
    z-index: 6;
    border-right: 1.5px solid #f1ccd3 !important;
}

/* Ensure sticky th are stacked correctly */
.matrix-table th.col-stt { z-index: 12 !important; background: #ffe4e8 !important; }
.matrix-table th.col-name { z-index: 12 !important; background: #ffe4e8 !important; border-right: 1.5px solid #f1ccd3 !important; }
.matrix-table th.col-role { z-index: 12 !important; background: #ffe4e8 !important; border-right: 1.5px solid #f1ccd3 !important; }

/* Totals styling columns */
.matrix-table .col-total {
    background-color: rgba(244, 63, 94, 0.04);
    font-weight: 700;
}
.matrix-table .col-total-hl {
    background-color: rgba(5, 150, 105, 0.05);
    font-weight: 700;
    color: var(--color-success);
}
.matrix-table th.col-total, .matrix-table th.col-total-hl {
    background-color: #ffe4e8 !important;
}

/* Hover styling override */
.matrix-table tr:hover td:not(.col-stt):not(.col-name):not(.col-role) {
    background-color: rgba(244, 63, 94, 0.04) !important;
}
.matrix-table tr:hover td.col-stt,
.matrix-table tr:hover td.col-name,
.matrix-table tr:hover td.col-role {
    background-color: #ffdbe1 !important;
}

/* Cells design */
.matrix-cell {
    cursor: pointer;
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    transition: background-color 0.1s ease;
}

.matrix-cell:hover {
    background-color: rgba(59, 130, 246, 0.15) !important;
}

.matrix-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.72rem;
}

/* Shift code background colors */
.matrix-badge-S { background: var(--color-info-bg); color: var(--color-info); }
.matrix-badge-C { background: var(--color-warning-bg); color: var(--color-warning); }
.matrix-badge-T { background: var(--color-primary-glow); color: var(--color-primary); }
.matrix-badge-F { background: var(--color-success-bg); color: var(--color-success); }
.matrix-badge-P { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.matrix-badge-KP { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.matrix-badge-V { background: rgba(239, 68, 68, 0.08); color: rgba(239, 68, 68, 0.55); border: 1px dashed rgba(239, 68, 68, 0.25); font-weight: 500; }
.matrix-badge-OFF { color: var(--text-muted); font-weight: 400; opacity: 0.5; }

/* Attendance markers inside cells */
.late-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-danger);
    box-shadow: 0 0 5px var(--color-danger);
    z-index: 3;
}

.break-indicator {
    position: absolute;
    bottom: 3px;
    right: 3px;
    font-size: 0.62rem;
    color: var(--color-warning);
    opacity: 0.85;
    z-index: 3;
}

/* Selfie images styles in Admin Modal */
.selfie-container {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin: 16px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.selfie-box {
    text-align: center;
    flex: 1;
}

.selfie-box p {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
}

.selfie-img-wrapper {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0d1527;
}

.selfie-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selfie-placeholder {
    font-size: 0.68rem;
    color: var(--text-muted);
    line-height: 1.2;
    padding: 4px;
}

/* Mobile Portal camera style */
.camera-preview-container {
    display: none;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--color-primary);
    margin: 16px auto;
    position: relative;
    background: #0f182c;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.camera-preview-container.active {
    display: block;
}

#camera-stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror camera */
}

.camera-shutter-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
}
.camera-shutter-flash.flash {
    animation: flash-anim 0.2s ease-out;
}
@keyframes flash-anim {
    0% { opacity: 0; }
    50% { opacity: 0.95; }
    100% { opacity: 0; }
}

/* Mobile branch selection and check option */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-container input {
    width: 15px;
    height: 15px;
    cursor: pointer;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
}

/* Mobile Proposal form */
.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.request-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 8, 16, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 20px;
}
.request-modal-backdrop.active {
    display: flex;
}

/* Glassmorphic Login Screen Container */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-app);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    overflow: hidden;
}

/* Background organic glowing circles */
.login-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.login-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.25;
}

.login-shape-1 {
    width: 300px;
    height: 300px;
    background: var(--color-primary);
    top: -50px;
    left: 10%;
    animation: float-shape-1 12s infinite alternate;
}

.login-shape-2 {
    width: 400px;
    height: 400px;
    background: var(--color-info);
    bottom: -100px;
    right: 10%;
    animation: float-shape-2 15s infinite alternate;
}

@keyframes float-shape-1 {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(40px) scale(1.1); }
}

@keyframes float-shape-2 {
    0% { transform: translateY(0) scale(1.1); }
    100% { transform: translateY(-40px) scale(1.0); }
}

/* Login Card styling */
.login-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.login-logo-dot {
    display: none;
}

.login-brand-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--text-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-title {
    text-align: center;
}

.login-title h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.login-title p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrapper i {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 16px;
}

.login-input {
    width: 100%;
    padding: 12px 40px 12px 40px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
}

.login-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-glow);
}

.toggle-password-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: var(--transition-fast);
}

.toggle-password-btn:hover {
    color: var(--text-primary);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    border: none;
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-glow);
}

.login-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    background-color: var(--color-danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    display: none;
    text-align: center;
}

/* Premium Mock Phone Frame inside Admin Panel */
.mock-phone-frame {
    width: 320px;
    height: 600px;
    background: #1e1e24;
    border: 8px solid #2e2e38;
    border-radius: 36px;
    margin: 16px auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mock-phone-screen {
    flex: 1;
    background-color: #fff5f7;
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    position: relative;
    overflow-y: auto;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #3f1b24;
}

/* Custom Scrollbar for Phone Screen */
.mock-phone-screen::-webkit-scrollbar {
    width: 4px;
}
.mock-phone-screen::-webkit-scrollbar-track {
    background: transparent;
}
.mock-phone-screen::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

/* Mock Phone Status Bar */
.mock-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #8c5f6c;
    margin-bottom: 8px;
    user-select: none;
}
.mock-status-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Phone Mock Header */
.phone-header {
    text-align: center;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(244, 63, 94, 0.1);
    padding-bottom: 8px;
}
.brand-logo-img-phone {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ec4899;
    background: #fff0f3;
    display: block;
    margin: 0 auto 4px auto;
}
.brand-name-phone {
    font-size: 0.95rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ec4899, #3f1b24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.phone-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: rgba(236, 72, 153, 0.06);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 4px;
}

/* Camera Viewport */
.phone-camera-viewport {
    width: 110px;
    height: 110px;
    margin: 4px auto 12px auto;
    position: relative;
}
.phone-camera-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #ec4899;
    background: #0f182c;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.2);
}
.phone-scanner-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, transparent, #ec4899, transparent);
    top: 0;
    animation: phone-scan 2s linear infinite;
    z-index: 2;
}
@keyframes phone-scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}
.phone-avatar-placeholder {
    transition: transform 0.3s ease;
}
.phone-flash-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
}
.phone-flash-effect.flash {
    animation: phone-flash-anim 0.2s ease-out;
}
@keyframes phone-flash-anim {
    0% { opacity: 0; }
    50% { opacity: 0.9; }
    100% { opacity: 0; }
}

/* Form Styling in Phone */
.phone-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.phone-group {
    display: flex;
    flex-direction: column;
}
.phone-group label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #8c5f6c;
    margin-bottom: 3px;
}
.phone-control {
    background-color: #fff;
    border: 1px solid rgba(244, 63, 94, 0.15);
    color: #3f1b24;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    outline: none;
    width: 100%;
    height: 32px;
}
.phone-control:focus {
    border-color: #ec4899;
}

/* Phone Buttons grid */
.phone-actions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 20px;
}
.phone-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 36px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    color: white;
    transition: 0.15s ease;
}
.phone-btn i {
    width: 14px;
    height: 14px;
}
.phone-btn-success { background-color: #059669; }
.phone-btn-success:hover { filter: brightness(1.08); }
.phone-btn-warning { background-color: #ea580c; }
.phone-btn-warning:hover { filter: brightness(1.08); }
.phone-btn-info { background-color: #ec4899; }
.phone-btn-info:hover { filter: brightness(1.08); }
.phone-btn-danger { background-color: #e11d48; }
.phone-btn-danger:hover { filter: brightness(1.08); }
.phone-actions-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* Mock iOS Home Bar */
.mock-home-indicator {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: #000;
    border-radius: 2px;
    opacity: 0.3;
}

/* =========================================================
   NHÂN SỰ DASHBOARD REDESIGN (2026)
   Shared sidebar/topbar polish + view-nhan-su specific styles
   ========================================================= */

/* Missing keyframe used by the Telegram-sync spinner icon (pre-existing bug, harmless fix) */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Global nav polish: solid pink pill active state (applies to every view) --- */
.nav-item.active {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.35);
}

.nav-item.active i {
    color: #ffffff;
    filter: none;
}

/* 5th pastel stat-icon color (pink/primary) to complete the palette used across all stat cards */
.stat-icon-wrapper.primary {
    background-color: var(--color-primary-glow);
    color: var(--color-primary);
}

/* "Xem chi tiết"-style clickable subtext on stat cards */
.stat-subtext.link {
    color: var(--color-primary);
    font-weight: 700;
    cursor: pointer;
}

.stat-subtext.link:hover {
    text-decoration: underline;
}

/* --- Nhân Sự toolbar row (search + filters + actions) --- */
.ns-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ns-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ns-toolbar-filters .form-control {
    height: 40px;
    padding: 0 12px;
    width: 168px;
}

.ns-toolbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

/* --- Chart cards row --- */
.ns-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.chart-card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
    background: none;
    border: none;
}

.chart-link:hover {
    text-decoration: underline;
}

.donut-chart-body {
    display: flex;
    align-items: center;
    gap: 24px;
}

.donut-canvas-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.donut-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.donut-center-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.donut-center-label .donut-total {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.donut-center-label .donut-caption {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.chart-legend {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.chart-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.dept-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-legend .legend-name {
    flex-grow: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.chart-legend .legend-count {
    font-weight: 700;
    color: var(--text-primary);
}

.chart-legend .legend-pct {
    color: var(--text-muted);
    font-size: 0.72rem;
    min-width: 36px;
    text-align: right;
}

.bar-chart-wrap {
    height: 200px;
    position: relative;
}

/* --- Two-column body: list (left) + side cards (right) --- */
.ns-body-columns {
    display: grid;
    grid-template-columns: 1.7fr 1fr;
    gap: 20px;
    align-items: start;
}

.list-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
}

.side-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

.side-card:last-child {
    margin-bottom: 0;
}

.side-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.side-card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Status dot inline (table cells) */
.status-dot-text {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

.status-dot-text .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot-text.active { color: var(--color-success); }
.status-dot-text.active .dot { background-color: var(--color-success); box-shadow: 0 0 5px var(--color-success); }
.status-dot-text.inactive { color: var(--text-muted); }
.status-dot-text.inactive .dot { background-color: var(--text-muted); }

/* Employee identity cell */
.emp-id-code {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* Kebab action menu (positioned via JS with position:fixed to escape table overflow clipping) */
.kebab-wrap {
    position: relative;
    display: inline-block;
}

.kebab-menu {
    position: fixed;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    min-width: 170px;
    z-index: 500;
    overflow: hidden;
    display: none;
}

.kebab-menu.active {
    display: block;
}

.kebab-menu button {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: none;
    border: none;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.kebab-menu button:hover {
    background-color: rgba(236, 72, 153, 0.08);
}

.kebab-menu button.danger {
    color: var(--color-danger);
}

.kebab-menu button i {
    width: 14px;
    height: 14px;
}

/* Pagination */
.ns-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}

.ns-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ns-page-btn:hover:not(:disabled) {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.ns-page-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.ns-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Empty-state placeholder (used when no real data exists, e.g. birthdays / contract end dates) */
.ns-empty-note {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    padding: 20px 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.5;
}

.ns-empty-note i {
    width: 26px;
    height: 26px;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Sinh nhật trong tháng list */
.ns-birthday-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.birthday-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.birthday-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.avatar-circle-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.birthday-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.birthday-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.birthday-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.birthday-today {
    color: var(--color-primary);
    font-weight: 700;
}

.birthday-gift-icon {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
    opacity: 0.7;
    flex-shrink: 0;
}

/* Tin tức nội bộ card */
.news-card-body {
    display: flex;
    gap: 12px;
}

.news-thumb {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(236,72,153,0.18), rgba(236,72,153,0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    flex-shrink: 0;
}

.news-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    color: white;
    background-color: var(--color-primary);
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 6px;
}

.news-headline {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.news-snippet {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.news-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* New "coming soon" placeholder view sections (6 new nav items) */
.coming-soon-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
    min-height: 50vh;
    color: var(--text-secondary);
}

.coming-soon-view .coming-soon-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--color-primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.coming-soon-view .coming-soon-icon i {
    width: 30px;
    height: 30px;
}

.coming-soon-view h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.coming-soon-view p {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 380px;
}

@media (max-width: 1300px) {
    .ns-charts-row { grid-template-columns: 1fr; }
    .ns-body-columns { grid-template-columns: 1fr; }
}

/* ===== Bảng Thưởng — brighter card look, scoped to this view only ===== */
#view-bang-thuong .stats-grid .stat-card {
    border: none;
    background: linear-gradient(135deg, var(--bt-card-from), var(--bt-card-to));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

#view-bang-thuong .stats-grid .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#view-bang-thuong .stats-grid .stat-card:nth-child(1) { --bt-card-from: #fdf2f8; --bt-card-to: #fce7f3; }
#view-bang-thuong .stats-grid .stat-card:nth-child(2) { --bt-card-from: #eff6ff; --bt-card-to: #dbeafe; }
#view-bang-thuong .stats-grid .stat-card:nth-child(3) { --bt-card-from: #fffbeb; --bt-card-to: #fef3c7; }
#view-bang-thuong .stats-grid .stat-card:nth-child(4) { --bt-card-from: #f0fdf4; --bt-card-to: #dcfce7; }
#view-bang-thuong .stats-grid .stat-card:nth-child(5) { --bt-card-from: #eef2ff; --bt-card-to: #e0e7ff; }
#view-bang-thuong .stats-grid .stat-card:nth-child(6) { --bt-card-from: #fff7ed; --bt-card-to: #ffedd5; }
#view-bang-thuong .stats-grid .stat-card:nth-child(7) { --bt-card-from: #fdf4ff; --bt-card-to: #fae8ff; }

#view-bang-thuong .stats-grid .stat-icon-wrapper {
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

#view-bang-thuong .stat-value {
    font-size: 1.3rem;
    font-weight: 800;
}

#view-bang-thuong .bt-branch-card {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

#view-bang-thuong .bt-branch-header {
    background: linear-gradient(90deg, #fce7f3, #ede9fe);
}

#view-bang-thuong .bt-branch-header:hover {
    background: linear-gradient(90deg, #fbcfe8, #ddd6fe);
}

#view-bang-thuong .bt-pool-banner {
    background: linear-gradient(90deg, #fffbeb, #fef3c7);
}

#view-bang-thuong .bt-fb-header {
    background: linear-gradient(90deg, #dbeafe, #e0e7ff);
}

#view-bang-thuong .data-table thead th {
    background: var(--bg-secondary, #f8fafc);
}

/* ===== Target & Thưởng — replace dark glass cards with the site's bright
   theme, scoped to this view only ===== */
#view-target-thuong .tt-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#view-target-thuong .stats-grid .stat-card {
    border: none;
    background: linear-gradient(135deg, var(--tt-card-from), var(--tt-card-to));
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

#view-target-thuong .stats-grid .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#view-target-thuong .stats-grid .stat-card:nth-child(1) { --tt-card-from: #eff6ff; --tt-card-to: #dbeafe; }
#view-target-thuong .stats-grid .stat-card:nth-child(2) { --tt-card-from: #f0fdf4; --tt-card-to: #dcfce7; }
#view-target-thuong .stats-grid .stat-card:nth-child(3) { --tt-card-from: #fffbeb; --tt-card-to: #fef3c7; }
#view-target-thuong .stats-grid .stat-card:nth-child(4) { --tt-card-from: #fdf2f8; --tt-card-to: #fce7f3; }

#view-target-thuong .stats-grid .stat-icon-wrapper {
    background: rgba(255, 255, 255, 0.65);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

#view-target-thuong .data-table thead th {
    background: var(--bg-secondary, #f8fafc);
}

