/* ============================================
   باجه - استایل یکپارچه
   مدیریت ساختمان با کمتر از یک دقیقه در روز
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --secondary: #34a853;
    --danger: #ea4335;
    --warning: #fbbc04;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-400: #bdc1c6;
    --gray-500: #9aa0a6;
    --gray-600: #80868b;
    --gray-700: #5f6368;
    --gray-800: #3c4043;
    --gray-900: #202124;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'IRANSans', 'Vazir', 'Tahoma', 'Arial', sans-serif;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-900);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
    margin-bottom: 0.75rem;
    color: var(--gray-700);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

.ltr {
    direction: ltr !important;
    text-align: left !important;
}

.ltr input,
.ltr .otp-input {
    direction: ltr !important;
    text-align: center !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

.container-lg {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

/* ============================================
   هدر
   ============================================ */

.header {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.logo span {
    color: var(--gray-900);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header-actions .user-info {
    font-size: 0.9rem;
    color: var(--gray-700);
}

.header-actions .user-info strong {
    color: var(--gray-900);
}

.building-selector {
    position: relative;
}

.building-selector select {
    padding: 8px 36px 8px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-xs);
    background: var(--white);
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--gray-900);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    cursor: pointer;
    min-width: 140px;
    max-width: 220px;
    transition: var(--transition);
}

.building-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.btn-logout {
    padding: 6px 16px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 0.85rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-logout:hover {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

/* ============================================
   دکمه‌ها
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    min-height: 48px;
    min-width: 48px;
    user-select: none;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
}

.btn-success {
    background: var(--secondary);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #2d9249;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover:not(:disabled) {
    background: #d33426;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: var(--warning);
    color: var(--gray-900);
}

.btn-warning:hover:not(:disabled) {
    background: #e5a800;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: var(--white);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
    min-height: 56px;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
    min-height: 36px;
}

.btn-block {
    width: 100%;
    display: flex;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
}

/* ============================================
   کارت‌ها
   ============================================ */

.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.card-body {
    padding: 0;
}

.card-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}

/* ============================================
   فرم‌ها
   ============================================ */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--gray-700);
}

.form-label .required {
    color: var(--danger);
    margin-right: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 1rem;
    color: var(--gray-900);
    background: var(--white);
    transition: var(--transition);
    min-height: 48px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.form-control.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.12);
}

.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.form-control::placeholder {
    color: var(--gray-500);
}

.form-text, .form-hint {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-top: 4px;
}

.form-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 4px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 36px;
}

.form-row, .form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* ============================================
   جدول‌ها
   ============================================ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 600;
    padding: 10px 14px;
    text-align: right;
    border-bottom: 2px solid var(--gray-200);
}

.table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.table tr:hover td {
    background: var(--gray-50);
}

.table .actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.table .actions .btn-sm {
    padding: 4px 12px;
    font-size: 0.75rem;
    min-height: 30px;
}

/* ============================================
   هشدارها
   ============================================ */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border-right: 4px solid transparent;
    font-size: 0.95rem;
}

.alert-success {
    background: #e6f4ea;
    border-color: var(--secondary);
    color: #1e7e34;
}

.alert-danger {
    background: #fce8e6;
    border-color: var(--danger);
    color: #c62828;
}

.alert-warning {
    background: #fef7e0;
    border-color: var(--warning);
    color: #8d6e00;
}

.alert-info {
    background: #e8f0fe;
    border-color: var(--primary);
    color: #1a56a5;
}

/* ============================================
   گرید داشبورد
   ============================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 4px;
}

.stat-card .stat-number.danger { color: var(--danger); }
.stat-card .stat-number.success { color: var(--secondary); }
.stat-card .stat-number.warning { color: var(--warning); }

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--gray-600);
}

.stat-card .stat-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 20px 0;
}

.actions-grid .btn {
    padding: 16px;
    font-size: 0.95rem;
    min-height: 64px;
    flex-direction: column;
    border-radius: var(--radius);
}

.actions-grid .btn .icon {
    font-size: 1.5rem;
}

/* ============================================
   صفحه ورود
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f0fe 0%, #f8f9fa 100%);
    padding: 20px;
}

.login-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-xl);
}

.login-box .logo {
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1.6rem;
}

.login-box .subtitle {
    text-align: center;
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 28px;
}

.login-box .otp-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 16px 0;
}

.login-box .otp-group input {
    width: 50px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-xs);
    background: var(--white);
    transition: var(--transition);
    font-family: 'Courier New', monospace;
}

.login-box .otp-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    outline: none;
}

.login-box .otp-group input.filled {
    border-color: var(--secondary);
}

.login-box .mobile-input {
    direction: ltr;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.login-box .btn {
    margin-top: 8px;
}

.login-box .resend-link {
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
}

.login-box .resend-link a {
    color: var(--primary);
    cursor: pointer;
}

.login-box .resend-link a:hover {
    text-decoration: underline;
}

/* ============================================
   لیست فعالیت‌ها
   ============================================ */

