@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================================================
   Ghasedak BMCS — App Framework CSS
   Modern, professional, RTL, orange-branded dashboard UI
   ========================================================================== */

:root {
    /* Brand */
    --gk-brand: #f97316;
    --gk-brand-dark: #ea580c;
    --gk-brand-light: #fb923c;
    --gk-brand-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --gk-brand-gradient-soft: linear-gradient(135deg, rgba(249,115,22,0.12) 0%, rgba(234,88,12,0.06) 100%);
    --gk-brand-shadow: 0 4px 20px rgba(249,115,22,0.25);
    --gk-brand-shadow-lg: 0 8px 40px rgba(249,115,22,0.35);

    /* Neutrals */
    --gk-bg: #f8fafc;
    --gk-surface: #ffffff;
    --gk-surface-2: #f1f5f9;
    --gk-sidebar-bg: #1e293b;
    --gk-sidebar-bg-2: #0f172a;
    --gk-sidebar-text: #cbd5e1;
    --gk-sidebar-text-active: #ffffff;
    --gk-sidebar-hover: rgba(249,115,22,0.15);
    --gk-sidebar-active: var(--gk-brand-gradient);

    /* Text */
    --gk-text: #1e293b;
    --gk-text-muted: #64748b;
    --gk-text-light: #94a3b8;

    /* Borders */
    --gk-border: #e2e8f0;
    --gk-border-strong: #cbd5e1;

    /* Status */
    --gk-success: #16a34a;
    --gk-success-bg: #dcfce7;
    --gk-warning: #d97706;
    --gk-warning-bg: #fef3c7;
    --gk-danger: #dc2626;
    --gk-danger-bg: #fee2e2;
    --gk-info: #0891b2;
    --gk-info-bg: #cffafe;

    /* Layout */
    --gk-sidebar-w: 270px;
    --gk-sidebar-w-collapsed: 72px;
    --gk-topbar-h: 64px;
    --gk-radius: 14px;
    --gk-radius-sm: 10px;
    --gk-radius-lg: 20px;

    /* Shadows */
    --gk-shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --gk-shadow: 0 4px 16px rgba(0,0,0,0.08);
    --gk-shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --gk-shadow-xl: 0 24px 60px rgba(0,0,0,0.16);

    /* Transitions */
    --gk-t: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
.gk-app * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.gk-app {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    direction: rtl;
    background: var(--gk-bg);
    color: var(--gk-text);
    line-height: 1.7;
    font-size: 14px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.gk-app a { color: var(--gk-brand-dark); text-decoration: none; transition: var(--gk-t); }
.gk-app a:hover { color: var(--gk-brand); }
.gk-app img { max-width: 100%; height: auto; }
.gk-app ul, .gk-app ol { list-style: none; }

/* اطمینان از اینکه دکمه‌های رندرشده به‌صورت <a> هم رنگ کلاس دکمه را نگه می‌دارند
   و توسط قانون کلی .gk-app a override نمی‌شوند (v2.3.0). */
.gk-app a.gk-btn { color: inherit; }
.gk-app a.gk-btn:hover { color: inherit; }

.gk-app h1, .gk-app h2, .gk-app h3, .gk-app h4 {
    font-weight: 700;
    line-height: 1.4;
    color: var(--gk-text);
}
.gk-app h1 { font-size: 1.6rem; }
.gk-app h2 { font-size: 1.3rem; }
.gk-app h3 { font-size: 1.1rem; }
.gk-app h4 { font-size: 1rem; }

/* ==========================================================================
   Portal Page (Login/Register selection)
   ========================================================================== */
.gk-portal {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.gk-portal::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(249,115,22,0.15) 0%, transparent 70%);
    border-radius: 50%;
}
.gk-portal::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(249,115,22,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.gk-portal-inner {
    position: relative;
    z-index: 1;
    max-width: 920px;
    width: 100%;
    text-align: center;
}

.gk-portal-logo {
    margin-bottom: 16px;
}
.gk-portal-logo svg, .gk-portal-logo img {
    height: 64px;
    width: auto;
}

.gk-portal-title {
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.gk-portal-subtitle {
    color: #94a3b8;
    font-size: 1.05rem;
    margin-bottom: 48px;
}

.gk-portal-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-bottom: 32px;
}
@media (max-width: 720px) {
    .gk-portal-cards { grid-template-columns: 1fr; }
}

.gk-portal-card {
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--gk-radius-lg);
    padding: 40px 32px;
    cursor: pointer;
    transition: var(--gk-t);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.gk-portal-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gk-brand-gradient);
    opacity: 0;
    transition: var(--gk-t);
    z-index: 0;
}
.gk-portal-card > * { position: relative; z-index: 1; }
.gk-portal-card:hover {
    transform: translateY(-6px);
    border-color: var(--gk-brand);
    box-shadow: var(--gk-brand-shadow-lg);
}
.gk-portal-card:hover::before { opacity: 0.08; }

