* {
    box-sizing: border-box;
}


html {
    direction: rtl;
}


body {

    margin: 0;

    min-height: 100vh;

    background: #f3f6fa;

    color: #1f2937;

    font-family:
        Tahoma,
        Arial,
        "Segoe UI",
        sans-serif;

    direction: rtl;

    text-align: right;
}


button,
input,
select,
textarea {

    font-family: inherit;

}


input,
select,
textarea {

    width: 100%;

    min-height: 46px;

    padding: 10px 13px;

    border: 1px solid #d1d5db;

    border-radius: 9px;

    background: #fff;

    color: #111827;

    font-size: 15px;

    outline: none;
}


input:focus,
select:focus,
textarea:focus {

    border-color: #1769aa;

    box-shadow:
        0 0 0 3px
        rgba(23,105,170,.12);

}


label {

    display: block;

    margin-bottom: 7px;

    font-weight: 600;

    color: #374151;

}


.form-group {

    margin-bottom: 18px;

}


/* =========================================================
   LOGIN
   ========================================================= */

.login-page {

    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

}


.login-card {

    width: 100%;

    max-width: 430px;

    background: #fff;

    padding: 35px;

    border-radius: 18px;

    box-shadow:
        0 10px 35px
        rgba(0,0,0,.08);
}


.login-logo {

    text-align: center;

    margin-bottom: 30px;

}


.logo-icon {

    width: 64px;

    height: 64px;

    display: flex;

    align-items: center;

    justify-content: center;

    margin: 0 auto 15px;

    border-radius: 16px;

    background:
        linear-gradient(
            135deg,
            #123c69,
            #1769aa
        );

    font-size: 30px;
}


.login-logo h1 {

    margin: 0 0 8px;

    color: #123c69;

    font-size: 24px;
}


.login-logo p {

    margin: 0;

    color: #6b7280;

}


.primary-button {

    width: 100%;

    min-height: 46px;

    border: 0;

    border-radius: 9px;

    background: #123c69;

    color: white;

    cursor: pointer;

    font-size: 15px;

    font-weight: 700;

    transition:
        background .2s ease;
}


.primary-button:hover {

    background: #0d2e50;

}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {

    padding: 12px 15px;

    margin-bottom: 18px;

    border-radius: 9px;

    font-size: 14px;

}


.alert-error {

    background: #fff1f2;

    border: 1px solid #fecdd3;

    color: #9f1239;

}


.alert-success {

    background: #ecfdf5;

    border: 1px solid #a7f3d0;

    color: #065f46;

}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 600px) {

    .login-card {

        padding: 25px 20px;

    }

}
/* =========================================================
   ADMIN DASHBOARD
   ========================================================= */

.dashboard-page {
    min-height: 100vh;
    background: #f5f7fb;
    padding: 30px 15px;
}

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

.dashboard-header {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.dashboard-header h1 {
    margin: 0 0 8px;
    color: #172033;
    font-size: 25px;
}

.dashboard-header p {
    margin: 0;
    color: #6b7280;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.stat-label {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-value {
    color: #172033;
    font-size: 30px;
    font-weight: 700;
}

.dashboard-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}

.dashboard-card h2 {
    margin: 0 0 20px;
    color: #172033;
    font-size: 20px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.action-card {
    text-decoration: none;
    color: #172033;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-card:hover {
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.10);
}

.action-icon {
    font-size: 28px;
    margin-bottom: 5px;
}

.action-card strong {
    font-size: 16px;
}

.action-card small {
    color: #6b7280;
    line-height: 1.8;
}

.badge {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
}

.badge-primary {
    background: #eff6ff;
    color: #2563eb;
}

.secondary-button {
    display: inline-block;
    padding: 11px 20px;
    border-radius: 9px;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
    border: 1px solid #e2e8f0;
}

.secondary-button:hover {
    background: #e2e8f0;
}

@media (max-width: 900px) {

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {

    .dashboard-page {
        padding: 15px 10px;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .action-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   TABLES / UNIT MANAGEMENT
   ========================================================= */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 850px;
}

.data-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    padding: 14px 12px;
    text-align: right;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.data-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #eef0f4;
    color: #334155;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #fafcff;
}

.data-table small {
    color: #64748b;
}

.table-button {
    display: inline-block;
    padding: 7px 13px;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 7px;
    text-decoration: none;
    font-size: 13px;
}

.table-button:hover {
    background: #dbeafe;
}

.status-badge {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
}

.status-active {
    background: #ecfdf5;
    color: #047857;
}

.status-inactive {
    background: #fef2f2;
    color: #b91c1c;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d7dce5;
    border-radius: 9px;
    padding: 11px 13px;
    background: #ffffff;
    color: #172033;
    font-family: inherit;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
}

@media (max-width: 700px) {

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
