/* =============================
   GLOBAL LAYOUT
============================= */
:root {
    --primary-color: #007bff;
    --secondary-color: #0056b3;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --sidebar-width: 250px;
    --topbar-height: 70px;
}

html, body {
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body {
    background-color: #f4f6f7;
    display: flex;
    flex-direction: column;
}

.layout-shell {
    display: flex;
    flex: 1 0 auto;
    width: 100%;
    position: relative;
}

.main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

/* =============================
   NAVBAR
============================= */

.top-navbar .container-fluid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.top-navbar .container-fluid > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.top-nav-items {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    min-width: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-brand img {
    flex-shrink: 0;
}

.top-nav-items .punch-link,
.top-nav-items .logout-link,
.top-nav-items .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    color: var(--dark-color);
    text-decoration: none;
    transition: background-color 0.12s ease, color 0.12s ease;
    font-weight: 500;
}

.top-nav-items .punch-link i,
.top-nav-items .logout-link i {
    font-size: 1.05rem;
}

.top-nav-items .logout-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #c0392b !important;
}

.top-nav-items .punch-link:hover,
.top-nav-items .nav-link:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--primary-color) !important;
}

.breadcrumb {
    background: transparent;
    margin-bottom: 0;
    font-size: 0.75rem;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.breadcrumb-item a:hover {
    color: #0d6efd;
    text-decoration: underline;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #0d6efd;
    font-weight: 500;
}

/* =============================
   SIDEBAR
============================= */

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
    margin-right: 1rem;
    transition: color 0.3s ease;
}

.sidebar-toggle:hover {
    color: var(--primary-color);
}

/* =============================
   UTILITY COMPONENTS
============================= */

.page-header {
    padding-bottom: 0;
}

.page-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2980b9;
    margin: 0 0 0.25rem;
    line-height: 1.1;
}

.btn-new,
.btn-punch {
    background-color: var(--warning-color);
    border: none;
    color: #212529;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.btn-new:hover,
.btn-punch:hover {
    background-color: #e0a800;
    color: #212529;
}

.card {
    background: #ffffff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.card:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.card-title {
    color: #2980b9;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.card-header p {
    color: #7f8c8d;
    margin-top: 5px;
    font-size: 0.95rem;
}

/* =============================
   DASHBOARD PAGE
============================= */

.bg-primary-light { background-color: rgba(13, 110, 253, 0.08); }
.bg-primary-soft { background-color: rgba(13, 110, 253, 0.12); }
.bg-info-soft { background-color: rgba(13, 202, 240, 0.12); }
.bg-warning-soft { background-color: rgba(255, 193, 7, 0.12); }
.bg-soft-success { background-color: rgba(40, 167, 69, 0.15); }

.hover-bg-light:hover {
    background-color: #f8fafc;
    transition: background-color 0.2s ease;
}

.transition-all {
    transition: all 0.2s ease-in-out;
}

.pulse-animation {
    animation: pulse-red 2s infinite;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4);
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.dashboard-header {
    margin: 1rem 0 1.5rem 0;
}

.dashboard-datetime {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
}

#currentDateTime {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#currentDateTime .date,
#currentDateTime .time {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    color: var(--dark-color);
    font-weight: bold;
}

#currentDateTime i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.events-calendar {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.events {
    flex: 1;
    min-width: 280px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 0 15px rgb(0 0 0 / 0.1);
}

.events h5 {
    margin-bottom: 1rem;
    font-weight: 700;
    color: #0d6efd;
}

.event-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.event-item:hover {
    background-color: #f8f9fa;
    border-radius: 6px;
}

.event-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.event-date-time {
    font-weight: 600;
    color: #212529;
    font-size: 0.9rem;
}

.event-title {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #495057;
}

.task-category {
    margin-bottom: 1.5rem;
}

.task-category:last-child {
    margin-bottom: 0;
}