.gk-portal-card-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 20px;
    background: var(--gk-brand-gradient);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--gk-brand-shadow);
    transition: var(--gk-t);
}
.gk-portal-card:hover .gk-portal-card-icon {
    transform: scale(1.1) rotate(-5deg);
}
.gk-portal-card-icon svg {
    width: 48px;
    height: 48px;
    color: #fff;
    stroke: #fff;
    fill: none;
}

.gk-portal-card-title {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.gk-portal-card-desc {
    color: #94a3b8;
    font-size: 0.95rem;
}

.gk-portal-footer {
    color: #64748b;
    font-size: 0.85rem;
}
.gk-portal-footer a { color: var(--gk-brand-light); }

/* ==========================================================================
   Modal
   ========================================================================== */
.gk-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: gk-fade-in 0.25s ease;
}
.gk-modal-overlay.is-open { display: flex; }

.gk-modal {
    background: var(--gk-surface);
    border-radius: var(--gk-radius-lg);
    width: 100%;
    max-width: 460px;
    box-shadow: var(--gk-shadow-xl);
    animation: gk-slide-up 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.gk-modal-header {
    background: var(--gk-brand-gradient);
    padding: 28px 32px 24px;
    text-align: center;
    color: #fff;
    position: relative;
}
.gk-modal-header-icon {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}
.gk-modal-header-icon svg { width: 32px; height: 32px; color: #fff; }
.gk-modal-header h3 { color: #fff; font-size: 1.35rem; font-weight: 700; }
.gk-modal-header p { color: rgba(255,255,255,0.85); font-size: 0.9rem; margin-top: 4px; }

.gk-modal-close {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--gk-t);
}
.gk-modal-close:hover { background: rgba(255,255,255,0.35); }

.gk-modal-body {
    padding: 28px 32px;
}

.gk-modal-footer {
    padding: 16px 32px 28px;
    text-align: center;
    border-top: 1px solid var(--gk-border);
    background: var(--gk-surface-2);
}

/* ==========================================================================
   Forms — Minimal style (v2.3.0)
   - فاصله‌ی 17px بین فیلدها (margin-bottom + grid gap)
   - کادر نازک خاکستری روشن (1px) #e5e7eb
   - لیبل خاکستری تیره (#334155)
   - لبه‌ی گرد (10px)
   ========================================================================== */
.gk-field {
    margin-bottom: 17px;
}
.gk-field label {
    display: block;
    font-weight: 600;
    color: #334155;
    margin-bottom: 7px;
    font-size: 0.88rem;
}
.gk-field label .req { color: var(--gk-danger); margin-right: 2px; }
.gk-field .gk-hint { font-size: 0.78rem; color: var(--gk-text-muted); margin-top: 5px; }

.gk-input, .gk-select, .gk-textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--gk-text);
    background: var(--gk-surface);
    transition: var(--gk-t);
    outline: none;
}
.gk-input:focus, .gk-select:focus, .gk-textarea:focus {
    border-color: var(--gk-brand);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.10);
}
.gk-input::placeholder { color: var(--gk-text-light); }
.gk-textarea { min-height: 90px; resize: vertical; }

.gk-input-group {
    position: relative;
}
.gk-input-group .gk-input-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gk-text-light);
    pointer-events: none;
}
.gk-input-group.has-icon .gk-input { padding-right: 38px; }

.gk-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 17px;
}
.gk-checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--gk-brand);
    cursor: pointer;
}
.gk-checkbox-row label { cursor: pointer; margin: 0; font-weight: 400; }

/* grid gap استاندارد ۱۷px */
.gk-grid { gap: 17px; }
.gk-grid-2, .gk-grid-3, .gk-grid-4 { gap: 17px; }

/* ==========================================================================
   Buttons — Standard system (v2.3.0)
   ۴ سبک استاندارد: primary / secondary / ghost / danger
   + gk-btn-icon برای دکمه‌های فقط‌آیکون (بدون باکس)
   + gk-btn-modal برای دکمه‌های داخل مودال/فرم (وسط‌چین، ۳۲px، ۷۵٪ عرض)
   همه‌ی رنگ‌های متن با !important تا توسط قالب/پلاگین خارجی override نشوند.
   ========================================================================== */
.gk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--gk-t);
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    line-height: 1.4;
}
.gk-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Primary — نارنجی + متن سفید */
.gk-btn-primary {
    background: var(--gk-brand-gradient) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22) !important;
    box-shadow: 0 2px 8px rgba(249,115,22,0.25);
    border: 1px solid var(--gk-brand-dark) !important;
}
.gk-btn-primary:hover {
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(249,115,22,0.35);
}
.gk-btn-primary:active {
    background: #c2410c !important;
    color: #ffffff !important;
    transform: translateY(0);
}

/* Secondary — سفید + حاشیه نارنجی + متن نارنجی تیره */
.gk-btn-secondary {
    background: var(--gk-surface) !important;
    color: var(--gk-brand-dark) !important;
    border: 1px solid var(--gk-brand) !important;
    text-shadow: none !important;
}
.gk-btn-secondary:hover {
    background: var(--gk-brand) !important;
    color: #ffffff !important;
    border-color: var(--gk-brand-dark) !important;
}
.gk-btn-secondary:active {
    background: var(--gk-brand-dark) !important;
    color: #ffffff !important;
}

