@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

:root {
    --bg-page: #f0f6ff;
    --bg-card: #ffffff;
    --bg-soft: #e8f1ff;
    --border: #d7e4f8;
    --primary: #1d63ed;
    --primary-dark: #154cc0;
    --primary-light: #eff6ff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --radius: 14px;
    --shadow: 0 6px 24px -6px rgba(29, 99, 237, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Vazirmatn', Tahoma, Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    direction: rtl;
    line-height: 1.65;
    font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }

/* Layout */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: #ffffff;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 20;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 17px;
    flex-shrink: 0;
}

.brand-title { font-weight: 800; font-size: 15px; color: #0f3d91; }
.brand-sub { font-size: 11px; color: var(--text-muted); }

.nav-list { list-style: none; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.nav-btn {
    width: 100%;
    text-align: right;
    background: transparent;
    border: none;
    padding: 11px 14px;
    border-radius: 11px;
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.nav-btn:hover { background: var(--primary-light); color: var(--primary); }
.nav-btn.active { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -4px rgba(29, 99, 237, 0.4); }

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
}

.admin-chip {
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.admin-chip .name { font-weight: 700; font-size: 13px; color: #0f3d91; }
.admin-chip .role { font-size: 11px; color: var(--text-muted); }

.main-area { flex: 1; padding: 24px 28px; min-width: 0; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 22px;
}

.page-title { font-size: 21px; font-weight: 800; color: #0f3d91; }

/* Cards & Grids */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}
.kpi-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.kpi-value { font-size: 24px; font-weight: 800; color: #0f3d91; }
.kpi-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title { font-size: 16px; font-weight: 800; color: #0f3d91; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-soft { background: var(--primary-light); color: var(--primary); border-color: var(--border); }
.btn-soft:hover { background: #dbeafe; }
.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: #fecaca; }
.btn-success { background: var(--success-bg); color: var(--success); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-group label { font-size: 12.5px; font-weight: 700; color: #334155; }

.input, select.input, textarea.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #f8fbff;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(29, 99, 237, 0.15); background: #fff; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { padding: 11px 12px; text-align: right; border-bottom: 1px solid #e6eefc; font-size: 13px; }
th { background: #f3f7ff; color: #0f3d91; font-weight: 800; white-space: nowrap; }
tr:hover td { background: #f9fbff; }

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-amber { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: #e2e8f0; color: #475569; }

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    background: var(--primary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary);
}

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.pill-group { display: inline-flex; background: var(--primary-light); padding: 4px; border-radius: 12px; border: 1px solid var(--border); gap: 4px; }
.pill-btn { border: none; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; color: #334155; cursor: pointer; }
.pill-btn.active { background: var(--primary); color: #fff; }

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 45, 105, 0.35);
    backdrop-filter: blur(3px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 18px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 22px;
    box-shadow: 0 20px 50px rgba(15, 61, 145, 0.2);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 24px;
    background: #0f3d91;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(15, 61, 145, 0.3);
    z-index: 200;
    display: none;
    font-weight: 600;
}
.toast.show { display: block; }

.section-view { display: none; }
.section-view.active { display: block; }

.stars { color: #f59e0b; letter-spacing: 1px; }

/* Login Page */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at top right, #dbeafe, #f0f6ff 55%, #ffffff);
}
.login-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px;
    width: 100%;
    max-width: 410px;
    box-shadow: 0 18px 45px -10px rgba(29, 99, 237, 0.18);
}

/* Customer Mobile View */
.customer-wrap {
    min-height: 100vh;
    background: linear-gradient(180deg, #dbeafe 0%, #f0f6ff 35%, #ffffff 100%);
    padding: 20px 14px 40px;
    display: flex;
    justify-content: center;
}
.customer-card {
    width: 100%;
    max-width: 460px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 18px 45px -12px rgba(29, 99, 237, 0.18);
    overflow: hidden;
}
.customer-hero {
    background: linear-gradient(135deg, #1d63ed, #0ea5e9);
    color: #fff;
    padding: 22px 20px;
    text-align: center;
}
.customer-body { padding: 20px; }

.tech-profile-box {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 16px;
}
.tech-photo-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(29, 99, 237, 0.2);
    background: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
}
.otp-box {
    background: #eff6ff;
    border: 2px dashed #60a5fa;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    margin: 16px 0;
}
.otp-digits {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 8px;
    color: #1d4ed8;
    margin-top: 4px;
}

.star-picker { display: flex; justify-content: center; gap: 8px; flex-direction: row-reverse; margin: 12px 0; }
.star-picker button {
    background: none;
    border: none;
    font-size: 34px;
    color: #cbd5e1;
    cursor: pointer;
    transition: transform 0.15s, color 0.15s;
}
.star-picker button.active, .star-picker button:hover { color: #f59e0b; transform: scale(1.12); }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #f8fbff;
    color: #334155;
    font-size: 12.5px;
    cursor: pointer;
}
.tag-chip.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; border-left: none; border-bottom: 1px solid var(--border); }
    .nav-list { flex-direction: row; flex-wrap: wrap; }
    .nav-btn { width: auto; }
    .main-area { padding: 16px; }
}
