* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: #f3f6fb;
    color: #1f2937;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #eef2ff, #f8fafc);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    border: 1px solid #e5e7eb;
}

.login-card h1,
.work-panel h2,
.result-box h3,
.entry-form-box h3,
.review-box h3 {
    margin: 0 0 10px;
    color: #111827;
}

.login-card p,
.work-panel p,
.entry-form-box p,
.review-box p {
    margin: 0 0 18px;
    color: #6b7280;
}

label {
    display: block;
    margin: 16px 0 8px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    background: #fff;
}

textarea {
    min-height: 96px;
    padding-top: 12px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input:disabled {
    background: #f3f4f6;
    color: #9ca3af;
}

button {
    width: 100%;
    margin-top: 22px;
    min-height: 48px;
    border: none;
    border-radius: 12px;
    background: #2563eb;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
}

button:hover { background: #1d4ed8; }

.dashboard-page {
    min-height: 100vh;
    padding: 28px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px 26px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.topbar h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.topbar p {
    margin: 0;
    color: #6b7280;
}

.logout-link,
.neutral-link,
.small-link,
.warning-link {
    display: inline-block;
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.logout-link {
    background: #fee2e2;
    color: #991b1b;
}

.neutral-link {
    background: #e5e7eb;
    color: #374151;
}

.small-link {
    background: #2563eb;
    color: #fff;
}

.warning-link {
    background: #f59e0b;
    color: #fff;
}

.flash-list {
    margin-top: 18px;
}

.flash-message {
    padding: 14px 16px;
    border-radius: 14px;
    font-weight: 800;
    margin-bottom: 10px;
}

.flash-message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.flash-message.error,
.error-message {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.error-message {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-weight: 700;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 22px;
}

.stat-card,
.work-panel,
.result-box,
.entry-form-box,
.review-box,
.collapsible-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.stat-card {
    padding: 22px;
}

.stat-card span {
    display: block;
    color: #6b7280;
    margin-bottom: 12px;
    font-weight: 700;
}

.stat-card strong {
    display: block;
    font-size: 30px;
    color: #2563eb;
}

.work-panel {
    margin-top: 22px;
    padding: 26px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.selection-box {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr;
    gap: 10px 16px;
    align-items: center;
    margin-top: 22px;
    padding: 16px;
    border-radius: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.selection-box span {
    color: #64748b;
    font-weight: 700;
}

.selection-box strong {
    color: #1d4ed8;
}

.employee-search-form {
    margin-top: 22px;
}

.search-row,
.mini-filter {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 12px;
}

.search-row button,
.mini-filter button {
    margin-top: 0;
}

.result-box,
.entry-form-box,
.review-box {
    margin-top: 22px;
    padding: 20px;
    overflow-x: auto;
}

.collapsible-box {
    margin-top: 22px;
    overflow: hidden;
}

.collapsible-box summary {
    cursor: pointer;
    list-style: none;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-weight: 800;
}

.collapsible-box summary::-webkit-details-marker {
    display: none;
}

.collapsible-box summary::before {
    content: "▾";
    color: #2563eb;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.collapsible-box:not([open]) summary::before {
    transform: rotate(90deg);
}

.collapsible-box summary strong {
    color: #2563eb;
    background: #eff6ff;
    border-radius: 999px;
    padding: 6px 10px;
}

.collapsible-content {
    padding: 0 20px 20px;
    overflow-x: auto;
}

.edit-mode {
    border-color: #f59e0b;
    background: #fffbeb;
}

.section-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    min-width: 900px;
}

.data-table th,
.data-table td {
    padding: 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
    vertical-align: middle;
}

.data-table th,
.data-table tfoot td {
    background: #f3f4f6;
    color: #374151;
    font-weight: 800;
}

.empty-message {
    margin: 0;
    color: #6b7280;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.checkbox-label input {
    width: auto;
    min-height: auto;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.action-row form {
    margin: 0;
}

.action-row button,
.danger-button,
.final-button,
.time-tools button {
    width: auto;
    margin-top: 0;
    min-height: 38px;
    padding: 0 14px;
    font-size: 14px;
}

.danger-button {
    background: #dc2626;
}

.danger-button:hover {
    background: #b91c1c;
}

.final-button {
    background: #16a34a;
    min-height: 48px;
    font-size: 16px;
}

.final-button:hover {
    background: #15803d;
}

.form-actions {
    margin-top: 18px;
}

.time-tools {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.time-tools button {
    background: #eef2ff;
    color: #1d4ed8;
}

.time-tools button:hover {
    background: #dbeafe;
}

.badge,
.locked-badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.badge.normal {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.report {
    background: #fef3c7;
    color: #92400e;
}

.badge.rial {
    background: #dcfce7;
    color: #166534;
}

.locked-badge {
    background: #e5e7eb;
    color: #374151;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.modal-overlay.is-open {
    display: flex;
}

.modal-card {
    width: min(960px, 100%);
    max-height: 90vh;
    overflow: auto;
    margin-top: 0;
    border-radius: 18px;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    text-decoration: none;
    font-size: 28px;
    line-height: 38px;
    text-align: center;
    font-weight: 900;
}

@media (max-width: 900px) {
    .stats-grid,
    .form-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .topbar,
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .selection-box {
        grid-template-columns: 1fr;
    }

    .search-row,
    .mini-filter {
        grid-template-columns: 1fr;
    }

    .modal-overlay {
        align-items: flex-start;
        padding: 12px;
    }
}

@media (max-width: 520px) {
    .dashboard-page {
        padding: 16px;
    }

    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }
}
.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.admin-tabs a {
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 12px;
    color: #374151;
    font-weight: 800;
    background: #f3f4f6;
}

.admin-tabs a.active {
    background: #2563eb;
    color: #fff;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.checkbox-grid input {
    width: auto;
    min-height: auto;
}

.sub-title {
    margin: 22px 0 10px;
}

.admin-details {
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    margin-bottom: 12px;
    overflow: hidden;
}

.admin-details summary {
    cursor: pointer;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    font-weight: 800;
    background: #f9fafb;
}

.admin-details form {
    padding: 18px;
}

.status-good {
    color: #166534;
    background: #dcfce7;
    border-radius: 999px;
    padding: 6px 10px;
}

.status-bad {
    color: #991b1b;
    background: #fee2e2;
    border-radius: 999px;
    padding: 6px 10px;
}

.small-table-button,
.warning-button {
    width: auto;
    margin-top: 0;
    min-height: 38px;
    padding: 0 14px;
    font-size: 14px;
}

.warning-button {
    background: #f59e0b;
}

.warning-button:hover {
    background: #d97706;
}

@media (max-width: 900px) {
    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}
.export-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.export-card {
    display: block;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    color: #111827;
}

.export-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 17px;
}

.export-card span {
    color: #6b7280;
}

.export-card:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

@media (max-width: 900px) {
    .export-grid {
        grid-template-columns: 1fr;
    }
}

.export-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.badge.normal_friday {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.friday-export-card {
    background: #fffaf0;
    border-color: #fdba74;
}

.friday-export-card:hover {
    border-color: #ea580c;
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.14);
}

@media (max-width: 1100px) {
    .export-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .export-grid {
        grid-template-columns: 1fr;
    }
}