/* Ghost — بدون حاشیه، فقط آیکون/متن (برای دکمه‌های جدول) */
.gk-btn-ghost {
    background: transparent !important;
    color: var(--gk-text-muted) !important;
    border: none !important;
    padding: 6px 8px;
    min-height: auto;
    text-shadow: none !important;
}
.gk-btn-ghost:hover {
    background: var(--gk-surface-2) !important;
    color: var(--gk-brand-dark) !important;
    text-decoration: none;
}
.gk-btn-ghost:active {
    background: var(--gk-surface-2) !important;
    color: var(--gk-brand-dark) !important;
}

/* Icon-only — فقط آیکون، بدون باکس/حاشیه (مثل دکمه ویرایش در جدول) */
.gk-btn-icon {
    background: transparent !important;
    color: var(--gk-text-muted) !important;
    border: none !important;
    padding: 6px !important;
    min-height: auto !important;
    min-width: auto !important;
    border-radius: 8px;
    line-height: 1;
    box-shadow: none !important;
    text-shadow: none !important;
}
.gk-btn-icon:hover {
    background: transparent !important;
    color: var(--gk-brand-dark) !important;
    transform: scale(1.12);
}
.gk-btn-icon:active {
    background: transparent !important;
    color: var(--gk-brand-dark) !important;
}
.gk-btn-icon svg { width: 18px; height: 18px; }