.task-due-date {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.hover-bg:hover {
    background-color: #f8f9fa;
    border-radius: 6px;
}

.card-fixed-height {
    height: 100%;
}

.card-body-scrollable {
    max-height: 400px;
    overflow-y: auto;
}

.card-body-scrollable-lg {
    max-height: 500px;
    overflow-y: auto;
}

.request-list,
.attendance-details,
.list-group {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 5px;
}

.activity-timeline,
.announcement-list {
    max-height: 520px;
    overflow-y: auto;
    padding-right: 5px;
}

.announcement-list::-webkit-scrollbar,
.request-list::-webkit-scrollbar,
.activity-timeline::-webkit-scrollbar,
.attendance-details::-webkit-scrollbar,
.list-group::-webkit-scrollbar {
    width: 6px;
}

.announcement-list::-webkit-scrollbar-track,
.request-list::-webkit-scrollbar-track,
.activity-timeline::-webkit-scrollbar-track,
.attendance-details::-webkit-scrollbar-track,
.list-group::-webkit-scrollbar-track {
    background: transparent;
}

.announcement-list::-webkit-scrollbar-thumb,
.request-list::-webkit-scrollbar-thumb,
.activity-timeline::-webkit-scrollbar-thumb,
.attendance-details::-webkit-scrollbar-thumb,
.list-group::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 3px;
}

.announcement-list::-webkit-scrollbar-thumb:hover,
.request-list::-webkit-scrollbar-thumb:hover,
.activity-timeline::-webkit-scrollbar-thumb:hover,
.attendance-details::-webkit-scrollbar-thumb:hover,
.list-group::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.request-stat-card {
    padding: 1rem 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.request-stat-card:hover {
    background-color: #f8f9fa;
}

.request-item,
.announcement-item {
    transition: background-color 0.2s ease;
}

.avatar-sm {
    width: 40px;
    height: 40px;
}

/* =============================
   LEAVE PAGE
============================= */

.tab-content {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.filter-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    height: 120px;
}

.filter-card.active {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.15);
}

.filter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-card .card-body {
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.filter-card .card-title {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
    border-bottom: none;
    padding-bottom: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.filter-card .stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
}

.filter-card i {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
    margin-top: 0.25rem;
}

.filter-card[data-status="all"] i { color: var(--primary-color); }
.filter-card[data-status="approved"] i { color: var(--success-color); }
.filter-card[data-status="pending"] i { color: var(--warning-color); }
.filter-card[data-status="rejected"] i { color: var(--danger-color); }

#leaveCalendar {
    border-radius: 0.375rem;
    overflow: hidden;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
    margin-top: 0.5rem;
}