.activity-list {
    list-style: none;
    padding: 0;
}

.activity-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.activity-list li:last-child {
    border-bottom: none;
}

.activity-list .activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.activity-list .activity-icon.payment { background: #e6f4ea; color: var(--secondary); }
.activity-list .activity-icon.expense { background: #fce8e6; color: var(--danger); }
.activity-list .activity-icon.announcement { background: #e8f0fe; color: var(--primary); }
.activity-list .activity-icon.maintenance { background: #fef7e0; color: var(--warning); }

.activity-list .activity-text { flex: 1; }
.activity-list .activity-date {
    font-size: 0.75rem;
    color: var(--gray-500);
    white-space: nowrap;
}

/* ============================================
   وضعیت‌ها
   ============================================ */

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-new { background: #e8f0fe; color: var(--primary); }
.badge-reviewing { background: #fef7e0; color: #8d6e00; }
.badge-repairing { background: #fce8e6; color: #c62828; }
.badge-done { background: #e6f4ea; color: #1e7e34; }
.badge-rejected { background: var(--gray-200); color: var(--gray-700); }
.badge-paid { background: #e6f4ea; color: #1e7e34; }
.badge-unpaid { background: #fce8e6; color: #c62828; }
.badge-pending { background: #fef7e0; color: #8d6e00; }

.unit-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   مدال
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header .modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* ============================================
   PWA Shortcut
   ============================================ */

.pwa-install {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 50;
    max-width: 320px;
}

.pwa-install.active {
    display: flex;
}

.pwa-install .pwa-icon { font-size: 1.5rem; }
.pwa-install .pwa-text {
    font-size: 0.85rem;
    color: var(--gray-700);
    flex: 1;
}

.pwa-install .pwa-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--gray-500);
    padding: 4px;
}

/* ============================================
   فوتر
   ============================================ */

.footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 16px 0;
    margin-top: auto;
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* ============================================
   ابزارک‌ها
   ============================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mx-auto { margin-left: auto; margin-right: auto; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-xs { border-radius: var(--radius-xs); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-sm { box-shadow: var(--shadow-sm); }

.hidden { display: none !important; }
.block { display: block !important; }

.text-muted { color: var(--gray-600); }
.text-primary { color: var(--primary); }
.text-success { color: var(--secondary); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* ============================================
   نشانگر مراحل
   ============================================ */

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.step-indicator .step {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.step-indicator .step .num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--gray-600);
}

.step-indicator .step.active .num {
    background: var(--primary);
    color: var(--white);
}

.step-indicator .step.active {
    color: var(--gray-900);
    font-weight: 600;
}

.step-indicator .step.done .num {
    background: var(--secondary);
    color: var(--white);
}

.step-indicator .line {
    width: 30px;
    height: 2px;
    background: var(--gray-300);
}

.step-indicator .line.done {
    background: var(--secondary);
}

/* ============================================
   کمکی‌های اختصاصی
   ============================================ */

.building-info-bar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.building-info-bar .building-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.building-info-bar .building-manager {
    font-size: 0.9rem;
    opacity: 0.9;
}

.insurance-warning {
    background: #fef7e0;
    border-right: 4px solid var(--warning);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #8d6e00;
    display: flex;
    align-items: center;
    gap: 10px;
}

.insurance-warning.danger {
    background: #fce8e6;
    border-color: var(--danger);
    color: #c62828;
}

.percent-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.percent-bar .fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 16px 0 20px 0;
}

.quick-actions .action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-900);
    transition: var(--transition);
    gap: 8px;
    min-height: 100px;
    cursor: pointer;
}

.quick-actions .action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.quick-actions .action-btn .icon { font-size: 2rem; }
.quick-actions .action-btn .label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.quick-actions .action-btn.primary .icon { color: var(--primary); }
.quick-actions .action-btn.success .icon { color: var(--secondary); }
.quick-actions .action-btn.danger .icon { color: var(--danger); }
.quick-actions .action-btn.warning .icon { color: var(--warning); }

.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state .icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.empty-state .title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.empty-state .desc {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.debt-summary {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.debt-summary .total-debt {
    font-size: 1.4rem;
    font-weight: 700;
}

.debt-summary .total-debt .amount { color: var(--danger); }
.debt-summary .total-debt .amount.zero { color: var(--secondary); }

.debt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
}

.debt-item:last-child { border-bottom: none; }

.debt-item .debt-info { flex: 1; }
.debt-item .debt-info .title {
    font-weight: 600;
    font-size: 0.9rem;
}
.debt-item .debt-info .meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}
.debt-item .debt-amount {
    font-weight: 700;
    color: var(--danger);
    margin: 0 12px;
    white-space: nowrap;
}
.debt-item .btn-pay {
    min-height: 36px;
    padding: 4px 16px;
    font-size: 0.8rem;
}

.manual-amounts {
    margin-top: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}

.manual-amounts .unit-row {
    display: grid;
    grid-template-columns: 120px 1fr 120px;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.manual-amounts .unit-row:last-child { border-bottom: none; }

.manual-amounts .unit-row .unit-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.manual-amounts .unit-row input,
.manual-amounts .unit-row select {
    padding: 6px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
    width: 100%;
}

.manual-amounts .unit-row input { direction: ltr; text-align: right; }

.manual-amounts .unit-row input:focus,
.manual-amounts .unit-row select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}

.total-amount-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: var(--radius-xs);
    margin: 12px 0;
    text-align: center;
}

.distribution-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 16px 0;
}

.distribution-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.distribution-options label:hover { border-color: var(--gray-400); }
.distribution-options input[type="radio"] { display: none; }
.distribution-options label.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ============================================
   پاسخ‌گو
   ============================================ */

@media (max-width: 992px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    .form-row, .form-row-2 { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr 1fr; }
    .dashboard-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
    .actions-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}

@media (max-width: 576px) {
    body { font-size: 14px; }
    .container { padding: 0 12px; }
    .header { padding: 8px 0; }
    .header-inner { flex-direction: column; align-items: stretch; gap: 8px; }
    .logo { font-size: 1.1rem; justify-content: center; }
    .logo-icon { width: 32px; height: 32px; font-size: 1rem; }
    .header-actions { flex-wrap: wrap; justify-content: center; }
    .building-selector select {
        min-width: 100px;
        max-width: 100%;
        font-size: 0.8rem;
        padding: 6px 30px 6px 10px;
    }
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-height: 40px;
    }
    .btn-lg { padding: 10px 20px; font-size: 1rem; min-height: 48px; }
    .card { padding: 14px; }
    .login-box { padding: 24px 16px; margin: 10px; }
    .login-box .logo { font-size: 1.3rem; }
    .login-box .otp-group input { width: 40px; height: 48px; font-size: 1.2rem; }
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-card .stat-number { font-size: 1.4rem; }
    .actions-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .actions-grid .btn { padding: 12px; font-size: 0.8rem; min-height: 56px; }
    .actions-grid .btn .icon { font-size: 1.2rem; }
    .form-row-3 { grid-template-columns: 1fr; }
    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 6px 10px; }
    .table .actions .btn-sm { padding: 2px 8px; font-size: 0.7rem; min-height: 26px; }
    .modal { padding: 20px 16px; margin: 10px; }
    .pwa-install {
        left: 10px; right: 10px; bottom: 10px;
        max-width: none; padding: 12px 16px;
        flex-wrap: wrap; justify-content: center;
    }
    .manual-amounts .unit-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px 0;
    }
    .distribution-options { flex-direction: column; }
    .distribution-options label { width: 100%; }
    .debt-item { flex-wrap: wrap; gap: 6px; padding: 10px; }
    .debt-item .debt-amount { margin: 0 4px; font-size: 0.9rem; }
    .debt-item .btn-pay { width: 100%; margin-top: 4px; }
}

@media (max-width: 400px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .stat-card { padding: 10px; }
    .stat-card .stat-number { font-size: 1.1rem; }
    .actions-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
    .login-box .otp-group input { width: 34px; height: 42px; font-size: 1rem; }
}

@media print {
    .header, .footer, .no-print { display: none !important; }
    body { background: white; font-size: 12px; }
    .card { box-shadow: none !important; border: 1px solid #ddd; }
    .btn { display: none !important; }
    .table th { background: #f0f0f0 !important; }
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-500); }

::selection {
    background: var(--primary);
    color: var(--white);
}

.fade-in { animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.shake { animation: shake 0.4s ease; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.spin { animation: spin 1s linear infinite; }

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}