* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f5e9 100%);
    min-height: 100vh;
    color: #1f2937;
    padding: 20px;
    -webkit-text-size-adjust: 100%;
}
.container { max-width: 1100px; margin: 0 auto; }
.topbar {
    display: flex; justify-content: space-between; align-items: center;
    background: #fff; padding: 20px 24px; border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06); margin-bottom: 20px;
}
.topbar h1 { font-size: 22px; color: #0f766e; }
.card {
    background: #fff; padding: 22px; border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); margin-bottom: 20px;
}
.form .field { margin-bottom: 16px; }
.form label { display: block; margin-bottom: 6px; font-weight: 600; font-size: 14px; color: #374151; }
.form input, .form select {
    width: 100%; padding: 11px 14px; border: 1.5px solid #e5e7eb;
    border-radius: 10px; font-size: 15px; font-family: inherit;
    transition: border-color .2s;
    -webkit-appearance: none;
    appearance: none;
}
.form input:focus, .form select:focus { outline: none; border-color: #0f766e; }
.row { display: flex; gap: 12px; }
.field-code { flex: 0 0 110px; }
.field-phone { flex: 1; }
.btn {
    display: inline-block; padding: 10px 18px; border-radius: 10px;
    text-decoration: none; font-size: 14px; font-weight: 600;
    border: none; cursor: pointer; transition: transform .1s, opacity .2s;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { opacity: .9; transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: #0f766e; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #1f2937; }
.btn-block { width: 100%; padding: 13px; font-size: 16px; }
.btn-call { background: #2563eb; color: #fff; }
.btn-wa { background: #25d366; color: #fff; }
.btn-danger { background: #ef4444; color: #fff; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters input, .filters select {
    flex: 1; min-width: 160px; padding: 10px 14px;
    border: 1.5px solid #e5e7eb; border-radius: 10px; font-size: 14px;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.stats { margin-bottom: 14px; color: #4b5563; font-size: 14px; }
.clients-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}
.client-card {
    background: #fff; padding: 18px; border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border-right: 4px solid #0f766e;
}
.client-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 14px; gap: 10px;
}
.client-name { font-size: 17px; font-weight: 700; color: #111827; margin-bottom: 4px; }
.client-phone { font-size: 14px; color: #6b7280; direction: ltr; text-align: right; }
.badge {
    background: #ecfeff; color: #0e7490; padding: 5px 11px;
    border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.client-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.client-actions .btn { flex: 1; padding: 9px; font-size: 13px; }
.empty {
    grid-column: 1/-1; text-align: center; padding: 50px 20px;
    background: #fff; border-radius: 14px; color: #9ca3af; font-size: 15px;
}

/* ===== تابلت ===== */
@media (max-width: 900px) {
    .clients-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
} 

/* ===== موبايل ===== */
@media (max-width: 600px) {
    body { padding: 12px; }
    .topbar {
        flex-direction: column; gap: 12px; align-items: stretch;
        text-align: center; padding: 16px;
    }
    .topbar h1 { font-size: 19px; }
    .topbar .btn { width: 100%; }
    .card { padding: 16px; }
    .row { flex-direction: column; }
    .field-code { flex: 1; }
    .form input, .form select { font-size: 16px; padding: 12px 14px; }
    .filters { flex-direction: column; }
    .filters input, .filters select { min-width: 100%; font-size: 16px; padding: 12px 14px; }
    .clients-grid { grid-template-columns: 1fr; gap: 12px; }
    .client-card { padding: 16px; }
    .client-name { font-size: 16px; }
    .client-actions .btn { padding: 11px; font-size: 14px; }
    .btn:hover { transform: none; }
}

/* ===== موبايل صغير (iPhone mini وأشباهه) ===== */
@media (max-width: 380px) {
    body { padding: 8px; }
    .topbar { padding: 14px 12px; }
    .card { padding: 14px 12px; }
    .client-header { flex-direction: column; }
    .badge { align-self: flex-start; }
}