body {
  background-color: #f8f9fa;
}

.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#video,
#canvas {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 8px;
}

#video.d-none + #canvas {
  display: block !important;
}

#photoPreview img {
  max-width: 400px;
  max-height: 300px;
  object-fit: contain;
}

.invalid-feedback {
  display: none;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-select:invalid ~ .invalid-feedback,
.was-validated #cameraContainer.is-invalid ~ #photoFeedback {
  display: block;
}

#cameraContainer.is-invalid {
  border-color: #dc3545;
}

body, html {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #f4f8f6 0%, #eef5f2 48%, #e7f0ec 100%);
}
.navbar {
    background-color: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
    padding: 10px 20px;
}
.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.5rem;
}
.navbar-brand img {
    height: 70px;
    width: 140px;
    margin-right: 10px;
}
.navbar-nav .nav-link {
    color: #20a78b;
    font-weight: bold;
    margin-left: 10px;
}
.navbar-nav .nav-link:hover {
    color: #20a78b !important;
}
.container {
   
    padding: 20px;
    text-align: center;
    flex: 1;
}
.form-control {
    margin-bottom: 20px;
    
}
#captureButton {
    background-color: #ff7f00;
   border: none;
    color: white;
    padding: 10px 0;
}
#signInBtn {
    background-color: #20a78b;
    border: none;
    color: white;
    padding: 10px 0;
}
#captureButton:hover, #loginButton:hover {
    opacity: 0.8;
}
.text-center {
    color: #20a78b;
    font-weight: bold;
}
#photoContainer {
    display: none;
    text-align: center;
}
#video {
    width: 100%;
    max-width: 320px;
    height: auto;
    border: 1px solid black;
}
.footer {
    background-color: #20a78b;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: sticky;
    bottom: 0;
    width: 100%;
}
.footer .social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.footer .social-icons a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
}
.footer .social-icons a:hover {
    color: #007bff;
}

.admin-page {
    padding-bottom: 40px;
    max-width: 1440px;
}

.admin-body .navbar {
    border-bottom: 1px solid rgba(13, 95, 81, 0.08);
}

.admin-hero,
.filters-card,
.records-card,
.summary-card,
.status-panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(32, 167, 139, 0.1);
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(7, 63, 52, 0.07);
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    padding: 28px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 249, 246, 0.95));
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.8rem;
    color: #0e7763;
}

.admin-title {
    color: #0d5f51;
    font-size: clamp(2rem, 3.5vw, 3rem);
}

.admin-subtitle,
.welcome-copy {
    color: #3c5f58;
    font-size: 1rem;
}

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

.status-panel,
.filters-card,
.records-card {
    padding: 20px;
}

.compact-card {
    padding: 16px 18px;
}

.summary-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 118px;
}

.summary-label {
    color: #56847b;
    font-size: 0.95rem;
}

.summary-value {
    color: #0d5f51;
    font-size: 2rem;
}

.admin-photo {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 18px;
    border: 2px solid rgba(32, 167, 139, 0.15);
}

.photo-placeholder {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(32, 167, 139, 0.08);
    color: #51756d;
    font-size: 0.75rem;
}

.action-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
}

.action-signin {
    background: rgba(32, 167, 139, 0.12);
    color: #0f7a64;
}

.action-signout {
    background: rgba(220, 53, 69, 0.1);
    color: #bb2d3b;
}

.timestamp-cell {
    color: #5c776f;
    font-size: 0.9rem;
}

.empty-state {
    padding: 24px;
    text-align: center;
    color: #567870;
}

.table thead th {
    color: #3d6d63;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(248, 252, 250, 0.98);
}

.table tbody td {
    background: transparent;
    vertical-align: middle;
}

@media (max-width: 768px) {
    .admin-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-actions {
        width: 100%;
    }

    .admin-actions .btn {
        width: 100%;
    }
}

