/* ===== Reset ===== */
* {
    box-sizing: border-box;
    font-family: Vazirmatn, Tahoma, sans-serif;
}

body {
    margin: 0;
    background: #f4f6f8;
    direction: rtl;
}

a {
    text-decoration: none;
}

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
}

/* ===== Card ===== */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08);
    margin-bottom: 20px;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

/* ===== Form ===== */
form input,
form select {
    width: 100%;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 14px;
}

form input:focus,
form select:focus {
    outline: none;
    border-color: #4f46e5;
}

/* ===== Buttons ===== */
button {
    background: #4f46e5;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background: #4338ca;
}

/* ===== Tables ===== */
table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
}

table th {
    background: #f1f5f9;
    font-weight: bold;
}

/* ===== Alerts ===== */
.alert {
    width: 98%;
    max-width: 1100px;
    margin: 10px auto;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== Navbar ===== */
.navbar {
    background: #1e293b;
    padding: 12px 20px;
}

.navbar a {
    color: #fff;
    margin-left: 15px;
    text-decoration: none;
    background: transparent;
    padding: 7px;
    border-radius: 9px;
}

.navbar a:hover {
    color: #1e293b;
    background: #ffffff;
}

/* ===== Login ===== */
.login-box {
    max-width: 400px;
    margin: 100px auto;
}

.patterns-list label {
    cursor: pointer;
}

.patterns-list input {
    margin-left: 6px;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {

    body {
        font-size: 16px;
    }

    .container {
        margin: 15px auto;
        padding: 10px;
    }

    .card {
        padding: 15px;
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0,0,0,.12);
    }

    .card h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    /* فرم‌ها */
    form input,
    form select,
    button {
        font-size: 16px;
        padding: 14px;
        margin-bottom: 16px;
    }

    /* دکمه‌ها */
    button {
        width: 100%;
        padding: 14px;
    }

    /* جدول‌ها → اسکرول افقی */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table th,
    table td {
        font-size: 14px;
        padding: 8px;
    }

    /* نوبار */
    .navbar {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .navbar a {
        flex: 1 1 auto;
        text-align: center;
        font-size: 14px;
    }

    /* alerts */
    .alert {
        width: 100%;
        font-size: 14px;
    }

    /* چک‌باکس پترن‌ها */
    .patterns-list label {
        display: block;
        padding: 10px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        margin-bottom: 8px;
        font-size: 15px;
    }

    .patterns-list input {
        transform: scale(1.3);
        margin-left: 10px;
    }
}
