.mtr-portal-wrap {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 16px;
    font-family: inherit;
    color: #1f2933;
}

.mtr-portal-wrap,
.mtr-portal-wrap * {
    box-sizing: border-box;
}

/* Panels */
.mtr-auth-box,
.mtr-dashboard-panel,
.mtr-attendance-panel,
.mtr-timesheet-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    margin-bottom: 16px;
}

.mtr-auth-box h2,
.mtr-dashboard h2,
.mtr-dashboard-panel h3,
.mtr-attendance-panel h3,
.mtr-timesheet-panel h3 {
    margin: 0 0 20px;
    font-size: 24px;
    line-height: 1.4;
    color: #0f172a;
}

.mtr-dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.mtr-dashboard-header p,
.mtr-dashboard-panel p,
.mtr-attendance-panel p,
.mtr-timesheet-panel p {
    margin: 0;
    color: #475569;
    line-height: 1.9;
}

/* Tabs */
.mtr-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 16px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mtr-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 16px;
    border-radius: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.mtr-tab:hover,
.mtr-tab:focus {
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    border-color: #cbd5e1;
}

.mtr-tab.is-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.mtr-tab-content {
    margin-top: 16px;
}

/* Summary cards */
.mtr-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.mtr-summary-item {
    display: block;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.mtr-summary-item:hover,
.mtr-summary-item:focus {
    background: #ffffff;
    border-color: #2563eb;
    text-decoration: none;
    transform: translateY(-1px);
}

.mtr-summary-title {
    display: block;
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 800;
}

.mtr-summary-text {
    display: block;
    color: #64748b;
    font-size: 14px;
    line-height: 1.8;
}

/* Form */
.mtr-field {
    margin-bottom: 16px;
    width: 100%;
}

.mtr-field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.mtr-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

.mtr-field input,
.mtr-field select,
.mtr-field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mtr-field textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.8;
}

.mtr-field input:focus,
.mtr-field select:focus,
.mtr-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

/* Buttons */
.mtr-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.mtr-button:hover,
.mtr-button:focus {
    background: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.mtr-button-secondary {
    background: #475569;
}

.mtr-button-secondary:hover,
.mtr-button-secondary:focus {
    background: #334155;
}

.mtr-button-danger {
    background: #dc2626;
}

.mtr-button-danger:hover,
.mtr-button-danger:focus {
    background: #b91c1c;
}

.mtr-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Auth links */
.mtr-auth-links {
    margin-top: 18px;
    font-size: 14px;
}

.mtr-auth-links a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.mtr-auth-links a:hover {
    text-decoration: underline;
}

.mtr-optional {
    color: #64748b;
    font-weight: 400;
}

/* Notices */
.mtr-notice {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.8;
    border: 1px solid transparent;
}

.mtr-notice-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.mtr-notice-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.mtr-notice-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

/* Tables */
.mtr-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mtr-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 14px;
}

.mtr-table th,
.mtr-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: right;
    vertical-align: top;
}

.mtr-table th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
}

.mtr-table tbody tr:hover {
    background: #f8fafc;
}

.mtr-desc-row td {
    background: #f9fafb;
    color: #475569;
    font-size: 13px;
    line-height: 1.8;
}

.mtr-muted {
    color: #64748b;
    font-size: 13px;
    line-height: 1.8;
}

/* Status badges */
.mtr-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    background: #e2e8f0;
    color: #334155;
}

.mtr-status-info {
    background: #dbeafe;
    color: #1e40af;
}

.mtr-status-success {
    background: #dcfce7;
    color: #166534;
}

.mtr-status-warning {
    background: #fef3c7;
    color: #92400e;
}

.mtr-status-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Timesheet */
.mtr-timesheet-panel {
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .mtr-portal-wrap {
        margin: 20px auto;
        padding: 0 12px;
    }

    .mtr-auth-box,
    .mtr-dashboard-panel,
    .mtr-attendance-panel,
    .mtr-timesheet-panel {
        padding: 18px;
        border-radius: 10px;
    }

    .mtr-dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .mtr-field-row,
    .mtr-summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mtr-tabs {
        padding: 6px;
    }

    .mtr-tab {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .mtr-button-row {
        flex-direction: column;
        align-items: stretch;
    }

    .mtr-button {
        width: 100%;
    }

    .mtr-table {
        min-width: 680px;
    }
}

@media (max-width: 480px) {
    .mtr-auth-box h2,
    .mtr-dashboard h2,
    .mtr-dashboard-panel h3,
    .mtr-attendance-panel h3,
    .mtr-timesheet-panel h3 {
        font-size: 20px;
    }

    .mtr-auth-box,
    .mtr-dashboard-panel,
    .mtr-attendance-panel,
    .mtr-timesheet-panel {
        padding: 16px;
    }

    .mtr-timesheet-panel {
        margin-top: 14px;
    }
}

/* Attendance correction requests */
.mtr-attendance-request-panel,
.mtr-attendance-request-history,
.mtr-attendance-history {
    margin-top: 16px;
}

.mtr-attendance-request-form textarea {
    resize: vertical;
}

.mtr-attendance-request-history .mtr-table {
    min-width: 880px;
}
