* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #1f2933;
    font-family: Arial, sans-serif;
}

a {
    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: #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;
}

.navbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #d9e2ec;
    display: flex;
    justify-content: space-between;
    min-height: 60px;
    padding: 0 24px;
}

.navbar-brand {
    font-weight: 700;
}

.navbar-user {
    align-items: center;
    display: flex;
    gap: 14px;
}

.app-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 60px);
}

.sidebar {
    background: #ffffff;
    border-right: 1px solid #d9e2ec;
    padding: 18px;
}

.sidebar a {
    display: block;
    padding: 10px 12px;
}

.sidebar a.is-disabled {
    color: #829ab1;
    cursor: default;
}

.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 #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;
}

.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: #1b65d8;
    color: #ffffff;
}

.button-secondary {
    background: #eef2f7;
    color: #1f2933;
}

.button-secondary.is-active {
    background: #d8e7ff;
    color: #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;
}

.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;
}

.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: #e3fcef;
    color: #0c6b58;
}

.badge-break {
    background: #fffbea;
    color: #8d6500;
}

.badge-completed {
    background: #d8e7ff;
    color: #164a9f;
}

.badge-not-logged-in {
    background: #eef2f7;
    color: #52606d;
}

.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;
}

.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: #1b65d8;
    height: 100%;
    transition: width 0.2s ease;
}

.attendance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.attendance-actions button {
    background: #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: #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: #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;
    }

    .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;
    }
}
