* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #1f2933;
    font-family: Arial, sans-serif;
}

a {
    color: var(--theme-color, #1b65d8);
    text-decoration: none;
}

.auth-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-panel {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    max-width: 420px;
    padding: 28px;
    width: 100%;
}

.login-panel h1 {
    font-size: 24px;
    margin: 0 0 8px;
}

.login-panel p {
    color: #52606d;
    margin: 0 0 24px;
}

.login-form {
    display: grid;
    gap: 10px;
}

.login-form input,
.login-form select {
    border: 1px solid #bcccdc;
    border-radius: 6px;
    font-size: 15px;
    padding: 10px 12px;
}

.login-form button {
    background: var(--theme-color, #1b65d8);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    margin-top: 8px;
    padding: 11px 14px;
}

.alert {
    border-radius: 6px;
    margin-bottom: 16px;
    padding: 10px 12px;
}

.alert-error {
    background: #ffe8e8;
    color: #9b1c1c;
}

.alert-success {
    background: #e3fcef;
    color: #0c6b58;
}

.alert-info {
    background: #e8f1ff;
    color: #1c3d9b;
    border-left: 3px solid #1c3d9b;
}

.alert-warning {
    background: #fffbea;
    color: #8d6500;
    border-left: 3px solid #8d6500;
}

.status-legend {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px;
}

.status-legend-title {
    color: #334e68;
    font-size: 13px;
    font-weight: 700;
    margin-right: 4px;
}

.navbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
    display: flex;
    gap: 24px;
    justify-content: space-between;
    min-height: 76px;
    padding: 10px 28px;
}

.navbar-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    font-weight: 700;
    min-width: 250px;
}

.navbar-logo {
    background: #ffffff;
    border: 1px solid #e6edf3;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.08);
    height: 52px;
    object-fit: contain;
    padding: 4px;
    width: 200px;
}

.navbar-brand-text {
    display: grid;
    gap: 3px;
}

.navbar-brand-text strong {
    color: #101828;
    font-size: 18px;
    line-height: 1.15;
}

.navbar-brand-text span {
    color: #667085;
    font-size: 12px;
    font-weight: 600;
}

.navbar-company {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    font-size: 13px;
    gap: 8px;
    justify-content: center;
}

.navbar-contact-item {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e6edf3;
    border-radius: 999px;
    color: #475467;
    display: inline-flex;
    gap: 7px;
    line-height: 1.2;
    max-width: 360px;
    min-height: 34px;
    overflow: hidden;
    padding: 8px 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-contact-item svg {
    fill: none;
    flex: 0 0 auto;
    height: 16px;
    stroke: var(--theme-color, #1b65d8);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 16px;
}

.navbar-user {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e6edf3;
    border-radius: 999px;
    display: flex;
    gap: 12px;
    padding: 8px 12px;
    white-space: nowrap;
}

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 76px);
}

.sidebar {
    background: #101828;
    border-right: 1px solid #d9e2ec;
    padding: 18px 12px;
}

.sidebar a {
    border-radius: 6px;
    color: #d9e2ec;
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    padding: 11px 12px;
}

.sidebar a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar a.is-active {
    background: var(--theme-color, #1b65d8);
    color: #ffffff;
}

.sidebar a.is-disabled {
    color: #829ab1;
    cursor: default;
}

.sidebar-dot {
    background: #e02424;
    border-radius: 50%;
    display: inline-block;
    height: 9px;
    width: 9px;
    margin-left: 8px;
    vertical-align: middle;
    position: relative;
}

.sidebar-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: rgba(224, 36, 36, 0.55);
    animation: sidebar-dot-pulse 1.6s ease-out infinite;
}

@keyframes sidebar-dot-pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(2.6); opacity: 0; }
}

.content {
    padding: 28px;
}

.page-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.page-header h1 {
    margin: 0 0 6px;
}

.page-header p {
    color: #52606d;
    margin: 0;
}

.panel {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 18px;
}

.stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 22px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    padding: 18px;
}

.stat-card span {
    color: #52606d;
    display: block;
    margin-bottom: 10px;
}

.stat-card strong {
    display: block;
    font-size: 30px;
}

.dashboard-section {
    margin-top: 28px;
}

.section-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-heading h2 {
    font-size: 20px;
    margin: 0;
}

.section-heading span {
    color: #52606d;
    font-size: 14px;
}

.section-heading-compact {
    margin-bottom: 16px;
}

.summary-card strong {
    font-size: 28px;
}

.dashboard-header {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    padding: 18px;
}