/* Danger — قرمز + متن سفید */
.gk-btn-danger {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18) !important;
}
.gk-btn-danger:hover { background: #b91c1c !important; color: #ffffff !important; border-color: #b91c1c !important; }
.gk-btn-danger:active { background: #991b1b !important; color: #ffffff !important; }

.gk-btn-sm { padding: 6px 12px; min-height: 30px; font-size: 0.82rem; }
.gk-btn-sm svg { width: 14px; height: 14px; }
.gk-btn-lg { padding: 12px 28px; min-height: 46px; font-size: 1rem; }
.gk-btn-xl { padding: 14px 36px; min-height: 52px; font-size: 1.05rem; }
.gk-btn-block { width: 100%; }
.gk-btn:disabled,
.gk-btn[disabled] {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    border-color: #e5e7eb !important;
    text-shadow: none !important;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
    transform: none;
}

/* ==========================================================================
   Modal/Form Action Buttons (v2.3.0)
   در تمام مودال‌ها و فرم‌ها دکمه‌های ثبت/بستن:
   - وسط‌چین (margin: 0 auto)
   - ارتفاع ۳۲px
   - لبه‌های گرد (10px)
   - عرض ۷۵٪
   ========================================================================== */
.gk-btn-modal,
.gk-modal-body button[type="submit"],
.gk-modal-body .gk-ajax-form button[type="submit"],
.gk-modal-body .gk-btn-close {
    display: block !important;
    margin: 18px auto 4px !important;
    width: 75% !important;
    min-height: 32px !important;
    padding: 6px 18px !important;
    border-radius: 10px !important;
    font-size: 0.92rem !important;
    text-align: center !important;
}
.gk-modal-body .gk-modal-footer .gk-btn {
    display: block !important;
    margin: 10px auto 4px !important;
    width: 75% !important;
    min-height: 32px !important;
    padding: 6px 18px !important;
    border-radius: 10px !important;
    font-size: 0.92rem !important;
    text-align: center !important;
}

/* ==========================================================================
   App Shell — Sidebar + Topbar + Content
   ========================================================================== */
.gk-app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.gk-sidebar {
    width: var(--gk-sidebar-w);
    background: var(--gk-sidebar-bg);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: var(--gk-sidebar-text);
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}
.gk-sidebar::-webkit-scrollbar { width: 6px; }
.gk-sidebar::-webkit-scrollbar-track { background: transparent; }
.gk-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.gk-sidebar-brand {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    min-height: var(--gk-topbar-h);
}
.gk-sidebar-brand-logo {
    width: 40px;
    height: 40px;
    background: var(--gk-brand-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--gk-brand-shadow);
}
.gk-sidebar-brand-logo svg { width: 24px; height: 24px; color: #fff; }
.gk-sidebar-brand-text { font-size: 1.05rem; font-weight: 800; color: #fff; line-height: 1.3; }
.gk-sidebar-brand-text small { display: block; font-size: 0.7rem; font-weight: 400; color: #94a3b8; }

/* §4-A — small version badge next to the sidebar brand (uses Core's own version). */
.gk-sidebar-brand-version {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.gk-app.is-collapsed .gk-sidebar-brand-version { display: none; }

.gk-sidebar-section {
    padding: 12px 16px 4px;
}
.gk-sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.08em;
    padding: 8px 12px;
}

.gk-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    color: var(--gk-sidebar-text);
    text-decoration: none;
    border-radius: var(--gk-radius-sm);
    margin: 2px 8px;
    transition: var(--gk-t);
    font-weight: 500;
    font-size: 0.92rem;
    cursor: pointer;
    position: relative;
}
.gk-nav-item svg { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.8; }
.gk-nav-item:hover {
    background: var(--gk-sidebar-hover);
    color: #fff;
}
.gk-nav-item:hover svg { opacity: 1; }
.gk-nav-item.is-active {
    background: var(--gk-brand-gradient);
    color: #fff;
    box-shadow: var(--gk-brand-shadow);
}
.gk-nav-item.is-active svg { opacity: 1; }
.gk-nav-item .gk-nav-badge {
    margin-right: auto;
    background: var(--gk-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}
.gk-nav-item.is-active .gk-nav-badge { background: rgba(255,255,255,0.25); }

.gk-sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* Collapse toggle button (desktop icon-only mode) */
.gk-sidebar-collapse-btn {
    margin-right: auto;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #94a3b8;
    cursor: pointer;
    transition: var(--gk-t);
    padding: 0;
}
.gk-sidebar-collapse-btn:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}
.gk-sidebar-collapse-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}
/* RTL: in expanded state the chevron points left (toward sidebar edge) */
.gk-sidebar-collapse-btn svg { transform: rotate(90deg); }

/* Collapsed sidebar state — applied on .gk-app.is-collapsed */
.gk-app.is-collapsed .gk-sidebar { width: var(--gk-sidebar-w-collapsed); }
.gk-app.is-collapsed .gk-main { margin-right: var(--gk-sidebar-w-collapsed); }
.gk-app.is-collapsed .gk-sidebar-brand {
    padding: 20px 0;
    justify-content: center;
    gap: 0;
    position: relative;
}
.gk-app.is-collapsed .gk-sidebar-brand-logo { margin: 0 auto; }
.gk-app.is-collapsed .gk-sidebar-brand-text { display: none; }
.gk-app.is-collapsed .gk-sidebar-collapse-btn {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.04);
}
.gk-app.is-collapsed .gk-sidebar-collapse-btn svg { transform: rotate(-90deg); }

.gk-app.is-collapsed .gk-sidebar-section { padding: 8px 0; }
.gk-app.is-collapsed .gk-sidebar-section-title { display: none; }
.gk-app.is-collapsed .gk-nav-item {
    justify-content: center;
    padding: 11px 0;
    margin: 2px 8px;
    border-radius: var(--gk-radius-sm);
}
.gk-app.is-collapsed .gk-nav-item span { display: none; }
.gk-app.is-collapsed .gk-nav-item .gk-nav-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    margin: 0;
    padding: 1px 5px;
    font-size: 0.62rem;
    min-width: 16px;
}
.gk-app.is-collapsed .gk-sidebar-footer { padding: 8px 0; }
.gk-app.is-collapsed .gk-sidebar-footer .gk-nav-item {
    justify-content: center;
    padding: 11px 0;
}
.gk-app.is-collapsed .gk-sidebar-footer .gk-nav-item span { display: none; }

/* Tooltip for icon-only mode */
.gk-app.is-collapsed .gk-nav-item[data-view]:hover::after,
.gk-app.is-collapsed .gk-sidebar-footer .gk-nav-item:hover::after {
    content: attr(data-title);
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 200;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: none;
}

/* Main area */
.gk-main {
    flex: 1;
    margin-right: var(--gk-sidebar-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin 0.3s ease;
}

/* Topbar */
.gk-topbar {
    height: var(--gk-topbar-h);
    background: var(--gk-surface);
    border-bottom: 1px solid var(--gk-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--gk-shadow-sm);
}

.gk-topbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--gk-text);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
}
.gk-topbar-toggle:hover { background: var(--gk-surface-2); }
.gk-topbar-toggle svg { width: 24px; height: 24px; }

.gk-topbar-title {
    flex: 1;
    min-width: 0;
}
.gk-topbar-title h1 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}
.gk-topbar-title .breadcrumb {
    font-size: 0.8rem;
    color: var(--gk-text-muted);
    margin-top: 2px;
}

.gk-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Complex selector */
.gk-complex-selector {
    position: relative;
}
.gk-complex-selector-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--gk-surface-2);
    border: 1px solid var(--gk-border);
    border-radius: var(--gk-radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--gk-text);
    transition: var(--gk-t);
}
.gk-complex-selector-btn:hover { border-color: var(--gk-brand); }
.gk-complex-selector-btn svg { width: 18px; height: 18px; color: var(--gk-brand); }

/* Role switcher */
.gk-role-switcher {
    position: relative;
}
.gk-role-switcher-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--gk-brand-gradient-soft);
    border: 2px solid var(--gk-brand);
    border-radius: var(--gk-radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--gk-brand-dark);
    transition: var(--gk-t);
}
.gk-role-switcher-btn:hover { box-shadow: var(--gk-brand-shadow); }
.gk-role-switcher-btn svg { width: 18px; height: 18px; }
.gk-role-switcher-btn .arrow { margin-right: 4px; }

