/* =============================================
   IVYATTENDANCE - MODERN RED & GREY THEME
   ============================================= */

/* CSS Variables */
:root {
    --primary-red: #c0392b;
    --light-red: #e74c3c;
    --dark-red: #922b21;
    --gradient-red: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    --primary-gray: #7f8c8d;
    --light-gray: #ecf0f1;
    --mid-gray: #bdc3c7;
    --dark-gray: #2c3e50;
    --card-gray: #f8f9fa;
    --white: #ffffff;
    --black: #1a1a2e;
    --shadow: 0 4px 15px rgba(0,0,0,0.12);
    --shadow-red: 0 4px 15px rgba(192,57,43,0.35);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    background: linear-gradient(135deg, #2c3e50 0%, #4a4a6a 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    position: relative;
    height: 100vh;
    overflow: hidden;
    background-color: var(--white);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}

@media (min-width: 992px) {
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        border-radius: 0;
        height: 100vh;
    }
    
    body {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }
}

/* =============================================
   SCREEN STYLES
   ============================================= */
.screen {
    display: none;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    padding: 20px;
    flex-direction: column;
    overflow-y: auto;
}

.screen.active {
    display: flex;
}

/* Desktop Layout Improvements */
@media (min-width: 992px) {
    .screen {
        padding: 30px;
    }
    
    .content {
        padding: 30px 0;
    }
    
    /* Center layout for home screen */
    #home-screen .content,
    #check-out-confirm .content {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 20px;
    }
    
    #home-screen .datetime-card,
    #check-out-confirm .datetime-card {
        width: 100%;
        max-width: 400px;
        margin: 0 auto 16px auto;
    }
    
    #home-screen .location-info-row,
    #check-out-confirm .location-info-row,
    #home-screen .geofence-status,
    #check-out-confirm .geofence-status {
        width: 100%;
        max-width: 600px;
    }
    
    #home-screen .check-in-container,
    #check-out-confirm .check-status-container {
        width: 100%;
        max-width: 600px;
    }
    
    /* Attendance history table improvements */
    .history-table {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }
    
    /* Profile page improvements */
    #staff-profile .profile-container {
        max-width: 800px;
        margin: 0 auto;
    }
    
    /* Admin screens improvements */
    .admin-filter-card {
        max-width: 800px;
        margin: 0 auto 20px auto;
    }
    
    #admin-history-table-wrap,
    #admin-users-table-wrap {
        max-width: 800px;
        margin: 0 auto;
    }
    
    /* Leave application improvements */
    #leave-apply .content {
        max-width: 800px;
        margin: 0 auto;
    }
}

/* =============================================
   SPLASH SCREEN
   ============================================= */
#splash-screen {
    background: var(--gradient-red);
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Logo Styles */
.logo-icon {
    width: 120px;
    height: 120px;
    position: relative;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.leaf {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.9);
    border-radius: 50% 0;
    transform-origin: bottom center;
}

.left-leaf {
    left: 20px;
    transform: rotate(-45deg);
}

.right-leaf {
    right: 20px;
    transform: rotate(45deg);
}

.stem {
    position: absolute;
    width: 8px;
    height: 60px;
    background-color: rgba(255,255,255,0.9);
    left: 50%;
    top: 30px;
    transform: translateX(-50%);
    border-radius: 0 0 4px 4px;
}

#splash-screen h1 {
    color: var(--white);
    font-size: 38px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 10px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#splash-screen p {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-top: 8px;
    letter-spacing: 1px;
}

/* =============================================
   LOGIN SCREEN (in index.php)
   ============================================= */
#login-screen {
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    background: var(--card-gray);
}

#login-screen h2 {
    color: var(--dark-gray);
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 700;
}

/* =============================================
   FORM STYLES
   ============================================= */
.form-group {
    width: 100%;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: var(--dark-gray);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--mid-gray);
    border-radius: var(--radius-sm);
    background-color: var(--white);
    font-size: 15px;
    color: var(--dark-gray);
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.12);
    background-color: var(--white);
}

.form-group input::placeholder {
    color: var(--mid-gray);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
    padding: 13px 24px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--gradient-red);
    color: var(--white);
    box-shadow: var(--shadow-red);
    width: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #a93226 0%, #c0392b 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(192,57,43,0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--dark-gray);
    border: 2px solid var(--mid-gray);
}

.btn-secondary:hover {
    background-color: var(--mid-gray);
    color: var(--white);
}

.btn-check-in {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: var(--white);
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(39,174,96,0.4);
    letter-spacing: 1px;
    transition: var(--transition);
}

.btn-check-in:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39,174,96,0.5);
}