#signInBtn:hover:not(:disabled),
#signInBtn:focus:not(:disabled) {
  background-color: #218838;
  border-color: #1e7e34;
}

#signOutBtn:hover:not(:disabled),
#signOutBtn:focus:not(:disabled) {
  background-color: #c82333;
  border-color: #bd2130;
}

.dashboard-grid,
.insights-grid,
.employee-detail-grid,
.management-grid,
.mini-summary-grid {
    display: flex;
    gap: 16px;
}

.dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.insights-grid,
.employee-detail-grid,
.management-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.employee-detail-grid {
    align-items: start;
}

.management-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
    align-items: start;
}

.manage-employees-shell,
.audit-log-shell {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.employee-detail-shell,
.leave-management-shell,
.payroll-adjustments-shell {
    display: flex;
    flex-direction: column;
    max-height: 760px;
    overflow: hidden;
}

.insights-grid > .records-card {
    height: 320px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mini-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.accent-card {
    background: linear-gradient(135deg, rgba(32, 167, 139, 0.92), rgba(13, 95, 81, 0.95));
}

.accent-card .summary-label,
.accent-card .summary-value,
.accent-card .summary-note {
    color: #fff;
}

.summary-note {
    color: #6b8e86;
    font-size: 0.88rem;
}

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

.insights-grid .section-header {
    margin-bottom: 12px;
}

.section-title {
    margin: 0;
    color: #0d5f51;
    font-size: 1.25rem;
}

.chip-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-content: flex-start;
    overflow-y: auto;
    padding-right: 4px;
}

.insight-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(32, 167, 139, 0.12);
    color: #0d5f51;
    font-weight: 700;
}

.insight-list,
.audit-log-list {
    display: grid;
    gap: 12px;
}

.insights-grid .insight-list {
    flex: 1;
    overflow-y: auto;
    align-content: flex-start;
    padding-right: 4px;
}

.insight-item,
.audit-log-item,
.mini-summary-card {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(249, 252, 251, 0.98);
    border: 1px solid rgba(32, 167, 139, 0.12);
}

.insight-item strong,
.audit-log-item strong {
    display: block;
    color: #0f6152;
    margin-bottom: 4px;
}

.insight-item span,
.audit-log-item p {
    color: #4f716a;
}

.insights-grid .insight-item,
.insights-grid .empty-state {
    padding: 12px 14px;
}

.chip-group::-webkit-scrollbar,
.insights-grid .insight-list::-webkit-scrollbar {
    width: 8px;
}

.chip-group::-webkit-scrollbar-thumb,
.insights-grid .insight-list::-webkit-scrollbar-thumb {
    background: rgba(13, 95, 81, 0.25);
    border-radius: 999px;
}

.mini-summary-value {
    display: block;
    margin-top: 10px;
    color: #0d5f51;
    font-size: 1.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 2px 6px 2px 0;
}

.status-success {
    background: rgba(25, 135, 84, 0.12);
    color: #157347;
}

.status-warning {
    background: rgba(255, 193, 7, 0.16);
    color: #9a6700;
}

.status-secondary {
    background: rgba(108, 117, 125, 0.14);
    color: #525960;
}

.summary-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: #0d5f51;
    font-weight: 700;
    text-align: left;
}

.summary-link:hover,
.summary-link:focus {
    color: #20a78b;
}

.employee-summary-card .table-responsive,
.manage-employees-card .table-responsive {
    max-height: 320px;
    overflow: auto;
    border-radius: 16px;
}

.employee-detail-shell .table-responsive,
.leave-management-shell .table-responsive,
.payroll-adjustments-shell .table-responsive {
    flex: 1;
    max-height: 280px;
    overflow: auto;
    border-radius: 16px;
    border: 1px solid rgba(32, 167, 139, 0.08);
    background: rgba(251, 253, 252, 0.92);
}

.employee-summary-card .table,
.manage-employees-card .table {
    margin-bottom: 0;
}