.gk-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: var(--gk-surface);
    border: 1px solid var(--gk-border);
    border-radius: var(--gk-radius);
    box-shadow: var(--gk-shadow-lg);
    padding: 8px;
    display: none;
    z-index: 200;
}
.gk-dropdown.is-open { display: block; animation: gk-slide-down 0.2s ease; }

.gk-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--gk-radius-sm);
    cursor: pointer;
    color: var(--gk-text);
    transition: var(--gk-t);
    font-weight: 500;
    font-size: 0.9rem;
}
.gk-dropdown-item:hover { background: var(--gk-surface-2); }
.gk-dropdown-item.is-active {
    background: var(--gk-brand-gradient-soft);
    color: var(--gk-brand-dark);
    font-weight: 700;
}
.gk-dropdown-item svg { width: 20px; height: 20px; }
.gk-dropdown-item .check { margin-right: auto; color: var(--gk-brand); }

/* User menu */
.gk-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--gk-surface-2);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--gk-t);
    border: 1px solid var(--gk-border);
}
.gk-user-menu:hover { border-color: var(--gk-brand); }
.gk-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gk-brand-gradient);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.gk-user-menu-info { font-size: 0.82rem; line-height: 1.3; }
.gk-user-menu-info strong { display: block; font-weight: 700; color: var(--gk-text); }
.gk-user-menu-info span { color: var(--gk-text-muted); font-size: 0.75rem; }

/* Content area */
.gk-content {
    flex: 1;
    padding: 28px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .gk-content { padding: 16px; }
}

.gk-content-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.gk-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}
.gk-page-header h2 { font-size: 1.4rem; font-weight: 800; }
.gk-page-header .desc { color: var(--gk-text-muted); font-size: 0.9rem; margin-top: 4px; }
.gk-page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Cards
   ========================================================================== */
.gk-card {
    background: var(--gk-surface);
    border: 1px solid var(--gk-border);
    border-radius: var(--gk-radius);
    box-shadow: var(--gk-shadow-sm);
    overflow: hidden;
    transition: var(--gk-t);
}
.gk-card:hover { box-shadow: var(--gk-shadow); }

.gk-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gk-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.gk-card-header h3 { font-size: 1.05rem; font-weight: 700; }
.gk-card-header .actions { display: flex; gap: 8px; }

.gk-card-body { padding: 22px; }
.gk-card-body.no-pad { padding: 0; }
.gk-card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--gk-border);
    background: var(--gk-surface-2);
}

/* ==========================================================================
   Stat cards (dashboard KPIs)
   ========================================================================== */
.gk-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.gk-stat-card {
    background: var(--gk-surface);
    border: 1px solid var(--gk-border);
    border-radius: var(--gk-radius);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: var(--gk-t);
    box-shadow: var(--gk-shadow-sm);
}
.gk-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--gk-shadow-lg);
    border-color: var(--gk-brand-light);
}
.gk-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.08;
    transform: translate(30px, -30px);
}
.gk-stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.gk-stat-card-icon svg { width: 24px; height: 24px; }
.gk-stat-card-icon.brand { background: var(--gk-brand-gradient-soft); color: var(--gk-brand-dark); }
.gk-stat-card-icon.brand::before, .gk-stat-card.brand::before { background: var(--gk-brand); }
.gk-stat-card-icon.success { background: var(--gk-success-bg); color: var(--gk-success); }
.gk-stat-card.success::before { background: var(--gk-success); }
.gk-stat-card-icon.warning { background: var(--gk-warning-bg); color: var(--gk-warning); }
.gk-stat-card.warning::before { background: var(--gk-warning); }
.gk-stat-card-icon.danger { background: var(--gk-danger-bg); color: var(--gk-danger); }
.gk-stat-card.danger::before { background: var(--gk-danger); }
.gk-stat-card-icon.info { background: var(--gk-info-bg); color: var(--gk-info); }
.gk-stat-card.info::before { background: var(--gk-info); }

.gk-stat-card-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gk-text);
    line-height: 1.2;
    margin-bottom: 4px;
}
.gk-stat-card-label {
    color: var(--gk-text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}
.gk-stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 20px;
}
.gk-stat-card-trend.up { background: var(--gk-success-bg); color: var(--gk-success); }
.gk-stat-card-trend.down { background: var(--gk-danger-bg); color: var(--gk-danger); }

/* ==========================================================================
   Tables
   ========================================================================== */