.btn-checkout {
    background: var(--gradient-red);
    color: var(--white);
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 800;
    margin: 20px 0;
    box-shadow: var(--shadow-red);
    letter-spacing: 1px;
    transition: var(--transition);
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(192,57,43,0.5);
}

.btn-checked {
    background-color: var(--light-gray);
    color: var(--primary-gray);
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    border: 2px solid var(--mid-gray);
    cursor: not-allowed;
}

.btn-logout {
    background: var(--gradient-red);
    color: var(--white);
    padding: 12px 35px;
    border-radius: 50px;
    margin-top: 25px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: var(--shadow-red);
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.btn-logout:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(192,57,43,0.45);
}

.button-group {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
}

.button-group .btn {
    flex: 1;
}

/* =============================================
   LOCATION PERMISSION SCREEN
   ============================================= */
#location-permission {
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--card-gray);
}

#location-permission .permission-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 30px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 340px;
}

#location-permission .permission-icon {
    width: 70px;
    height: 70px;
    background: var(--gradient-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 30px;
}

#location-permission h2 {
    color: var(--dark-gray);
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 700;
}

#location-permission p {
    color: var(--primary-gray);
    margin-bottom: 30px;
    font-size: 14px;
    line-height: 1.6;
}

/* =============================================
   HEADER STYLES
   ============================================= */
.header {
    background: var(--gradient-red);
    color: var(--white);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(192,57,43,0.3);
    flex-shrink: 0;
}

@media (min-width: 992px) {
    .header {
        width: calc(100% + 60px);
        margin-left: -30px;
        padding: 20px 30px;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
    }
    
    .header h2 {
        font-size: 22px;
    }
}

.header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.header h2 span {
    color: rgba(255,255,255,0.85);
    font-weight: 400;
}

.user-icon, .location-icon, .back-button {
    width: 36px;
    height: 36px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.user-icon:hover, .back-button:hover {
    background-color: rgba(255,255,255,0.35);
}

.back-button {
    background-color: rgba(255,255,255,0.15);
}

/* =============================================
   CONTENT STYLES
   ============================================= */
.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    overflow-y: auto;
}

/* =============================================
   HOME SCREEN - CHECK IN/OUT
   ============================================= */
.check-in-container, .check-status-container {
    text-align: center;
    width: 100%;
}

.check-in-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px 20px;
    box-shadow: var(--shadow);
    margin: 15px 0;
    width: 100%;
    border-left: 4px solid var(--primary-red);
}

.check-in-container p, .check-status-container p {
    margin: 6px 0;
    color: var(--primary-gray);
    font-size: 14px;
}

.status {
    margin-top: 20px !important;
    font-weight: 700;
    font-size: 15px;
    color: var(--dark-gray);
}

.not-checked {
    color: var(--primary-red);
    font-weight: 700;
}

.checked {
    color: #27ae60;
    font-weight: 700;
}

/* Date/Time display */
.datetime-display {
    background: var(--gradient-red);
    color: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-red);
}

.datetime-display .time {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 2px;
}

.datetime-display .date {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
}

/* =============================================
   CHECK DETAILS
   ============================================= */
.check-details {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    width: 100%;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--primary-red);
}

.check-details p {
    margin: 12px 0;
    color: var(--dark-gray);
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--light-gray);
}

.check-details p:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.check-details p strong {
    color: var(--primary-gray);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#check-location {
    color: #27ae60;
    font-weight: 700;
}

/* =============================================
   NAVIGATION BAR
   ============================================= */
.nav-bar {
    display: flex;
    justify-content: space-around;
    background: var(--dark-gray);
    padding: 12px 0;
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-bottom: -20px;
    flex-shrink: 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
}

@media (min-width: 992px) {
    .nav-bar {
        width: calc(100% + 60px);
        margin-left: -30px;
        padding: 15px 0;
        border-bottom-left-radius: 15px;
        border-bottom-right-radius: 15px;
    }
    
    .nav-item {
        width: 60px;
        height: 50px;
    }
}

.nav-item {
    width: 50px;
    height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.08);
}

.nav-item.active {
    background-color: rgba(192,57,43,0.25);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary-red);
    border-radius: 2px 2px 0 0;
}

/* =============================================
   ATTENDANCE HISTORY
   ============================================= */
#attendance-history .content {
    justify-content: flex-start;
    padding: 15px 0;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.history-table th {
    background: var(--gradient-red);
    color: var(--white);
    padding: 14px 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-table td {
    padding: 13px 10px;
    text-align: center;
    border-bottom: 1px solid var(--light-gray);
    font-size: 13px;
    color: var(--dark-gray);
}

.history-table tr:nth-child(even) td {
    background-color: var(--card-gray);
}

.history-table tr:hover td {
    background-color: rgba(192,57,43,0.05);
}

.history-table tr:last-child td {
    border-bottom: none;
}

/* =============================================
   STAFF PROFILE
   ============================================= */
#staff-profile .content {
    justify-content: flex-start;
    padding-top: 25px;
}

