@import url("clean-ui.css?v=20261024-13");

/* Universal Reset & Box Sizing */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

*:before, *:after {
    box-sizing: inherit;
}

:root {
    --primary-gradient: linear-gradient(135deg, #cc0000 0%, #d32f2f 45%, #fbc02d 100%);
    --bg-gray: #f4f6f9;
    --card-border: #e2e8f0;
}

html, body {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    background-color: var(--bg-gray);
    font-family: Arial, Helvetica, sans-serif;
    color: #333;
    overflow-x: hidden !important;
}

/* Top Utility Bar */
.top-utility-bar {
    background-color: #1a1a1a !important;
    color: #ccc;
    font-size: 12px;
    padding: 6px 24px !important;
    display: flex !important;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin: 0 !important;
    border: none !important;
    line-height: 1;
}

.top-utility-bar a {
    color: #ccc;
    text-decoration: none;
}

.top-utility-bar a:hover {
    color: #fff;
}

/* Header Navbar */
.intranet-navbar {
    background: var(--primary-gradient) !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
    padding: 8px 24px !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
    margin: 0 !important;
    border: none !important;
    position: relative;
}

/* Header Brand Layout */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    height: 48px !important;
    width: 48px !important;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.brand-text-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-title {
    font-weight: bold;
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

.brand-subtitle {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #fff;
    opacity: 0.95;
    margin-top: 3px !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
}

/* Header Navigation Menu */
.nav-menu {
    display: flex !important;
    align-items: center;
    list-style: none !important;
    gap: 5px;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-item {
    position: relative;
}

.nav-item > a {
    color: #ffffff;
    text-decoration: none;
    padding: 10px 14px;
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    transition: background 0.2s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    border: none !important;
    outline: none !important;
}

.nav-item:hover > a {
    background-color: rgba(0, 0, 0, 0.15);
}

/* Dropdown Menu - Aligned to Right to Prevent Horizontal Overflow & Jumps */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0 !important;
    left: auto !important;
    background: #ffffff;
    width: 260px;
    max-width: 90vw;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 0 0 6px 6px;
    list-style: none;
    padding: 8px 0 !important;
    margin: 0 !important;
    z-index: 1000;
    border-top: 3px solid #cc0000;
}

.dropdown-menu a {
    color: #333;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    font-weight: normal;
    transition: background-color 0.15s ease;
}

.dropdown-menu a:hover {
    background-color: #fff3f3;
    color: #cc0000;
}

.nav-item:hover .dropdown-menu {
    display: block !important;
}

/* Breadcrumb Sub-bar */
.breadcrumb-bar {
    background: #fff;
    padding: 10px 24px !important;
    border-bottom: 1px solid var(--card-border);
    font-size: 13px;
    color: #666;
    margin: 0 !important;
}

.breadcrumb-bar a {
    color: #cc0000;
    text-decoration: none;
}

/* Main Board Wrapper */
.board-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
}

/* Scrollable Container for the Table */
.table-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    height: 100%;
}

/* Dynamic Responsive Table Layout */
table {
    width: 100%;
    height: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 8px;
}

tbody {
    height: 100%;
}

tbody tr:not(.cluster-row) {
    height: 1%;
}

thead tr {
    height: auto;
}

th, td {
    border: 1px solid #ccc;
    text-align: center;
    padding: 0 !important;
    vertical-align: middle;
    overflow: hidden;
    white-space: nowrap;
}

/* Column Dimension Adjustments */
.main-label { 
    min-width: 105px; 
    font-weight: bold; 
    font-size: 8px; 
}