.gk-table-wrap {
    overflow-x: auto;
    border-radius: var(--gk-radius);
    border: 1px solid var(--gk-border);
}
.gk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    table-layout: auto;
}
.gk-table thead {
    background: var(--gk-surface-2);
}
.gk-table th {
    padding: 12px 14px;
    text-align: right;
    font-weight: 700;
    color: var(--gk-text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
    border-bottom: 2px solid var(--gk-border);
}
.gk-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--gk-border);
    color: var(--gk-text);
    vertical-align: middle;
}
.gk-table tbody tr:last-child td { border-bottom: none; }
.gk-table tbody tr { transition: var(--gk-t); }
.gk-table tbody tr:hover { background: var(--gk-surface-2); }
.gk-table .text-center { text-align: center; }
.gk-table .text-left { text-align: left; }
.gk-table .nowrap { white-space: nowrap; }
.gk-table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.gk-table .muted { color: var(--gk-text-muted); }
.gk-table .col-actions { width: 90px; text-align: center; white-space: nowrap; }
.gk-table .col-status { width: 110px; }
.gk-table .col-unit { width: 90px; }
.gk-table .col-floor { width: 70px; }
.gk-table .col-block { width: 80px; }
.gk-table .col-person { min-width: 140px; }
.gk-table td.col-actions { text-align: center; }

/* ==========================================================================
   Badges
   ========================================================================== */
.gk-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}
.gk-badge svg { width: 14px; height: 14px; }
.gk-badge-success { background: var(--gk-success-bg); color: var(--gk-success); }
.gk-badge-warning { background: var(--gk-warning-bg); color: var(--gk-warning); }
.gk-badge-danger { background: var(--gk-danger-bg); color: var(--gk-danger); }
.gk-badge-info { background: var(--gk-info-bg); color: var(--gk-info); }
.gk-badge-brand { background: var(--gk-brand-gradient-soft); color: var(--gk-brand-dark); }
.gk-badge-muted { background: var(--gk-surface-2); color: var(--gk-text-muted); }

/* ==========================================================================
   Empty state
   ========================================================================== */
.gk-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--gk-text-muted);
}
.gk-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background: var(--gk-surface-2);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gk-empty-icon svg { width: 40px; height: 40px; color: var(--gk-text-light); }
.gk-empty h3 { color: var(--gk-text); margin-bottom: 8px; }
.gk-empty p { margin-bottom: 20px; }

/* ==========================================================================
   Alerts / notices
   ========================================================================== */
.gk-alert {
    padding: 14px 18px;
    border-radius: var(--gk-radius-sm);
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
}
.gk-alert svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.gk-alert-info { background: var(--gk-info-bg); color: #0e7490; }
.gk-alert-success { background: var(--gk-success-bg); color: #15803d; }
.gk-alert-warning { background: var(--gk-warning-bg); color: #b45309; }
.gk-alert-danger { background: var(--gk-danger-bg); color: #b91c1c; }
.gk-alert strong { font-weight: 700; }

/* ==========================================================================
   Toast notifications
   ========================================================================== */
.gk-toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}
.gk-toast {
    background: var(--gk-surface);
    border: 1px solid var(--gk-border);
    border-right: 4px solid var(--gk-brand);
    border-radius: var(--gk-radius-sm);
    padding: 14px 18px;
    box-shadow: var(--gk-shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: gk-slide-in-left 0.3s ease;
    font-size: 0.9rem;
}
.gk-toast.success { border-right-color: var(--gk-success); }
.gk-toast.error { border-right-color: var(--gk-danger); }
.gk-toast.warning { border-right-color: var(--gk-warning); }
.gk-toast.info { border-right-color: var(--gk-info); }
.gk-toast-icon { flex-shrink: 0; margin-top: 1px; }
.gk-toast-icon svg { width: 20px; height: 20px; }
.gk-toast.success .gk-toast-icon { color: var(--gk-success); }
.gk-toast.error .gk-toast-icon { color: var(--gk-danger); }
.gk-toast.warning .gk-toast-icon { color: var(--gk-warning); }
.gk-toast.info .gk-toast-icon { color: var(--gk-info); }
.gk-toast-content strong { display: block; margin-bottom: 2px; }
.gk-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gk-text-light);
    padding: 0;
    margin-right: auto;
}

/* ==========================================================================
   Grid utilities
   ========================================================================== */
.gk-grid { display: grid; gap: 18px; }
.gk-grid-2 { grid-template-columns: repeat(2, 1fr); }
.gk-grid-3 { grid-template-columns: repeat(3, 1fr); }
.gk-grid-4 { grid-template-columns: repeat(4, 1fr); }
.gk-grid-2-1 { grid-template-columns: 2fr 1fr; }
.gk-grid-1-2 { grid-template-columns: 1fr 2fr; }
.gk-col-span-2 { grid-column: span 2; }

/* Form section title — عنوان بخش‌بندی داخل فرم‌ها (مالک/مستأجر/...) */
.gk-form-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gk-brand-dark, #c2410c);
    padding-bottom: 6px;
    margin-bottom: 4px;
    border-bottom: 2px solid var(--gk-brand, #f97316);
    display: flex;
    align-items: center;
    gap: 6px;
}
.gk-form-section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--gk-brand, #f97316);
    border-radius: 2px;
}

@media (max-width: 1024px) {
    .gk-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .gk-grid-2-1, .gk-grid-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .gk-grid-2, .gk-grid-3, .gk-grid-4 { grid-template-columns: 1fr; }
    .gk-col-span-2 { grid-column: span 1; }
}

/* ==========================================================================
   Pricing cards (plan selection)
   ========================================================================== */
.gk-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.gk-plan-card {
    background: var(--gk-surface);
    border: 2px solid var(--gk-border);
    border-radius: var(--gk-radius-lg);
    padding: 20px 18px;
    position: relative;
    transition: var(--gk-t);
    display: flex;
    flex-direction: column;
}
.gk-plan-card:hover {
    border-color: var(--gk-brand-light);
    transform: translateY(-4px);
    box-shadow: var(--gk-shadow-lg);
}
.gk-plan-card.is-featured {
    border-color: var(--gk-brand);
    box-shadow: var(--gk-brand-shadow);
}
.gk-plan-card.is-active {
    border-color: var(--gk-success);
}
.gk-plan-card.is-active::after {
    content: 'فعال';
    position: absolute;
    top: -12px;
    right: 24px;
    background: var(--gk-success);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.gk-plan-badge {
    position: absolute;
    top: -12px;
    right: 24px;
    background: var(--gk-brand-gradient);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    box-shadow: var(--gk-brand-shadow);
}

.gk-plan-name {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 2px;
}
.gk-plan-desc {
    color: var(--gk-text-muted);
    font-size: 0.82rem;
    margin-bottom: 12px;
    min-height: 22px;
    line-height: 1.4;
}
.gk-plan-price {
    margin-bottom: 14px;
}
.gk-plan-price-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--gk-text);
    line-height: 1;
}
.gk-plan-price-unit {
    font-size: 0.85rem;
    color: var(--gk-text-muted);
    font-weight: 500;
}
.gk-plan-free .gk-plan-price-value { color: var(--gk-success); }