.profile-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-red);
    overflow: hidden;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-red);
    border: 4px solid var(--white);
    outline: 3px solid var(--primary-red);
}

.avatar {
    width: 80px;
    height: 80px;
    position: relative;
    background-color: rgba(255,255,255,0.3);
    border-radius: 50%;
}

.avatar:before {
    content: '';
    position: absolute;
    width: 38px;
    height: 38px;
    background-color: rgba(255,255,255,0.85);
    border-radius: 50%;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
}

.avatar:after {
    content: '';
    position: absolute;
    width: 58px;
    height: 58px;
    background-color: rgba(255,255,255,0.85);
    border-radius: 50%;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
}

.profile-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-gray);
    margin-bottom: 4px;
}

.profile-role-badge {
    display: inline-block;
    background: var(--gradient-red);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 18px;
}

.profile-info-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    width: 100%;
    box-shadow: var(--shadow);
    margin-bottom: 12px;
    border-left: 4px solid var(--primary-red);
    text-align: left;
}

.profile-info-card .info-row {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--light-gray);
    font-size: 13px;
}

.profile-info-card .info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.profile-info-card .info-label {
    color: var(--primary-gray);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 110px;
    flex-shrink: 0;
}

.profile-info-card .info-value {
    color: var(--dark-gray);
    font-weight: 600;
    font-size: 13px;
}

/* =============================================
   PROFILE IMAGE UPLOAD
   ============================================= */

/* Wrapper that holds the circle + overlay */
.profile-image-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
}

/* The actual image circle — keep existing .profile-image styles,
   but when inside wrapper remove its own margin */
.profile-image-wrapper .profile-image {
    margin-bottom: 0;
    width: 100%;
    height: 100%;
}

/* Actual <img> tag inside the circle */
.profile-img-tag {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* Dark overlay that appears on hover */
.profile-image-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.profile-image-wrapper:hover .profile-image-overlay,
.profile-image-wrapper:focus .profile-image-overlay {
    opacity: 1;
}

/* Camera emoji inside overlay */
.camera-icon {
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

/* Upload status message below avatar */
.upload-status {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-align: center;
    transition: var(--transition);
}

.upload-status.uploading {
    background: rgba(44,62,80,0.08);
    color: var(--dark-gray);
    border: 1px solid var(--mid-gray);
}

.upload-status.success {
    background: rgba(39,174,96,0.12);
    color: #1e8449;
    border: 1px solid rgba(39,174,96,0.3);
}

.upload-status.error {
    background: rgba(192,57,43,0.1);
    color: var(--dark-red);
    border: 1px solid rgba(192,57,43,0.3);
}

/* Spinning loader ring on the avatar while uploading */
.profile-image-wrapper.uploading::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary-red);
    animation: spin 0.8s linear infinite;
}

/* =============================================
   LOGIN PAGE (login.php) - FULL REDESIGN
   ============================================= */
.login-page-body {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 50%, #2c3e50 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo-section {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-icon {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    border: 3px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    position: relative;
}

.login-logo-icon .leaf {
    width: 22px;
    height: 22px;
    background-color: rgba(255,255,255,0.95);
    border-radius: 50% 0;
    position: absolute;
    transform-origin: bottom center;
}

.login-logo-icon .left-leaf {
    left: 16px;
    top: 18px;
    transform: rotate(-45deg);
}

.login-logo-icon .right-leaf {
    right: 16px;
    top: 18px;
    transform: rotate(45deg);
}

.login-logo-icon .stem {
    position: absolute;
    width: 5px;
    height: 32px;
    background-color: rgba(255,255,255,0.95);
    left: 50%;
    top: 22px;
    transform: translateX(-50%);
    border-radius: 0 0 3px 3px;
}