.employee-summary-card .table td,
.employee-summary-card .table th,
.manage-employees-card .table td,
.manage-employees-card .table th {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    font-size: 0.94rem;
}

.audit-log-shell .audit-log-list {
    flex: 1;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 6px;
    align-content: start;
}

.audit-log-shell .audit-log-list::-webkit-scrollbar,
.employee-summary-card .table-responsive::-webkit-scrollbar,
.manage-employees-card .table-responsive::-webkit-scrollbar,
.employee-detail-shell .table-responsive::-webkit-scrollbar,
.leave-management-shell .table-responsive::-webkit-scrollbar,
.payroll-adjustments-shell .table-responsive::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.audit-log-shell .audit-log-list::-webkit-scrollbar-thumb,
.employee-summary-card .table-responsive::-webkit-scrollbar-thumb,
.manage-employees-card .table-responsive::-webkit-scrollbar-thumb,
.employee-detail-shell .table-responsive::-webkit-scrollbar-thumb,
.leave-management-shell .table-responsive::-webkit-scrollbar-thumb,
.payroll-adjustments-shell .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(13, 95, 81, 0.24);
    border-radius: 999px;
}

.manage-employees-card form {
    margin-bottom: 6px;
}

.manage-employees-shell {
    max-height: 660px;
}

.manage-employees-shell #employeeForm {
    margin-bottom: 10px;
}

.manage-employees-shell #employeeForm .form-label {
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
}

.manage-employees-shell #employeeForm .form-control {
    margin-bottom: 0;
    min-height: 42px;
}

.manage-employees-shell #employeeForm .btn {
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
}

.manage-employees-shell .table-responsive {
    flex: 1;
    max-height: 340px;
    overflow: auto;
    border-radius: 16px;
    border: 1px solid rgba(32, 167, 139, 0.08);
    background: rgba(251, 253, 252, 0.92);
}

.manage-employees-shell .table {
    margin-bottom: 0;
}

.manage-employees-shell .table td,
.manage-employees-shell .table th {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    font-size: 0.93rem;
}

.audit-log-shell {
    max-height: 660px;
}

.employee-detail-shell .mini-summary-grid {
    margin-bottom: 10px;
}

.profile-notes-card {
    background: rgba(250, 253, 252, 0.94);
    border: 1px solid rgba(32, 167, 139, 0.08);
}

.profile-photo-panel,
.profile-text-panel {
    height: 100%;
    padding: 14px;
    border-radius: 16px;
    background: rgba(247, 251, 249, 0.92);
    border: 1px solid rgba(32, 167, 139, 0.08);
}

.profile-text-panel {
    min-height: 100%;
}

.profile-photo-slot {
    min-height: 92px;
    display: flex;
    align-items: center;
}

.profile-text-panel .empty-state {
    min-height: 92px;
    margin: 0;
}

.locked-section {
    opacity: 0.68;
}

.locked-section::after {
    content: "This month is payroll locked.";
    display: block;
    margin-top: 10px;
    color: #9a5d00;
    font-size: 0.88rem;
    font-weight: 600;
}

.delete-password-dialog {
    width: min(92vw, 420px);
    border: 0;
    border-radius: 20px;
}

.delete-password-dialog .btn {
    border-radius: 12px;
}

.manage-employees-card .btn,
.employee-summary-card .btn,
.audit-log-card .btn {
    border-radius: 12px;
}

@media (max-width: 768px) {
    .insights-grid > .records-card {
        height: 280px;
    }

    .management-grid {
        grid-template-columns: 1fr;
    }

    .manage-employees-shell,
    .audit-log-shell {
        max-height: none;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .employee-summary-card .table-responsive,
    .manage-employees-card .table-responsive,
    .audit-log-shell .audit-log-list,
    .employee-detail-shell .table-responsive,
    .leave-management-shell .table-responsive,
    .payroll-adjustments-shell .table-responsive {
        max-height: 280px;
    }
}