.stat-number.all { color: #3498db; }
.stat-number.approved { color: #28a745; }
.stat-number.pending { color: #ffc107; }
.stat-number.rejected { color: #dc3545; }

/* =============================
   ATTENDANCE PAGE
============================= */

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tr:hover {
    background-color: #f8f9fa;
}

.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.25rem;
}

.badge.bg-success { background-color: var(--success-color) !important; }
.badge.bg-danger { background-color: var(--danger-color) !important; }
.badge.bg-warning {
    background-color: var(--warning-color) !important;
    color: #212529 !important;
}
.badge.bg-purple { background-color: #a78bfa !important; }
.badge.bg-light-red { background-color: #fca5a5 !important; }
.badge.bg-light-blue { background-color: #93c5fd !important; }
.badge.bg-light-green { background-color: #80d0b0 !important; }

.datetime-punch {
    text-align: center;
    margin: 1rem 0;
}

.datetime-punch .datetime-time {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

.datetime-punch .datetime-date {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

#punchContainer {
    margin-top: 1.5rem;
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 1.25rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.25rem;
}

.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    border: 1px solid #dee2e6;
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* =============================
   TASK PAGE
============================= */

.filter-card[data-status="to-do"] i { color: var(--danger-color); }
.filter-card[data-status="in-progress"] i { color: var(--info-color); }
.filter-card[data-status="in-review"] i { color: var(--primary-color); }
.filter-card[data-status="to-review"] i { color: var(--warning-color); }
.filter-card[data-status="completed"] i { color: var(--success-color); }

.stat-number.to-do { color: var(--danger-color); }
.stat-number.in-progress { color: var(--info-color); }
.stat-number.in-review { color: var(--primary-color); }
.stat-number.to-review { color: var(--warning-color); }
.stat-number.completed { color: var(--success-color); }

.task-item {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    border-radius: 12px;
    padding-left: 0;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.task-item[data-status="to-do"] { border-left-color: var(--danger-color); }
.task-item[data-status="in-progress"] { border-left-color: var(--info-color); }
.task-item[data-status="in-review"] { border-left-color: var(--primary-color); }
.task-item[data-status="to-review"] { border-left-color: var(--warning-color); }
.task-item[data-status="completed"] { border-left-color: var(--success-color); }

.badge.bg-info {
    background-color: #17a2b8 !important;
    color: white !important;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
}

.task-item h5 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
}

.task-item .text-muted {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* =============================
   TASK/PROJECT PAGE
============================= */

.filter-card[data-status="not-started"] i { color: var(--danger-color); }
.filter-card[data-status="on-hold"] i { color: var(--warning-color); }

.stat-number.not-started { color: var(--danger-color); }
.stat-number.on-hold { color: var(--warning-color); }

/* =============================
   PROJECT PAGE
============================= */

.project-item {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    border-radius: 12px;
    padding-left: 0;
}

.project-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.project-item[data-status="not-started"] { border-left-color: var(--danger-color); }
.project-item[data-status="in-progress"] { border-left-color: var(--info-color); }
.project-item[data-status="on-hold"] { border-left-color: var(--warning-color); }
.project-item[data-status="completed"] { border-left-color: var(--success-color); }

.project-item .card-body {
    padding: 1.25rem;
}

.project-item h5 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
}

.project-item .text-muted {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* =============================
   EVENT PAGE - CALENDAR TAB
============================= */

#eventCalendar {
    border-radius: 0.375rem;
    overflow: hidden;
}

/* =============================
   EVENT PAGE - EVENTS TAB
============================= */

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.event-card {
    background: var(--light-color, #ffffff);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.event-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.event-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-radius: 16px;
}

.event-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.event-card:hover .event-image-wrapper img {
    transform: scale(1.1);
}

.event-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dark-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pill {
    position: absolute;
    bottom: 15px;
    right: 15px;
    padding: 4px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.event-status-upcoming {
    background: #e3f2fd;
    color: var(--primary-color);
}

.event-status-completed {
    background: #e8f5e9;
    color: var(--success-color);
}

.event-status-cancelled {
    background: #ffebee;
    color: var(--danger-color);
}

.event-status-ongoing {
    background: #ffebee;
    color: var(--warning-color);
}

.event-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.event-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
    cursor: pointer;
    line-height: 1.3;
    transition: color 0.2s;
}

.event-title:hover {
    color: var(--primary-color);
}

.event-meta-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 1.25rem;
    padding: 12px;
    background: #fcfcfc;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
}

.date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 60px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.date-block .month {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 1px;
    line-height: 1;
}

.date-block .day {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.2;
}

.meta-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #444;
}

.location-text {
    font-weight: 500;
    color: var(--dark-color);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.event-description {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.event-tags {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.event-card-footer {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    border-radius: 0 0 16px 16px;
}

.attendance-prompt {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-confirmed {
    color: #27ae60;
    font-weight: 700;
    font-size: 0.9rem;
}

.status-declined {
    color: #e74c3c;
    font-weight: 700;
    font-size: 0.9rem;
}

.text-center.py-5 {
    background: #f8f9fa;
    border-radius: 12px;
    margin: 2rem 0;
}

.text-center.py-5 i {
    opacity: 0.5;
}

.text-center.py-5 h5 {
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.text-center.py-5 p {
    color: #6c757d;
    font-size: 0.95rem;
}

/* =============================
   EVENT PAGE - SHOW PAGE
============================= */

.event-header {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.event-image {
    height: 300px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.event-details-card {
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: none;
    margin-bottom: 1.5rem;
}

.event-details-card .card-header {
    background-color: white;
    border-bottom: 1px solid #eaeaea;
    font-weight: 600;
    padding: 1rem 1.5rem;
}

.event-detail-item {
    display: flex;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.event-detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.event-detail-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(113, 176, 248, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.event-detail-content {
    flex: 1;
    min-width: 0;
}

.event-detail-label {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.9rem;
}

.event-detail-value {
    font-weight: 500;
    color: #212529;
    word-break: break-word;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 500;
}

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

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

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

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

.tag {
    display: inline-block;
    background-color: rgba(113, 176, 248, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 1.5rem;
}

.btn-rsvp {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
}

.btn-rsvp:hover {
    background-color: #5a9ae6;
    color: white;
}

.event-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
}

.event-actions .btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 6px 8px;
    border-radius: 50%;
}

.event-actions .btn:hover {
    background: white;
}

.capacity-meter {
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.capacity-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 4px;
}

/* =============================
   PROFILE PAGE
============================= */

.employee-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.employee-position {
    font-size: 1.1rem;
    font-weight: 500;
}

.detail-label {
    font-size: 0.9rem;
}

.detail-value {
    font-size: 0.95rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.nav-tabs .nav-link {
    border: none;
    color: #6c757d;
    font-weight: 500;
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link.active {
    background: var(--primary-color);
    color: white;
    border: none;
}

.nav-tabs .nav-link:hover {
    border: none;
    color: var(--primary-color);
}

.h-100 {
    height: 100% !important;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--primary-color);
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #6c757d;
    margin: 0 auto;
    overflow: hidden;
}

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

.contact-display {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
    min-height: 2.5rem;
}

.contact-display:last-child {
    border-bottom: none;
}

.detail-item {
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    height: 100%;
    margin-bottom: 0.5rem;
}

.detail-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.card-body {
    display: flex;
    flex-direction: column;
}

.empty-field {
    color: #6c757d !important;
    font-style: italic;
}

.tab-pane {
    animation: fadeIn 0.3s ease-in;
}

.profile-photo-wrapper {
    width: 120px;
    height: 120px;
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.25s ease;
    font-size: 1.4rem;
}

.profile-photo-wrapper:hover .photo-overlay {
    opacity: 1;
}

/* =============================
   ANNOUNCEMENT PAGE
============================= */

.announcement-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
}

.announcement-actions .btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 6px 8px;
    border-radius: 50%;
}

.announcement-actions .btn:hover {
    background: white;
}

/* =============================
   ADMIN DASHBOARD / EXTRA
============================= */

.content-wrapper {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.stat-card {
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-card:nth-child(1) { border-left-color: #007bff; }
.stat-card:nth-child(2) { border-left-color: #28a745; }
.stat-card:nth-child(3) { border-left-color: #ffc107; }
.stat-card:nth-child(4) { border-left-color: #17a2b8; }

.activity-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.system-status .status-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.system-status .status-item:last-child {
    border-bottom: none;
}

.attendance-stat-card {
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.attendance-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.present-card:hover { border-left: 4px solid #28a745; }
.absent-card:hover { border-left: 4px solid #dc3545; }
.late-card:hover { border-left: 4px solid #ffc107; }

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.d-grid.gap-2 {
    gap: 0.5rem !important;
}

.card-header .card-title {
    margin-bottom: 0;
}

/* =============================
   RESPONSIVE ADJUSTMENTS
============================= */

@media (max-width: 1199.98px) {
    .leave-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

@media (max-width: 991.98px) {
    .content.container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .page-header .row > .col-sm-12 > .page-sub-header > .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .page-header .row > .col-sm-12 > .page-sub-header > .d-flex > div:last-child {
        width: 100%;
    }

    .page-header .row > .col-sm-12 > .page-sub-header .btn-group,
    .page-header .row > .col-sm-12 > .page-sub-header .btn-new,
    .page-header .row > .col-sm-12 > .page-sub-header .btn {
        width: 100%;
    }

    .page-header .row > .col-sm-12 > .page-sub-header .btn-group {
        display: flex;
    }

    .page-header .row > .col-sm-12 > .page-sub-header .btn-group .btn {
        flex: 1;
    }

    .card .card-header .d-flex {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start !important;
    }

    .card .card-header .d-flex .text-end {
        text-align: left !important;
        width: 100%;
    }

    .card .card-header .d-flex .btn {
        width: 100%;
    }

    .card .card-header h5 + a,
    .card .card-header .card-title + a {
        width: 100%;
    }

    .table-responsive table {
        min-width: 0 !important;
    }

    .breadcrumb {
        font-size: 0.7rem;
    }

    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        gap: 0;
    }
    .nav-tabs .nav-item {
        flex-shrink: 0;
    }
    .nav-tabs .nav-link {
        white-space: nowrap;
    }

    .summary-grid,
    .row.text-center.mb-4 .col-4 {
        flex: 0 0 auto;
    }

    .row.mb-4.g-4 > [class*="col-"] {
        margin-bottom: 0.5rem;
    }

    .leave-filter-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767.98px) {
    .main-content {
        padding: 0.75rem 0.5rem;
        width: 100%;
        margin-left: 0 !important;
    }

    .top-nav-items {
        justify-content: flex-end;
    }

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

    .page-sub-header p.text-muted {
        font-size: 0.8rem;
    }

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

    .event-meta-container {
        flex-direction: column;
    }

    .action-buttons {
        flex-direction: column;
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    .filter-grid,
    .employee-filter-grid,
    .leave-filter-grid,
    .request-filter-grid {
        grid-template-columns: 1fr !important;
    }

    .content .row > [class*="col-"]:not([class*="col-6"]):not([class*="col-4"]):not([class*="col-3"]) {
        margin-bottom: 0.75rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-lg {
        max-width: calc(100vw - 1rem);
    }

    .table thead {
        display: none;
    }

    .table-responsive.card-table,
    .table-responsive-custom {
        border: 0;
    }

    .attendance-stat-card {
        padding: 0.75rem 0.5rem;
    }
    .attendance-stat-card h4 {
        font-size: 1.1rem;
    }

    .datetime-punch .datetime-time {
        font-size: 1.25rem;
    }

    .filter-card {
        height: auto;
        min-height: 80px;
    }
    .filter-card .card-body {
        padding: 0.75rem;
    }
    .filter-card .fs-4 {
        font-size: 1.1rem !important;
    }

    .d-flex.gap-2.flex-wrap {
        width: 100%;
    }
    .d-flex.gap-2.flex-wrap .btn {
        flex: 1;
    }

    .btn-group.w-100 {
        display: flex;
    }
    .btn-group.w-100 .btn {
        flex: 1;
        font-size: 0.85rem;
    }

    .app-footer {
        margin-left: 0 !important;
        width: 100% !important;
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    .avatar-sm {
        width: 32px;
        height: 32px;
    }

    h3.page-title {
        font-size: 1.25rem;
    }
    h3.page-title br {
        display: none;
    }

    .task-actions .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }

    .request-item .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    .request-item .text-end {
        text-align: left !important;
        width: 100%;
    }

    .btn-group.action-btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .btn-group.action-btn-group .btn {
        flex: 1;
        min-width: 32px;
        padding: 0.25rem 0.4rem;
    }

    .top-navbar .navbar-brand span {
        display: none !important;
    }
    .top-navbar .navbar-brand img {
        height: 32px;
    }
    .top-navbar .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    #sidebarToggle .bi-list {
        font-size: 1.5rem;
    }

    .top-nav-items .punch-link,
    .top-nav-items .logout-link {
        padding: 0.35rem 0.5rem;
    }

    .page-header .page-sub-header .d-flex.justify-content-between.align-items-center.w-100 {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .page-header .page-sub-header .d-flex.justify-content-between.align-items-center.w-100 > div:last-child {
        width: 100%;
    }
    .page-header .page-sub-header .datetime-punch.text-end {
        text-align: left !important;
        width: 100%;
        margin-top: 0.5rem;
    }

    .card-fixed-height {
        height: auto;
    }

    .activity-timeline,
    .announcement-list,
    .request-list {
        max-height: none;
        overflow-y: visible;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 1.8rem;
    }

    .event-image-wrapper {
        height: 160px;
    }

    .event-card-body {
        padding: 1rem;
    }

    .employee-page .page-header .page-sub-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }
}

@media (max-width: 575.98px) {
    .top-navbar {
        height: 60px;
    }

    .navbar-brand {
        font-size: 0.85rem;
        max-width: 120px;
    }

    .top-nav-items .punch-link span,
    .top-nav-items .logout-link span,
    .top-nav-items .nav-link span {
        display: none;
    }

    .top-nav-items i {
        font-size: 1.1rem;
        margin: 0 2px;
    }

    .top-nav-items .punch-link,
    .top-nav-items .logout-link {
        padding: 0.3rem 0.4rem;
    }

    .btn-new,
    .btn-punch {
        width: 100%;
        margin-bottom: 0.25rem;
    }

    .modal-dialog {
        margin: 0.25rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .modal-header {
        padding: 0.75rem 1rem;
    }
    .modal-header .modal-title {
        font-size: 1rem;
    }
    .modal-footer {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    .modal-footer .btn {
        width: 100%;
    }

    .table td,
    .table th {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    h3.page-title {
        font-size: 1.1rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .top-nav-items .dropdown-menu {
        min-width: 220px !important;
        width: 88vw !important;
        max-width: 320px;
        right: -5px !important;
        left: auto !important;
    }

    .top-nav-items .dropdown-menu .dropdown-item {
        white-space: normal;
        word-break: break-word;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination .page-link {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }

    .d-grid.gap-2.d-flex {
        flex-direction: column;
    }

    .security-badges {
        flex-wrap: wrap;
    }
    .security-badges .badge {
        font-size: 0.65rem;
    }

    .attendance-stat-card h4 {
        font-size: 1rem;
    }

    .quick-action-card {
        padding: 0.75rem !important;
    }
    .quick-action-card .icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 1.3rem !important;
    }
    .quick-action-card strong {
        font-size: 0.9rem !important;
    }
    .quick-action-card small {
        font-size: 0.75rem !important;
    }

    .announcement-item h6 {
        font-size: 0.9rem;
    }

    .event-card {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 0;
    }

    .request-stat-card h4 {
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    .top-nav-items .punch-link,
    .top-nav-items .logout-link {
        padding: 0.25rem;
    }
    .top-nav-items i {
        font-size: 1rem;
    }
    .top-navbar .navbar-brand img {
        height: 28px;
    }
    #sidebarToggle {
        padding: 0.25rem;
    }
    #sidebarToggle .bi-list {
        font-size: 1.3rem;
    }
}

/* =========================================
   MOBILE RESPONSIVE FIXES (ADDED SECTION)
========================================= */
@media (max-width: 575.98px) {
    /* 1. Notification Dropdown Fix */
    .notification-dropdown {
        min-width: 280px !important;
        width: 90vw !important; /* Ambil 90% saiz skrin mobile */
        right: -10px !important; /* Tarik sikit ke kiri supaya tak potong skrin */
        left: auto !important;
        max-height: 80vh; 
        overflow-y: auto;
        box-shadow: 0 5px 15px rgba(0,0,0,0.2) !important;
    }

    /* Pastikan teks notifikasi wrap dengan betul */
    .notification-dropdown .media-body p {
        white-space: normal !important;
        word-break: break-word;
    }

    /* 2. Top Navigation Items (Supaya tak berhimpit) */
    .top-nav-items {
        gap: 0.25rem !important;
    }
    
    .top-nav-items .punch-link span, 
    .top-nav-items .nav-link span {
        display: none; /* Sembunyikan teks pada topbar mobile, tinggalkan icon */
    }

    .top-nav-items .punch-link {
        padding: 0.4rem 0.6rem !important;
    }

    /* 3. Dashboard Profile Card Mobile Layout */
    .dashboard-profile-details {
        text-align: center;
    }
    .profile-avatar-dash {
        margin: 0 auto;
    }
}

/* =========================================
   MOBILE RESPONSIVENESS PATCH
   ========================================= */

/* 1. FIX USER DROPDOWN (Avatar) POSITIONING & WIDTH */
@media (max-width: 575.98px) {
    .topbar-user-btn img {
        width: 32px;
        height: 32px;
    }

    .topbar-user-btn {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 2. STANDARDIZE NOTIFICATION DROPDOWN WIDTH TO MATCH USER DROPDOWN */
@media (max-width: 575.98px) {
    .notification-dropdown {
        width: 88vw !important;
        max-width: 320px;
        right: -10px !important;
        left: auto !important;
    }
}

/* 3. PREVENT ANY DROPDOWN FROM OVERFLOWING VIEWPORT (SAFETY NET) */
.dropdown-menu {
    max-width: calc(100vw - 20px);
    overflow-x: hidden;
}

/* 4. TOUCH TARGET MINIMUM SIZE (Accessibility - Icon Buttons) */
@media (max-width: 575.98px) {
    #notificationBell,
    #sidebarToggle {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 5. DASHBOARD PROFILE ACTION BUTTONS - STACK ON SMALL SCREENS */
@media (max-width: 400px) {
    .dashboard-profile-details .d-flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem !important;
        width: 100%;
    }

    .dashboard-profile-details .d-flex.gap-2 .btn {
        width: 100%;
    }
}

/* 6. REDUCE DROPDOWN ITEM PADDING ON SMALL SCREENS */
@media (max-width: 575.98px) {
    .nav-item.dropdown .dropdown-menu .dropdown-item {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}