.login-logo-section h1 {
    color: var(--white);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.login-logo-section p {
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

/* Tab System */
.auth-tabs {
    display: flex;
    background: var(--light-gray);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 28px;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-gray);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.auth-tab.active {
    background: var(--gradient-red);
    color: var(--white);
    box-shadow: var(--shadow-red);
}

.auth-tab:hover:not(.active) {
    background: var(--mid-gray);
    color: var(--white);
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-form h2 {
    color: var(--dark-gray);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-form .subtitle {
    color: var(--primary-gray);
    font-size: 13px;
    margin-bottom: 22px;
    line-height: 1.5;
}

/* Input with icon */
.input-group {
    position: relative;
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: var(--dark-gray);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border: 2px solid var(--mid-gray);
    border-radius: var(--radius-sm);
    background-color: var(--card-gray);
    font-size: 14px;
    color: var(--dark-gray);
    transition: var(--transition);
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
    background-color: var(--white);
}

.input-group input::placeholder {
    color: var(--mid-gray);
    font-size: 13px;
}

.input-icon {
    position: absolute;
    left: 14px;
    bottom: 13px;
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

/* Email icon */
.icon-email::before {
    content: '✉';
    font-size: 14px;
    color: var(--primary-red);
    opacity: 0.7;
}

/* Password icon */
.icon-password::before {
    content: '🔒';
    font-size: 12px;
}

/* User icon */
.icon-user::before {
    content: '👤';
    font-size: 12px;
}

/* Phone icon */
.icon-phone::before {
    content: '📱';
    font-size: 12px;
}

/* Department icon */
.icon-dept::before {
    content: '🏢';
    font-size: 12px;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Alert Messages */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-error {
    background: rgba(192,57,43,0.1);
    border: 1px solid rgba(192,57,43,0.3);
    color: var(--dark-red);
}

.alert-success {
    background: rgba(39,174,96,0.1);
    border: 1px solid rgba(39,174,96,0.3);
    color: #1e8449;
}

.alert::before {
    font-size: 16px;
    flex-shrink: 0;
}

.alert-error::before { content: '⚠️'; }
.alert-success::before { content: '✅'; }

/* Submit Button */
.btn-auth {
    width: 100%;
    padding: 14px;
    background: var(--gradient-red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-red);
    letter-spacing: 0.5px;
    margin-top: 6px;
}

.btn-auth:hover {
    background: linear-gradient(135deg, #a93226 0%, #c0392b 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(192,57,43,0.45);
}

.btn-auth:active {
    transform: translateY(0);
}

.divider {
    text-align: center;
    margin: 18px 0;
    position: relative;
    color: var(--primary-gray);
    font-size: 12px;
}

.divider::before, .divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--mid-gray);
}

.divider::before { left: 0; }
.divider::after  { right: 0; }

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--primary-gray);
    font-size: 12px;
}

/* =============================================
   HOME SCREEN ENHANCEMENTS
   ============================================= */
.datetime-card {
    background: var(--gradient-red);
    border-radius: var(--radius);
    padding: 18px 20px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 16px auto;
    box-shadow: var(--shadow-red);
    text-align: center;
    color: var(--white);
}

.datetime-card .time-big {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: 3px;
    line-height: 1;
}

.datetime-card .date-small {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* Pulse animation for check-in button */
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(39,174,96,0.5); }
    70%  { box-shadow: 0 0 0 14px rgba(39,174,96,0); }
    100% { box-shadow: 0 0 0 0 rgba(39,174,96,0); }
}

.btn-check-in {
    animation: pulse 2s infinite;
}

@keyframes pulseRed {
    0%   { box-shadow: 0 0 0 0 rgba(192,57,43,0.5); }
    70%  { box-shadow: 0 0 0 14px rgba(192,57,43,0); }
    100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
}

.btn-checkout {
    animation: pulseRed 2s infinite;
}

.status-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.status-badge.not-in {
    background: rgba(192,57,43,0.12);
    color: var(--primary-red);
    border: 1px solid rgba(192,57,43,0.25);
}

.status-badge.checked-in {
    background: rgba(39,174,96,0.12);
    color: #27ae60;
    border: 1px solid rgba(39,174,96,0.25);
}

.status-badge.checked-out {
    background: rgba(127,140,141,0.12);
    color: var(--primary-gray);
    border: 1px solid rgba(127,140,141,0.25);
}

/* History status badges */
.badge-in {
    background: rgba(39,174,96,0.12);
    color: #27ae60;
    border: 1px solid rgba(39,174,96,0.25);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

.badge-out {
    background: rgba(192,57,43,0.12);
    color: var(--primary-red);
    border: 1px solid rgba(192,57,43,0.25);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

/* =============================================
   ERROR MESSAGE (legacy)
   ============================================= */
.error-message {
    background: rgba(192,57,43,0.1);
    border: 1px solid rgba(192,57,43,0.3);
    color: var(--dark-red);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
}

/* =============================================
   LOCATION INFO ROW (Home Screen)
   ============================================= */
.location-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-gray);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 16px;
    min-height: 40px;
}

.location-dot {
    width: 10px;
    height: 10px;
    background: var(--primary-red);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.2);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%   { box-shadow: 0 0 0 0 rgba(192,57,43,0.4); }
    70%  { box-shadow: 0 0 0 7px rgba(192,57,43,0); }
    100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
}

.location-address-text {
    flex: 1;
    font-size: 12px;
    color: var(--dark-gray);
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-map-mini {
    background: var(--gradient-red);
    color: var(--white);
    border: none;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
    box-shadow: 0 2px 6px rgba(192,57,43,0.3);
    letter-spacing: 0.3px;
}

.btn-map-mini:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(192,57,43,0.4);
}

/* =============================================
   COORDS & ACCURACY BADGES (Check-in Confirm)
   ============================================= */
.coords-badge {
    display: inline-block;
    background: rgba(44,62,80,0.08);
    color: var(--dark-gray);
    font-size: 10px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    border: 1px solid rgba(44,62,80,0.15);
}

.coords-badge:empty { display: none; }

.accuracy-badge {
    display: inline-block;
    background: rgba(39,174,96,0.1);
    color: #1e8449;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(39,174,96,0.25);
}

.accuracy-badge:empty { display: none; }

/* Full-width map button on confirm screen */
.btn-map-full {
    width: 100%;
    padding: 11px 16px;
    background: rgba(192,57,43,0.07);
    color: var(--primary-red);
    border: 1.5px solid rgba(192,57,43,0.25);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.btn-map-full:hover {
    background: rgba(192,57,43,0.13);
    border-color: var(--primary-red);
}

/* =============================================
   MAP SCREEN
   ============================================= */
#map-screen {
    padding: 0;
}

#map-screen .header {
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
    margin: 0;
    width: 100%;
}

