* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f5f7;
    color: #1f2937;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.auth-card h1 {
    margin-top: 0;
    margin-bottom: 8px;
}

.subtitle {
    margin-top: 0;
    margin-bottom: 24px;
    color: #6b7280;
}

label {
    display: block;
    margin-top: 16px;
    margin-bottom: 6px;
    font-weight: 600;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 16px;
}

button {
    width: 100%;
    margin-top: 22px;
    padding: 12px;
    border: 0;
    border-radius: 6px;
    background: #1f4f78;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    opacity: 0.92;
}

.alert {
    padding: 12px;
    margin-bottom: 16px;
    border-radius: 6px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    background: #1f4f78;
    color: white;
}

.topbar h1 {
    margin: 0;
}

.topbar p {
    margin: 4px 0 0;
}

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

.user-panel form {
    margin: 0;
}

.role {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
}

.logout-button {
    width: auto;
    margin: 0;
    padding: 8px 14px;
    background: #b91c1c;
}

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px;
}

.welcome-card,
.module-card {
    background: white;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.dashboard-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.module-card h3 {
    margin-top: 0;
}
.header-link {
    color: white;
    text-decoration: none;
    font-weight: 600;
}

.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.button-link {
    display: inline-block;
    padding: 11px 18px;
    background: #1f4f78;
    color: white;
    text-decoration: none;
    border-radius: 6px;
}

.form-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 32px;
}

.form-card {
    padding: 28px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    font-size: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.checkbox-label input {
    width: auto;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.table-card {
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    white-space: nowrap;
}

th {
    background: #f8fafc;
}

.action-links {
    display: flex;
    gap: 12px;
}

.action-links a {
    color: #1f4f78;
    text-decoration: none;
}

.status-active {
    color: #166534;
    font-weight: 600;
}

.status-inactive {
    color: #991b1b;
    font-weight: 600;
}

.module-link {
    color: inherit;
    text-decoration: none;
}

.module-link .module-card {
    height: 100%;
}

.module-link .module-card:hover {
    transform: translateY(-2px);
}
.notification-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: white;
    text-decoration: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.notification-button:hover {
    background: rgba(255, 255, 255, 0.22);
}

.notification-bell {
    font-size: 22px;
    line-height: 1;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dc2626;
    color: white;
    border: 2px solid #1f4f78;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.notification-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}

.notification-unread {
    border-left: 5px solid #1f4f78;
    background: #f0f7ff;
}

.notification-content {
    flex: 1;
}

.notification-content h3 {
    margin: 0;
}

.notification-content p {
    margin: 8px 0;
}

.notification-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.unread-label {
    padding: 3px 8px;
    background: #1f4f78;
    color: white;
    border-radius: 999px;
    font-size: 12px;
}

.small-button {
    width: auto;
    margin: 0;
    padding: 9px 14px;
    white-space: nowrap;
}
.search-form {
    margin-bottom: 20px;
}

.search-fields {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.search-fields input[type="text"] {
    flex: 1;
    min-width: 260px;
}

.secondary-button {
    display: inline-block;
    padding: 10px 16px;
    background: #64748b;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    text-align: center;
}

.full-width-button {
    width: 100%;
    margin-top: 12px;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-button {
    width: auto;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    font: inherit;
    cursor: pointer;
}

.danger-link {
    color: #b91c1c;
}

.field-help {
    margin-top: 6px;
    margin-bottom: 12px;
    color: #64748b;
    font-size: 14px;
}
body {
    direction: rtl;
    text-align: right;
}

.topbar {
    direction: rtl;
}

.user-panel {
    direction: rtl;
}

.dashboard-grid {
    direction: rtl;
}

.module-card {
    text-align: right;
}

.welcome-card {
    text-align: right;
}

table {
    direction: rtl;
}

th,
td {
    text-align: right;
}
.deduction-form-page {
    max-width: 900px;
}

fieldset {
    margin: 0 0 24px;
    padding: 22px;
    border: 1px solid #dbe2ea;
    border-radius: 8px;
}

legend {
    padding: 0 10px;
    font-size: 18px;
    font-weight: 700;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
    resize: vertical;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.status-draft {
    background: #e2e8f0;
    color: #334155;
}

.status-active {
    background: #dcfce7;
    color: #166534;
}

.status-suspended {
    background: #fef3c7;
    color: #92400e;
}

.status-completed {
    background: #dbeafe;
    color: #1e40af;
}

.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}
.details-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.details-card {
    padding: 22px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.details-card h3 {
    margin-top: 0;
}

.details-list {
    display: grid;
    grid-template-columns: minmax(120px, 40%) 1fr;
    gap: 10px 16px;
    margin: 0;
}

.details-list dt {
    font-weight: 700;
    color: #475569;
}

.details-list dd {
    margin: 0;
}

.case-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.case-actions form {
    margin: 0;
}

.warning-button,
.danger-button {
    width: auto;
    margin: 0;
    padding: 10px 16px;
}

.warning-button {
    background: #d97706;
}

.danger-button {
    background: #b91c1c;
}

.monthly-generation-card {
    max-width: none;
    margin-bottom: 24px;
}

.inline-generation-form {
    display: flex;
    align-items: end;
    gap: 14px;
    flex-wrap: wrap;
}

.inline-generation-form > div {
    min-width: 240px;
}

.installment-process-form {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 430px;
}

.installment-process-form input {
    min-width: 120px;
}
.confirmation-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    cursor: pointer;
}

.confirmation-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
}
.confirmation-actions {
    margin-top: 12px;
}
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.summary-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.summary-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.summary-card strong {
    display: block;
    position: static;
    font-size: 30px;
    line-height: 1;
}

@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
}