.gk-plan-features {
    list-style: none;
    margin-bottom: 12px;
    flex: 1;
}
.gk-plan-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.84rem;
    color: var(--gk-text);
    border-bottom: 1px solid var(--gk-border);
}
.gk-plan-features li:last-child { border-bottom: none; }
.gk-plan-features li svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--gk-success); }
.gk-plan-features li.disabled { color: var(--gk-text-light); }
.gk-plan-features li.disabled svg { color: var(--gk-text-light); }

/* قابلیت‌های اضافی — در حالت جمع‌شده مخفی */
.gk-plan-card:not(.is-expanded) .gk-plan-feature-extra {
    display: none;
}

/* دکمه‌ی «ادامه قابلیت‌ها» */
.gk-plan-toggle-features {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 7px 10px;
    margin-bottom: 12px;
    background: transparent;
    border: 1px dashed var(--gk-border);
    border-radius: var(--gk-radius);
    color: var(--gk-brand);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--gk-t);
}
.gk-plan-toggle-features:hover {
    background: var(--gk-brand-light);
    border-color: var(--gk-brand);
    border-style: solid;
}
.gk-plan-toggle-features .gk-toggle-chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}
/* در حالت جمع‌شده فقط «ادامه قابلیت‌ها» نمایش داده شود */
.gk-plan-card:not(.is-expanded) .gk-toggle-open { display: none; }
.gk-plan-card:not(.is-expanded) .gk-toggle-chevron { transform: rotate(0deg); }
/* در حالت بازشده فقط «بستن» نمایش داده شود + چرخش چرون */
.gk-plan-card.is-expanded .gk-toggle-closed { display: none; }
.gk-plan-card.is-expanded .gk-toggle-chevron { transform: rotate(180deg); }

/* ==========================================================================
   Progress / Steps
   ========================================================================== */
.gk-progress {
    height: 8px;
    background: var(--gk-surface-2);
    border-radius: 4px;
    overflow: hidden;
}
.gk-progress-bar {
    height: 100%;
    background: var(--gk-brand-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.gk-steps {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 32px;
}
.gk-step {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}
.gk-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gk-surface-2);
    color: var(--gk-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    transition: var(--gk-t);
    border: 2px solid var(--gk-border);
}
.gk-step.is-done .gk-step-num { background: var(--gk-success); color: #fff; border-color: var(--gk-success); }
.gk-step.is-active .gk-step-num { background: var(--gk-brand-gradient); color: #fff; border-color: var(--gk-brand); }
.gk-step-label { font-size: 0.85rem; font-weight: 600; color: var(--gk-text-muted); }
.gk-step.is-active .gk-step-label, .gk-step.is-done .gk-step-label { color: var(--gk-text); }
.gk-step-line { flex: 1; height: 2px; background: var(--gk-border); }
.gk-step.is-done + .gk-step .gk-step-line, .gk-step.is-done .gk-step-line { background: var(--gk-success); }

/* ==========================================================================
   Tabs
   ========================================================================== */
.gk-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--gk-border);
    margin-bottom: 24px;
    overflow-x: auto;
}
.gk-tab {
    padding: 10px 18px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--gk-text-muted);
    border-bottom: 3px solid transparent;
    transition: var(--gk-t);
    white-space: nowrap;
    margin-bottom: -2px;
}
.gk-tab:hover { color: var(--gk-text); }
.gk-tab.is-active {
    color: var(--gk-brand-dark);
    border-bottom-color: var(--gk-brand);
}