.muni-name { 
    min-width: 105px;
    text-align: left; 
    padding-left: 4px !important; 
    font-weight: bold; 
    background: #fafafa; 
    font-size: 8px; 
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Category Headers */
.header-cat { font-weight: bold; font-size: 9.5px; padding: 2px 0; letter-spacing: 0.5px; }
.header-cat.monthly { background-color: #ffeb3b; color: #000; }
.header-cat.quarterly { background-color: #e91e63; color: #fff; }
.header-cat.annual { background-color: #4caf50; color: #fff; }

/* Table Column Headers */
.prog-title {
    height: 125px !important;
    vertical-align: middle !important;
    text-align: center !important;
    padding: 2px 0 !important;
    cursor: pointer !important;
}

.prog-title div {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 8px;
    font-weight: normal !important;
    color: #222;
    line-height: 1;
    display: inline-block !important;
    text-align: center !important;
    max-height: 115px !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    margin: 0 auto !important;
    pointer-events: none !important;
}

.cluster-row { background: #dcdcdc; text-align: left; font-size: 8.5px; font-weight: bold; height: 18px !important; }
.cluster-row td { padding: 2px 4px !important; }

/* Status Indicators */
.dot {
    display: inline-block;
    width: 11px !important;
    height: 11px !important;
    min-width: 11px !important;
    min-height: 11px !important;
    border-radius: 50%;
    border: 1px solid #ccc;
    background-color: #e0e0e0;
    vertical-align: middle;
}

.dot.none { background-color: #e0e0e0; }
.dot.blue { background-color: #2196F3; border-color: #1976D2; }
.dot.yellow { background-color: #FFEB3B; border-color: #FBC02D; }
.dot.red { background-color: #F44336; border-color: #D32F2F; }

.dot-clickable { cursor: pointer; transition: transform 0.1s ease; }
.dot-clickable:hover { transform: scale(1.2); z-index: 10; position: relative; }
.dot-locked {
    cursor: not-allowed;
    opacity: 0.85;
}

/* Fixed Bottom Footer */
footer {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px;
    background: #003366;
    color: #ffffff;
    font-size: 10px;
    height: 28px;
    margin: 0 !important;
}

.footer-left { font-weight: bold; opacity: 0.8; }
.footer-right { font-size: 10px; opacity: 0.9; }

/* Floating Tooltip Card */
.hover-card {
    position: fixed;
    z-index: 9999;
    width: 220px;
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    border: 1px solid #e0e0e0;
    text-align: center;
    font-family: Arial, sans-serif;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
}

.hover-card.hidden { display: none; opacity: 0; }
.hover-card h3 { margin: 0 0 4px 0; font-size: 13px; color: #111; }
.card-deadline { font-size: 10px; color: #555; margin-bottom: 8px; }

.card-counts {
    display: flex;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 6px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.card-counts div { display: flex; flex-direction: column; font-size: 8px; color: #444; }
.card-counts strong { font-size: 11px; color: #111; margin-top: 1px; }

.hover-card h4 { font-size: 10px; margin: 6px 0 2px 0; color: #333; }
.card-perf { display: flex; justify-content: space-around; align-items: center; margin-bottom: 6px; }
.dot-label { font-size: 10px; display: flex; align-items: center; gap: 2px; }

.attention-list {
    font-size: 9px;
    color: #d32f2f;
    font-weight: bold;
    max-height: 35px;
    overflow-y: auto;
    word-break: break-word;
}

/* Modal Popup Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 1100px;
    height: 85vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #003366;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.modal-header h2 {
    font-size: 16px;
    color: #003366;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-view-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.modal-view-table th, .modal-view-table td {
    border: 1px solid #ccc;
    text-align: center;
    padding: 4px 2px;
}

.modal-view-table th {
    background: #f0f4f8;
    color: #003366;
    font-weight: bold;
}

/* Layout wrapper for Admin Page */
.admin-board-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
}

/* Control Bar (Dropdown & Reset Button) */
.admin-control-bar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* Table wrapper to expand vertically */
.admin-board-container .table-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    height: 100%;
}

/* Admin Override Table */
.admin-board-container table {
    width: 100%;
    height: 100%;
    table-layout: auto;
    border-collapse: collapse;
    font-size: 11px;
}

.admin-board-container tbody {
    height: 100%;
}

.admin-board-container tbody tr:not(.cluster-row) {
    height: 1%;
}

.admin-board-container td {
    vertical-align: middle;
    text-align: center;
    padding: 2px !important;
}

/* Prevent SweetAlert from shifting the page layout */
body.swal2-shown {
    overflow-y: scroll !important;
    padding-right: 0 !important;
}

/* Dashboard Grid Layout */
.portal-container {
    padding: 16px 24px;
    max-width: 100%;
}

.portal-grid {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 16px;
    align-items: start;
}

/* Card Wrapper Styling */
.dashboard-card {
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    overflow: hidden;
}

.dashboard-card .card-header {
    background: #ffffff;
    border-bottom: 3px solid #fbc02d;
    padding: 10px 14px;
}

.dashboard-card .card-header h2 {
    font-size: 13px;
    font-weight: bold;
    color: #222;
    margin: 0;
}

.dashboard-card .card-body {
    padding: 12px 14px;
}

/* Lists */
.portal-list {
    list-style: none;
    padding: 0;
}

.portal-list li {
    padding: 4px 0;
    font-size: 12px;
}

.portal-list a {
    color: #444;
    text-decoration: none;
}

.portal-list a:hover {
    color: #cc0000;
}

/* Attendance Elements */
.legend-box {
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    padding: 10px;
    font-size: 11px;
    background-color: #fafafa;
    margin-bottom: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.legend-color {
    width: 12px;
    height: 12px;
    display: inline-block;
}

.legend-color.blue { background-color: #64b5f6; }
.legend-color.yellow { background-color: #ffd54f; }
.legend-color.red { background-color: #e57373; }
.legend-color.green { background-color: #81c784; }
.legend-color.orange { background-color: #ffb74d; }
.legend-color.gray { background-color: #e0e0e0; }

.action-btn-wrapper {
    text-align: center;
    margin: 14px 0;
}

.btn-time-in {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 8px 24px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.portal-table th, .portal-table td {
    border: 1px solid #e0e0e0;
    padding: 6px 8px;
    text-align: left;
}

.no-records {
    text-align: center;
    color: #888;
}

/* Search Input */
.search-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
}

.btn-calendar-dashboard {
    display: inline-block;
    background: #1976d2;
    color: #fff;
    padding: 6px 12px;
    font-size: 11px;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Responsive collapse for small screens */
@media (max-width: 992px) {
    .portal-grid {
        grid-template-columns: 1fr;
    }
}