#map-screen .content {
    padding: 0 !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Leaflet map container */
#leaflet-map {
    flex: 1;
    width: 100%;
    min-height: 0;
    /* height is set dynamically by JS */
    z-index: 1;
    background: #e8e8e8;
}

/* Map info panel below the map */
.map-info-panel {
    background: var(--white);
    border-top: 3px solid var(--primary-red);
    padding: 14px 16px;
    flex-shrink: 0;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    overflow-y: auto;
    max-height: 200px;
}

.map-info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--light-gray);
}

.map-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.map-info-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.map-info-text {
    flex: 1;
    min-width: 0;
}

.map-info-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-gray);
    margin-bottom: 2px;
}

.map-info-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-gray);
    line-height: 1.4;
    word-break: break-word;
}

.map-info-value.mono {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--dark-gray);
}

/* Refresh button in map header */
.btn-refresh-map {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    line-height: 1;
}

.btn-refresh-map:hover {
    background: rgba(255,255,255,0.35);
    transform: rotate(90deg);
}

.btn-refresh-map.spinning {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* =============================================
   ADMIN HISTORY SCREEN
   ============================================= */

/* Button in admin badge on home screen */
.btn-admin-history {
    display: inline-block;
    background: var(--gradient-red);
    color: var(--white);
    border: none;
    border-radius: 20px;
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-red);
    letter-spacing: 0.3px;
}

.btn-admin-history:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(192,57,43,0.45);
}

/* Filter card */
.admin-filter-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    width: 100%;
    margin-bottom: 12px;
    border-top: 3px solid var(--primary-red);
}

.admin-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.admin-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-filter-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-filter-input {
    width: 100%;
    padding: 9px 11px;
    border: 1.5px solid var(--mid-gray);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--dark-gray);
    background: var(--card-gray);
    outline: none;
    transition: var(--transition);
}

.admin-filter-input:focus {
    border-color: var(--primary-red);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

.admin-filter-input::placeholder {
    color: var(--mid-gray);
    font-size: 12px;
}

.admin-filter-actions {
    display: flex;
    gap: 8px;
}

.btn-filter-search {
    flex: 1;
    padding: 9px 14px;
    background: var(--gradient-red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(192,57,43,0.3);
    letter-spacing: 0.3px;
}

.btn-filter-search:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(192,57,43,0.4);
}

.btn-filter-search:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-filter-reset {
    padding: 9px 14px;
    background: var(--light-gray);
    color: var(--dark-gray);
    border: 1.5px solid var(--mid-gray);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-filter-reset:hover:not(:disabled) {
    background: var(--mid-gray);
    color: var(--white);
}

.btn-filter-reset:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Result info bar */
.admin-result-info {
    width: 100%;
    padding: 6px 12px;
    background: rgba(192,57,43,0.06);
    border: 1px solid rgba(192,57,43,0.15);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-red);
    margin-bottom: 10px;
    text-align: center;
}

/* Loading state */
.admin-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    width: 100%;
    color: var(--primary-gray);
    font-size: 13px;
    font-weight: 600;
}

.admin-loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--light-gray);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* Admin history table overrides */
.admin-history-table th,
.admin-history-table td {
    padding: 10px 8px;
    font-size: 12px;
}