/* ==========================================================================
   Misc
   ========================================================================== */
.gk-text-muted { color: var(--gk-text-muted); }
.gk-text-success { color: var(--gk-success); }
.gk-text-danger { color: var(--gk-danger); }
.gk-text-warning { color: var(--gk-warning); }
.gk-text-brand { color: var(--gk-brand-dark); }
.gk-text-center { text-align: center; }
.gk-text-left { text-align: left; }
.gk-text-right { text-align: right; }
.gk-fw-700 { font-weight: 700; }
.gk-fw-800 { font-weight: 800; }
.gk-mt-0 { margin-top: 0; }
.gk-mt-2 { margin-top: 8px; }
.gk-mt-4 { margin-top: 16px; }
.gk-mt-6 { margin-top: 24px; }
.gk-mb-0 { margin-bottom: 0; }
.gk-mb-2 { margin-bottom: 8px; }
.gk-mb-4 { margin-bottom: 16px; }
.gk-mb-6 { margin-bottom: 24px; }
.gk-mono { font-family: 'Courier New', monospace; }
.gk-num { font-variant-numeric: tabular-nums; }

.gk-divider {
    height: 1px;
    background: var(--gk-border);
    margin: 20px 0;
    border: none;
}

.gk-skeleton {
    background: linear-gradient(90deg, var(--gk-surface-2) 0%, var(--gk-border) 50%, var(--gk-surface-2) 100%);
    background-size: 200% 100%;
    animation: gk-shimmer 1.5s infinite;
    border-radius: var(--gk-radius-sm);
}

.gk-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gk-surface-2);
    border-top-color: var(--gk-brand);
    border-radius: 50%;
    animation: gk-spin 0.8s linear infinite;
}
.gk-spinner-sm { width: 18px; height: 18px; border-width: 2px; }

/* ==========================================================================
   Responsive — Mobile sidebar
   ========================================================================== */
.gk-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
}
.gk-sidebar-backdrop.is-open { display: block; }

@media (max-width: 1024px) {
    .gk-sidebar {
        transform: translateX(100%);
    }
    .gk-sidebar.is-open { transform: translateX(0); }
    .gk-main { margin-right: 0; }
    .gk-topbar-toggle { display: flex; }
    .gk-sidebar-collapse-btn { display: none !important; }
    /* Ensure collapsed state is removed on mobile */
    .gk-app.is-collapsed .gk-sidebar { width: var(--gk-sidebar-w); }
    .gk-app.is-collapsed .gk-main { margin-right: 0; }
    .gk-app.is-collapsed .gk-sidebar-brand-text { display: block; }
    .gk-app.is-collapsed .gk-sidebar-section-title { display: block; }
    .gk-app.is-collapsed .gk-nav-item span { display: inline; }
    .gk-app.is-collapsed .gk-sidebar-footer .gk-nav-item span { display: inline; }
    .gk-app.is-collapsed .gk-nav-item { justify-content: flex-start; padding: 11px 16px; }
}

@media (max-width: 640px) {
    .gk-topbar { padding: 0 14px; gap: 8px; }
    .gk-user-menu-info { display: none; }
    .gk-complex-selector-btn span, .gk-role-switcher-btn .role-name { display: none; }
    .gk-content { padding: 14px; }
    .gk-stats-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes gk-spin { to { transform: rotate(360deg); } }
@keyframes gk-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes gk-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes gk-slide-up { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes gk-slide-down { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes gk-slide-in-left { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes gk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.gk-animate-in { animation: gk-slide-up 0.4s ease; }

/* ==========================================================================
   §Task 4-B — Invoice creator footer
   فوتر ایجاد‌کننده‌ی فاکتور + امضای سامانه (frontend app + resident portal).
   ========================================================================== */
.gksoft-invoice-footer {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border-top: 1px dashed #ccc;
    text-align: center;
    color: #666;
    font-size: 0.875rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}
.gksoft-invoice-footer .gksoft-creator-line {
    margin: 0;
    line-height: 1.6;
}
.gksoft-invoice-footer .gksoft-creator-line strong {
    color: #374151;
    font-weight: 600;
}
.gksoft-invoice-footer .gksoft-creator-signature {
    color: #6b7280;
    font-weight: 400;
}

/* Resident panel (legacy portal) — same look for invoice-meta + invoice-summary */
.invoice-summary + .gksoft-invoice-footer,
.gksoft-invoice-footer {
    margin-bottom: 1.5rem;
}

/* Ensure the footer is visible and clean in print output. */
@media print {
    .gksoft-invoice-footer {
        margin-top: 1.5rem;
        padding: 0.75rem 1rem;
        background: #fff !important;
        border: 1px solid #999;
        border-top: 2px solid #666;
        color: #333;
        font-size: 0.85rem;
        page-break-inside: avoid;
    }
    .gksoft-invoice-footer .gksoft-creator-line strong,
    .gksoft-invoice-footer .gksoft-creator-signature {
        color: #333 !important;
    }
}