.dashboard-cards .stat-card {
    border-left: 4px solid var(--theme-color, #1b65d8);
}

.overview-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.overview-grid div {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    padding: 16px;
}

.overview-grid span {
    color: #52606d;
    display: block;
    margin-bottom: 8px;
}

.overview-grid strong {
    display: block;
    font-size: 24px;
}

.notice-banner {
    background: #e3fcef;
    border: 1px solid #9ae6c1;
    border-radius: 8px;
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    padding: 14px 16px;
}

.notice-banner strong {
    color: #0c6b58;
}

.notice-banner span {
    color: #334e68;
}

.notice-banner-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.notice-banner-actions div {
    display: grid;
    gap: 6px;
}

.holiday-banner {
    background: #fffbea;
    border-color: #f7d070;
}

.holiday-banner strong {
    color: #8d6500;
}

.weekly-summary {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.weekly-item {
    background: #f4f6f8;
    border: 1px solid #e6edf3;
    border-radius: 8px;
    padding: 14px;
}

.weekly-item span {
    color: #52606d;
    display: block;
    margin-bottom: 8px;
}

.weekly-item strong {
    display: block;
    font-size: 20px;
}

.checklist-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.checklist-grid span {
    background: #f4f6f8;
    border: 1px solid #e6edf3;
    border-radius: 8px;
    padding: 12px;
}

.button-primary,
.button-secondary,
.form-actions button,
.search-form button,
.actions button {
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    font-size: 14px;
    line-height: 1;
    padding: 10px 12px;
}

.button-primary,
.form-actions button,
.search-form button {
    background: var(--theme-color, #1b65d8);
    color: #ffffff;
}

.button-secondary {
    background: #eef2f7;
    color: #1f2933;
}

.button-secondary.is-active {
    background: var(--theme-soft, #d8e7ff);
    color: var(--theme-strong, #164a9f);
    font-weight: 700;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.form-grid label {
    color: #334e68;
    display: grid;
    gap: 7px;
    font-size: 14px;
}

.form-grid input,
.form-grid select,
.search-form input,
.search-form select {
    border: 1px solid #bcccdc;
    border-radius: 6px;
    font-size: 15px;
    padding: 10px 12px;
    width: 100%;
}

.form-grid input[type="color"] {
    min-height: 42px;
    padding: 4px;
}

.form-grid input:disabled {
    background: #eef2f7;
    color: #52606d;
}

.form-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.form-actions {
    align-items: end;
    display: flex;
    gap: 10px;
}

.break-reset-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    grid-column: 1 / -1;
}

.break-system-hint {
    color: #52606d;
    font-size: 13px;
}

.break-system-hint strong {
    color: #334e68;
}

.search-form {
    align-items: center;
    display: flex;
    gap: 10px;
}

.search-form-wrap {
    flex-wrap: wrap;
}

.search-form input,
.search-form select {
    max-width: 420px;
}

.search-form select {
    min-width: 220px;
}

.date-range-wrap {
    display: inline-flex;
    gap: 10px;
}

.date-range-wrap input {
    max-width: 200px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #e6edf3;
    padding: 12px;
    text-align: left;
    vertical-align: middle;
}

th {
    color: #334e68;
    font-size: 13px;
}

.badge {
    background: #eef2f7;
    border-radius: 999px;
    display: inline-flex;
    padding: 5px 9px;
}

.badge-status {
    font-weight: 700;
}

.badge-working {
    background: #164a9f;
    color: #ffffff;
    font-weight: 700;
}

.badge-break {
    background: #fffbea;
    color: #8d6500;
}

.badge-completed {
    background: #d8e7ff;
    color: #164a9f;
}

.badge-not-logged-in {
    background: #eef2f7;
    color: #52606d;
}

.badge-pending {
    background: #fffbea;
    color: #8d6500;
}

.badge-approved {
    background: #e3fcef;
    color: #0c6b58;
}

.badge-rejected {
    background: #ffe8e8;
    color: #9b1c1c;
}

.badge-absent {
    background: #9b1c1c;
    color: #ffffff;
    font-weight: 700;
}

.badge-half-day {
    background: #b7791f;
    color: #ffffff;
    font-weight: 700;
}

.badge-miss-punch {
    background: #0c6b58;
    color: #ffffff;
    font-weight: 700;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actions form {
    margin: 0;
}

.actions button {
    background: #eef2f7;
    color: #1f2933;
}

.actions .danger {
    background: #ffe8e8;
    color: #9b1c1c;
}

.inline-form {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-form input {
    border: 1px solid #bcccdc;
    border-radius: 6px;
    padding: 9px 10px;
}

.avatar {
    border-radius: 50%;
    height: 38px;
    object-fit: cover;
    width: 38px;
}

.avatar-empty {
    align-items: center;
    background: #eef2f7;
    color: #829ab1;
    display: inline-flex;
    justify-content: center;
}

.profile-preview {
    border-radius: 8px;
    height: 96px;
    margin-bottom: 16px;
    object-fit: cover;
    width: 96px;
}

.detail-layout {
    display: grid;
    gap: 24px;
    grid-template-columns: 180px 1fr;
}

.profile-photo {
    border-radius: 8px;
    height: 160px;
    object-fit: cover;
    width: 160px;
}

.profile-photo-empty {
    align-items: center;
    background: #eef2f7;
    color: #829ab1;
    display: flex;
    justify-content: center;
}

.detail-list {
    display: grid;
    gap: 10px 18px;
    grid-template-columns: 160px 1fr;
    margin: 0;
}

.detail-list dt {
    color: #52606d;
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
}

.attendance-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 18px;
}

.attendance-card {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    min-height: 150px;
    padding: 18px;
}

.attendance-card span {
    color: #52606d;
    display: block;
    margin-bottom: 14px;
}

.attendance-card strong {
    display: block;
    font-size: 28px;
}

.attendance-card dl {
    display: grid;
    gap: 8px 14px;
    grid-template-columns: 90px 1fr;
    margin: 0;
}

.attendance-card dt {
    color: #52606d;
}

.attendance-card dd {
    font-weight: 700;
    margin: 0;
}

.progress-bar {
    background: #e6edf3;
    border-radius: 999px;
    height: 12px;
    margin-bottom: 14px;
    overflow: hidden;
}

.progress-bar div {
    background: var(--theme-color, #1b65d8);
    height: 100%;
    transition: width 0.2s ease;
}

.attendance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.report-card {
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 16px;
}

.report-card h3 {
    font-size: 16px;
    margin: 0 0 12px;
    color: #334e68;
}

.report-content {
    color: #1f2933;
    line-height: 1.6;
}

.report-content p {
    margin: 0 0 10px;
}

.report-content p:last-child {
    margin-bottom: 0;
}

.report-content ul,
.report-content ol {
    margin: 10px 0;
    padding-left: 24px;
}

.report-content li {
    margin-bottom: 6px;
}

.report-content table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
}

.report-content th,
.report-content td {
    border: 1px solid #d9e2ec;
    padding: 8px;
    text-align: left;
}

.report-content th {
    background: #f4f6f8;
}
    color: #1f2933;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.report-meta {
    color: #52606d;
    font-size: 13px;
    margin-bottom: 12px;
}

.form-group {
    display: grid;
    gap: 7px;
    margin-bottom: 16px;
}

.form-group label {
    color: #334e68;
    font-size: 14px;
    font-weight: 700;
}

.form-group textarea,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select {
    border: 1px solid #bcccdc;
    border-radius: 6px;
    font-family: Arial, sans-serif;
    font-size: 15px;
    padding: 12px;
    width: 100%;
}

.form-group textarea {
    min-height: 160px;
    resize: vertical;
}

.attendance-actions button {
    background: var(--theme-color, #1b65d8);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    padding: 12px 16px;
}

.chart-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.chart-card {
    margin-bottom: 0;
}

.chart-card h3 {
    font-size: 16px;
    margin: 0 0 16px;
}

.chart-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 110px 1fr 42px;
    margin-bottom: 12px;
}

.chart-row span {
    color: #52606d;
    font-size: 13px;
}

.chart-row strong {
    text-align: right;
}

.chart-track {
    background: #e6edf3;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.chart-track div {
    background: var(--theme-color, #1b65d8);
    height: 100%;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.pagination a {
    background: #eef2f7;
    border-radius: 6px;
    color: #1f2933;
    padding: 8px 11px;
}

.pagination a.is-active {
    background: var(--theme-color, #1b65d8);
    color: #ffffff;
}

.modal {
    align-items: center;
    background: rgba(31, 41, 51, 0.58);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 20px;
    position: fixed;
    z-index: 20;
}

.modal[hidden] {
    display: none;
}

.modal-panel {
    background: #ffffff;
    border-radius: 8px;
    max-height: 90vh;
    max-width: 720px;
    overflow: auto;
    padding: 22px;
    position: relative;
    width: 100%;
}

.modal-close {
    background: #eef2f7;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    height: 34px;
    position: absolute;
    right: 14px;
    top: 14px;
    width: 34px;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.popup-header {
    align-items: center;
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
}

.popup-header h2 {
    font-size: 22px;
    margin: 0 0 4px;
}

.popup-header p {
    color: #52606d;
    margin: 0;
}

.popup-details {
    margin-bottom: 18px;
}

.timeline {
    border-left: 2px solid #d9e2ec;
    display: grid;
    gap: 12px;
    margin: 18px 0;
    padding-left: 16px;
}

.timeline div {
    display: grid;
    gap: 4px;
}

.timeline span {
    color: #52606d;
    font-size: 13px;
}

.timeline strong {
    font-size: 16px;
}

.popup-summary {
    margin-top: 16px;
}

@media print {
    .navbar,
    .sidebar,
    .no-print,
    .page-header .actions,
    .button-primary,
    .button-secondary,
    .actions button {
        display: none !important;
    }

    body {
        background: #ffffff;
    }

    .app-shell {
        display: block;
    }

    .content {
        padding: 0;
    }

    .panel {
        border: 0;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid #d9e2ec;
    }

    .navbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        padding-bottom: 12px;
        padding-top: 12px;
    }

    .navbar-company {
        justify-content: flex-start;
        width: 100%;
    }

    .navbar-contact-item {
        border-radius: 8px;
        max-width: 100%;
        white-space: normal;
    }

    .navbar-user {
        border-radius: 8px;
        flex-wrap: wrap;
        width: 100%;
    }

    .page-header,
    .search-form,
    .detail-layout {
        align-items: stretch;
        flex-direction: column;
        grid-template-columns: 1fr;
    }

    .chart-row {
        grid-template-columns: 90px 1fr 36px;
    }

    .detail-list {
        grid-template-columns: 1fr;
    }
}