.admin-history-table th {
    font-size: 11px;
}

.admin-col-name {
    font-weight: 600;
    color: var(--dark-gray);
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-col-email {
    color: var(--primary-gray);
    font-size: 11px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty / placeholder cell */
.admin-empty-cell {
    padding: 28px 16px !important;
    color: var(--primary-gray);
    font-style: italic;
    font-size: 13px;
    text-align: center;
}

/* Load More button */
.btn-load-more {
    width: 100%;
    margin-top: 12px;
    padding: 11px 16px;
    background: var(--white);
    color: var(--primary-red);
    border: 1.5px solid rgba(192,57,43,0.3);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.3px;
}

.btn-load-more:hover {
    background: rgba(192,57,43,0.06);
    border-color: var(--primary-red);
}

/* =============================================
   GEOFENCE STATUS BANNER
   ============================================= */
.geofence-status {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    margin-bottom: 12px;
    width: 100%;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.4;
    transition: var(--transition);
    border: 1.5px solid transparent;
}

.geofence-status.loading {
    background: rgba(127,140,141,0.1);
    border-color: rgba(127,140,141,0.25);
    color: var(--primary-gray);
}

.geofence-status.within {
    background: rgba(39,174,96,0.1);
    border-color: rgba(39,174,96,0.35);
    color: #1e8449;
}

.geofence-status.outside {
    background: rgba(192,57,43,0.08);
    border-color: rgba(192,57,43,0.3);
    color: var(--dark-red);
}

/* =============================================
   ADMIN USERS SCREEN
   ============================================= */

/* Total users summary badge */
.users-summary-badge {
    width: 100%;
    background: linear-gradient(135deg, rgba(192,57,43,0.08) 0%, rgba(192,57,43,0.04) 100%);
    border: 1px solid rgba(192,57,43,0.2);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-red);
}

/* Admin users table — tighter columns */
.admin-users-table th,
.admin-users-table td {
    padding: 9px 6px;
    font-size: 11px;
}

.admin-users-table th {
    font-size: 10px;
    letter-spacing: 0.3px;
}

.admin-users-col-num {
    color: var(--primary-gray);
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.admin-users-col-name {
    font-weight: 700;
    color: var(--dark-gray);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-users-col-id {
    font-size: 11px;
    color: var(--primary-gray);
    font-weight: 600;
    white-space: nowrap;
}

.admin-users-col-dept {
    font-size: 11px;
    color: var(--dark-gray);
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-users-col-phone {
    font-size: 11px;
    color: var(--dark-gray);
    white-space: nowrap;
}

.admin-users-col-email {
    font-size: 10px;
    color: var(--primary-gray);
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Disabled state for check-in / check-out buttons ── */
.btn-check-in:disabled {
    background: var(--light-gray) !important;
    color: var(--primary-gray) !important;
    box-shadow: none !important;
    animation: none !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.65;
    border: 2px solid var(--mid-gray);
}

.btn-checkout:disabled {
    background: var(--light-gray) !important;
    color: var(--primary-gray) !important;
    box-shadow: none !important;
    animation: none !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.65;
    border: 2px solid var(--mid-gray);
}

/* =============================================
   LEAVE / MC FEATURE STYLES
   ============================================= */

/* Leave icon in nav bar */
.leave-icon {
    position: relative;
}
.leave-icon:before {
    content: '';
    position: absolute;
    width: 14px;
    height: 16px;
    background-color: white;
    border-radius: 2px 2px 2px 2px;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    border: 2px solid white;
}
.leave-icon:after {
    content: '';
    position: absolute;
    width: 8px;
    height: 2px;
    background-color: var(--dark-gray);
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 3px 0 var(--dark-gray), 0 6px 0 var(--dark-gray);
}

/* ── Leave Tab Bar ── */
.leave-tab-bar {
    display: flex;
    background: var(--light-gray);
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 14px;
    gap: 4px;
    width: 100%;
    flex-shrink: 0;
}

.leave-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-gray);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.2px;
}

.leave-tab.active {
    background: var(--gradient-red);
    color: var(--white);
    box-shadow: var(--shadow-red);
}

.leave-tab:hover:not(.active) {
    background: var(--mid-gray);
    color: var(--white);
}

/* ── Leave Panel ── */
.leave-panel {
    width: 100%;
}

/* ── Leave Form Card ── */
.leave-form-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    width: 100%;
    border-top: 3px solid var(--primary-red);
}

.leave-form-group {
    margin-bottom: 14px;
}

.leave-form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 7px;
}

.required-star {
    color: var(--primary-red);
}

.leave-form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--mid-gray);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--dark-gray);
    background: var(--card-gray);
    outline: none;
    transition: var(--transition);
    appearance: none;
    -webkit-appearance: none;
}

