*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, "Segoe UI", Arial, sans-serif;
    background: #f5f5f5;
    color: #222;
    line-height: 1.6;
}

.landing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    padding: 2rem 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.card h1 {
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
    text-align: center;
    font-weight: 600;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

input[type="tel"],
input[type="text"],
input[type="password"],
input[type="url"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    direction: ltr;
    text-align: left;
}

textarea {
    direction: rtl;
    text-align: right;
    resize: vertical;
}

button,
.btn {
    display: inline-block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
}

button:hover,
.btn:hover {
    background: #1d4ed8;
}

.error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

.success-message {
    margin: 0 0 1rem;
    text-align: center;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* Admin */
.admin-body {
    background: #eef2f7;
}

.admin-header {
    background: #1e293b;
    color: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.1rem;
}

.admin-nav a {
    color: #cbd5e1;
    text-decoration: none;
    margin-right: 1rem;
    font-size: 0.9rem;
}

.admin-nav a:hover {
    color: #fff;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.panel {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.panel h2 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.filters label {
    font-size: 0.8rem;
    color: #555;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.filter-actions button,
.filter-actions .btn {
    width: auto;
    margin-top: 0;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-secondary {
    background: #64748b;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: #dc2626;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-success {
    background: #16a34a;
}

.btn-success:hover {
    background: #15803d;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th, td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: right;
}

th {
    background: #f8fafc;
    font-weight: 600;
}

tr:hover td {
    background: #f9fafb;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

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

.badge-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.stat-card .number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2563eb;
}

.stat-card .label {
    font-size: 0.85rem;
    color: #64748b;
}

.form-row {
    margin-bottom: 1rem;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    direction: rtl;
}

.checkbox-group input {
    width: auto;
}

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

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

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

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

.filter-summary {
    font-size: 0.9rem;
    color: #475569;
    margin: 0 0 1rem;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.actions-inline {
    display: flex;
    gap: 0.5rem;
}

.actions-inline form {
    display: inline;
}

.actions-inline button {
    width: auto;
    margin-top: 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

@media (max-width: 600px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    table {
        font-size: 0.8rem;
    }
}