.leave-form-input:focus {
    border-color: var(--primary-red);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

.leave-form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--mid-gray);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--dark-gray);
    background: var(--card-gray);
    outline: none;
    transition: var(--transition);
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.leave-form-textarea:focus {
    border-color: var(--primary-red);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

.leave-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

/* ── Leave Type Grid ── */
.leave-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.leave-type-option {
    cursor: pointer;
}

.leave-type-option input[type="radio"] {
    display: none;
}

.leave-type-btn {
    display: block;
    padding: 9px 8px;
    border: 1.5px solid var(--mid-gray);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-gray);
    text-align: center;
    background: var(--card-gray);
    transition: var(--transition);
    cursor: pointer;
    line-height: 1.4;
}

.leave-type-option input[type="radio"]:checked + .leave-type-btn {
    background: rgba(192,57,43,0.08);
    border-color: var(--primary-red);
    color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(192,57,43,0.15);
}

.leave-type-btn:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

/* ── Duration Info ── */
.leave-duration-info {
    background: rgba(39,174,96,0.08);
    border: 1px solid rgba(39,174,96,0.25);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #1e8449;
    margin-bottom: 14px;
    text-align: center;
}

/* ── MC Upload Area ── */
.mc-upload-section {
    margin-bottom: 14px;
}

.mc-upload-area {
    border: 2px dashed var(--mid-gray);
    border-radius: var(--radius-sm);
    background: var(--card-gray);
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
}

.mc-upload-area:hover {
    border-color: var(--primary-red);
    background: rgba(192,57,43,0.03);
}

.mc-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    gap: 4px;
}

.mc-file-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(39,174,96,0.06);
    border-color: rgba(39,174,96,0.4);
}

.mc-file-remove {
    background: rgba(192,57,43,0.1);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-red);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: var(--transition);
}

.mc-file-remove:hover {
    background: var(--primary-red);
    color: var(--white);
}

/* ── Leave Alert ── */
.leave-alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.5;
}

.leave-alert.success {
    background: rgba(39,174,96,0.1);
    border: 1px solid rgba(39,174,96,0.3);
    color: #1e8449;
}

.leave-alert.error {
    background: rgba(192,57,43,0.08);
    border: 1px solid rgba(192,57,43,0.3);
    color: var(--dark-red);
}

/* ── Submit Button ── */
.btn-leave-submit {
    width: 100%;
    padding: 13px;
    background: var(--gradient-red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-red);
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.btn-leave-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(192,57,43,0.45);
}

.btn-leave-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Leave History Cards (User) ── */
.leave-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    width: 100%;
    margin-bottom: 10px;
    border-left: 4px solid var(--mid-gray);
    transition: var(--transition);
}

.leave-card.pending  { border-left-color: #f39c12; }
.leave-card.approved { border-left-color: #27ae60; }
.leave-card.rejected { border-left-color: var(--primary-red); }

.leave-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.leave-card-type {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark-gray);
    flex: 1;
}

.leave-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.leave-status-badge.pending  { background: rgba(243,156,18,0.12);  color: #d68910; border: 1px solid rgba(243,156,18,0.3); }
.leave-status-badge.approved { background: rgba(39,174,96,0.12);   color: #1e8449; border: 1px solid rgba(39,174,96,0.3); }
.leave-status-badge.rejected { background: rgba(192,57,43,0.1);    color: var(--dark-red); border: 1px solid rgba(192,57,43,0.3); }

.leave-card-dates {
    font-size: 12px;
    color: var(--primary-gray);
    font-weight: 600;
    margin-bottom: 6px;
}

.leave-card-reason {
    font-size: 12px;
    color: var(--primary-gray);
    line-height: 1.5;
    margin-bottom: 6px;
}

.leave-card-admin-notes {
    font-size: 11px;
    color: var(--dark-gray);
    background: var(--card-gray);
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 6px;
    border-left: 3px solid var(--mid-gray);
    line-height: 1.5;
}

.leave-card-mc-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-red);
    text-decoration: none;
    background: rgba(192,57,43,0.07);
    border: 1px solid rgba(192,57,43,0.2);
    border-radius: 6px;
    padding: 4px 10px;
    margin-top: 6px;
    transition: var(--transition);
}

.leave-card-mc-link:hover {
    background: rgba(192,57,43,0.14);
}

/* ── Admin Leave Cards ── */
.admin-leave-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    width: 100%;
    margin-bottom: 10px;
    border-left: 4px solid var(--mid-gray);
}

.admin-leave-card.pending  { border-left-color: #f39c12; }
.admin-leave-card.approved { border-left-color: #27ae60; }
.admin-leave-card.rejected { border-left-color: var(--primary-red); }

.admin-leave-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

.admin-leave-employee {
    font-size: 13px;
    font-weight: 700;
    color: var(--dark-gray);
}

.admin-leave-dept {
    font-size: 11px;
    color: var(--primary-gray);
    font-weight: 500;
}

.admin-leave-meta {
    font-size: 12px;
    color: var(--primary-gray);
    margin-bottom: 8px;
    line-height: 1.6;
}

.admin-leave-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.btn-leave-approve {
    flex: 1;
    padding: 8px 12px;
    background: rgba(39,174,96,0.1);
    color: #1e8449;
    border: 1.5px solid rgba(39,174,96,0.35);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-leave-approve:hover {
    background: #27ae60;
    color: var(--white);
    border-color: #27ae60;
}

.btn-leave-reject {
    flex: 1;
    padding: 8px 12px;
    background: rgba(192,57,43,0.08);
    color: var(--dark-red);
    border: 1.5px solid rgba(192,57,43,0.3);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-leave-reject:hover {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

/* ── Review Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: var(--white);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.2);
    animation: slideUpModal 0.3s ease;
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--light-gray);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-gray);
}

.modal-close-btn {
    width: 30px;
    height: 30px;
    background: var(--light-gray);
    border: none;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: var(--mid-gray);
    color: var(--white);
}

.modal-body {
    padding: 16px 20px;
}

.modal-leave-info {
    background: var(--card-gray);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13px;
    color: var(--dark-gray);
    line-height: 1.7;
    border-left: 3px solid var(--primary-red);
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 14px 20px 20px;
    border-top: 1px solid var(--light-gray);
}

.btn-modal-approve {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 3px 10px rgba(39,174,96,0.35);
}

.btn-modal-approve:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(39,174,96,0.45);
}

.btn-modal-reject {
    flex: 1;
    padding: 12px;
    background: var(--gradient-red);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-red);
}

.btn-modal-reject:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(192,57,43,0.45);
}

.btn-modal-approve:disabled,
.btn-modal-reject:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* =============================================
   ADMIN DASHBOARD - PANEL PENTADBIR & STATISTIK
   ============================================= */

/* ── Section wrapper ── */
.admin-panel-section,
.admin-stats-section {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.admin-panel-section {
    border-top: 4px solid var(--primary-red);
}

.admin-stats-section {
    border-top: 4px solid #27ae60;
}

/* ── Section header ── */
.admin-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.admin-section-icon {
    font-size: 16px;
    line-height: 1;
}

.admin-section-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--dark-gray);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ── Panel Pentadbir 2×2 grid ── */
.admin-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.admin-panel-card {
    background: rgba(192, 57, 43, 0.05);
    border: 1.5px solid rgba(192, 57, 43, 0.15);
    border-radius: var(--radius-sm);
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    min-height: 90px;
}

.admin-panel-card:hover {
    background: rgba(192, 57, 43, 0.12);
    border-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.2);
}

.admin-panel-card:active {
    transform: translateY(0);
}

.admin-panel-card-icon {
    font-size: 26px;
    line-height: 1;
}

.admin-panel-card-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--dark-gray);
    line-height: 1.3;
}

/* ── Statistik Hari Ini 3-column grid ── */
.admin-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.admin-stat-card {
    background: var(--card-gray);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    border: 1.5px solid var(--light-gray);
}

.admin-stat-card--green { border-color: rgba(39, 174, 96, 0.3); background: rgba(39, 174, 96, 0.06); }
.admin-stat-card--red   { border-color: rgba(192, 57, 43, 0.3); background: rgba(192, 57, 43, 0.06); }
.admin-stat-card--gray  { border-color: var(--mid-gray);        background: var(--card-gray); }

.admin-stat-number {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.admin-stat-card--green .admin-stat-number { color: #27ae60; }
.admin-stat-card--red   .admin-stat-number { color: var(--primary-red); }
.admin-stat-card--gray  .admin-stat-number { color: var(--dark-gray); }

.admin-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-gray);
    line-height: 1.3;
}

/* Desktop: wider cards */
@media (min-width: 992px) {
    .admin-panel-section,
    .admin-stats-section {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    .admin-panel-card {
        min-height: 100px;
        padding: 20px 16px;
    }

    .admin-panel-card-icon {
        font-size: 30px;
    }

    .admin-panel-card-label {
        font-size: 13px;
    }

    .admin-stat-number {
        font-size: 32px;
    }

    .admin-stat-label {
        font-size: 12px;
    }
}

/* Users summary badge */
.users-summary-badge {
    background: rgba(192,57,43,0.07);
    border: 1px solid rgba(192,57,43,0.2);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-red);
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}

