/* فونت فارسی Vazirmatn */
body, .oa-wrap, .oa-portal-body, .oa-portal-root {
    font-family: Vazirmatn, Tahoma, 'Segoe UI', system-ui, sans-serif !important;
}

/* اتوماسیون اداری - استایل مدرن RTL */
:root {
    --oa-primary: #2563eb;
    --oa-primary-dark: #1d4ed8;
    --oa-secondary: #0f172a;
    --oa-success: #16a34a;
    --oa-warning: #d97706;
    --oa-danger: #dc2626;
    --oa-bg: #f8fafc;
    --oa-card: #ffffff;
    --oa-border: #e2e8f0;
    --oa-text: #0f172a;
    --oa-muted: #64748b;
    --oa-radius: 12px;
    --oa-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --oa-shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.08);
}

.oa-wrap {
    direction: rtl;
    font-family: Vazirmatn, Tahoma, 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--oa-bg);
    color: var(--oa-text);
    min-height: calc(100vh - 32px);
    margin: -10px -20px 0;
    padding: 0;
}

.oa-header {
    background: var(--oa-card);
    border-bottom: 1px solid var(--oa-border);
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 32px;
    z-index: 100;
    box-shadow: var(--oa-shadow);
}

.oa-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.oa-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--oa-primary), #1e40af);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

.oa-header-title h1 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--oa-text);
}

.oa-header-title p {
    margin: 0;
    font-size: 11px;
    color: var(--oa-muted);
}

.oa-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.oa-notif-btn {
    position: relative;
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--oa-muted);
    transition: all 0.2s;
}

.oa-notif-btn:hover {
    background: #f1f5f9;
    color: var(--oa-primary);
}

.oa-notif-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--oa-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oa-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.oa-user-menu:hover {
    background: #f1f5f9;
}

.oa-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--oa-primary);
    font-weight: 700;
}

.oa-user-info span {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.oa-user-info small {
    font-size: 11px;
    color: var(--oa-muted);
}

/* Layout */
.oa-layout {
    display: flex;
    min-height: calc(100vh - 96px);
}

.oa-sidebar {
    width: 240px;
    background: var(--oa-card);
    border-left: 1px solid var(--oa-border);
    padding: 20px 12px;
    flex-shrink: 0;
}

.oa-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.oa-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--oa-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.oa-nav a:hover,
.oa-nav a.active {
    background: #eff6ff;
    color: var(--oa-primary);
}

.oa-nav a .dashicons {
    font-size: 18px;
    width: 20px;
    height: 20px;
}

.oa-main {
    flex: 1;
    padding: 24px;
    overflow-x: auto;
}

/* Cards & Stats */
.oa-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.oa-page-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.oa-page-header p {
    margin: 4px 0 0;
    color: var(--oa-muted);
    font-size: 14px;
}

.oa-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.oa-stat-card {
    background: var(--oa-card);
    border: 1px solid var(--oa-border);
    border-radius: var(--oa-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--oa-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.oa-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--oa-shadow-lg);
}

.oa-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.oa-stat-icon.blue { background: #dbeafe; color: var(--oa-primary); }
.oa-stat-icon.orange { background: #ffedd5; color: var(--oa-warning); }
.oa-stat-icon.green { background: #dcfce7; color: var(--oa-success); }
.oa-stat-icon.red { background: #fee2e2; color: var(--oa-danger); }
.oa-stat-icon.purple { background: #f3e8ff; color: #7c3aed; }

.oa-stat-info h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.oa-stat-info p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--oa-muted);
}

/* Card */
.oa-card {
    background: var(--oa-card);
    border: 1px solid var(--oa-border);
    border-radius: var(--oa-radius);
    box-shadow: var(--oa-shadow);
    margin-bottom: 20px;
}

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

.oa-card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.oa-card-body {
    padding: 20px;
}

/* Buttons */
.oa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
}

.oa-btn-primary {
    background: linear-gradient(135deg, var(--oa-primary), var(--oa-primary-dark));
    color: #fff;
}

.oa-btn-primary:hover {
    opacity: 0.9;
    color: #fff;
    transform: translateY(-1px);
}

.oa-btn-secondary {
    background: #f1f5f9;
    color: var(--oa-text);
    border: 1px solid var(--oa-border);
}

.oa-btn-secondary:hover {
    background: #e2e8f0;
}

.oa-btn-success {
    background: var(--oa-success);
    color: #fff;
}

.oa-btn-danger {
    background: var(--oa-danger);
    color: #fff;
}

.oa-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.oa-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
}

/* Forms */
.oa-form-group {
    margin-bottom: 16px;
}

.oa-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--oa-text);
}

.oa-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--oa-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    font-family: inherit;
}

.oa-form-control:focus {
    outline: none;
    border-color: var(--oa-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.oa-form-control {
    min-height: 100px;
    resize: vertical;
}

select.oa-form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
}

/* Tables */
.oa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.oa-table th {
    text-align: right;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--oa-border);
    font-weight: 600;
    color: var(--oa-muted);
    white-space: nowrap;
}

.oa-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--oa-border);
    vertical-align: middle;
}

.oa-table tr:hover td {
    background: #f8fafc;
}

/* Badges */
.oa-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.oa-badge-pending { background: #ffedd5; color: #c2410c; }
.oa-badge-in_progress { background: #dbeafe; color: #1d4ed8; }
.oa-badge-completed { background: #dcfce7; color: #15803d; }
.oa-badge-approved { background: #dcfce7; color: #15803d; }
.oa-badge-rejected { background: #fee2e2; color: #b91c1c; }
.oa-badge-high { background: #fee2e2; color: #b91c1c; }
.oa-badge-medium { background: #ffedd5; color: #c2410c; }
.oa-badge-low { background: #e0e7ff; color: #4338ca; }

/* Modal */
.oa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.oa-modal-overlay.active {
    display: flex;
}

.oa-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--oa-shadow-lg);
    animation: oaSlideIn 0.25s ease;
}

@keyframes oaSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.oa-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--oa-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.oa-modal-header h3 {
    margin: 0;
    font-size: 16px;
}

.oa-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--oa-muted);
    line-height: 1;
}

.oa-modal-body {
    padding: 20px;
}

.oa-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--oa-border);
    display: flex;
    justify-content: flex-start;
    gap: 10px;
}

/* Empty state */
.oa-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--oa-muted);
}

.oa-empty .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    opacity: 0.4;
    margin-bottom: 12px;
}

/* Login */
.oa-login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.oa-login-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--oa-shadow-lg);
    border: 1px solid var(--oa-border);
}

.oa-login-card h2 {
    margin: 0 0 8px;
    text-align: center;
}

.oa-login-card p {
    text-align: center;
    color: var(--oa-muted);
    margin-bottom: 24px;
}

/* Message list */
.oa-msg-item {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--oa-border);
    cursor: pointer;
    transition: background 0.15s;
}

.oa-msg-item:hover {
    background: #f8fafc;
}

.oa-msg-item.unread {
    background: #eff6ff;
}

.oa-msg-item.unread .oa-msg-subject {
    font-weight: 700;
}

.oa-msg-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #dbeafe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--oa-primary);
    font-weight: 700;
    flex-shrink: 0;
}

.oa-msg-content {
    flex: 1;
    min-width: 0;
}

.oa-msg-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.oa-msg-sender {
    font-weight: 600;
    font-size: 13px;
}

.oa-msg-date {
    font-size: 11px;
    color: var(--oa-muted);
}

.oa-msg-subject {
    font-size: 13px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.oa-msg-preview {
    font-size: 12px;
    color: var(--oa-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tabs */
.oa-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--oa-border);
    margin-bottom: 16px;
}

.oa-tab {
    padding: 10px 18px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--oa-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.oa-tab.active {
    color: var(--oa-primary);
    border-bottom-color: var(--oa-primary);
}

/* Grid 2 col */
.oa-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* دسکتاپ: سایدبار ثابت */
.oa-menu-toggle { display: none; }
.oa-sidebar-overlay { display: none; }
.oa-sidebar-mobile-head { display: none; }


/* Utility */
.oa-text-muted { color: var(--oa-muted); }
.oa-mt-2 { margin-top: 8px; }
.oa-mt-3 { margin-top: 12px; }
.oa-mb-3 { margin-bottom: 12px; }
.oa-flex { display: flex; }
.oa-gap-2 { gap: 8px; }
.oa-items-center { align-items: center; }
.oa-justify-between { justify-content: space-between; }

/* Notice */
.oa-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
}

.oa-notice.oa-success { background: #dcfce7; color: #15803d; }
.oa-notice.oa-error { background: #fee2e2; color: #b91c1c; }
.oa-notice.oa-info { background: #dbeafe; color: #1d4ed8; }

/* Loading */
.oa-loading {
    text-align: center;
    padding: 40px;
    color: var(--oa-muted);
}

/* ========== چت لحظه‌ای ========== */
.oa-chat-layout .oa-main {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.oa-chat-container {
    display: flex;
    height: calc(100vh - 96px);
    background: var(--oa-card);
}

.oa-chat-sidebar {
    width: 300px;
    border-left: 1px solid var(--oa-border);
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    flex-shrink: 0;
}

.oa-chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--oa-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.oa-chat-sidebar-header h3 {
    margin: 0;
    font-size: 15px;
}

.oa-chat-search {
    padding: 12px;
    position: relative;
    border-bottom: 1px solid var(--oa-border);
}

.oa-chat-user-results {
    position: absolute;
    top: 100%;
    right: 12px;
    left: 12px;
    background: #fff;
    border: 1px solid var(--oa-border);
    border-radius: 8px;
    box-shadow: var(--oa-shadow-lg);
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.oa-chat-user-pick {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}

.oa-chat-user-pick:hover {
    background: #eff6ff;
}

.oa-conversations-list {
    flex: 1;
    overflow-y: auto;
}

.oa-conv-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--oa-border);
    transition: background 0.15s;
    align-items: center;
}

.oa-conv-item:hover,
.oa-conv-item.active {
    background: #eff6ff;
}

.oa-conv-item.active {
    border-right: 3px solid var(--oa-primary);
}

.oa-conv-info {
    flex: 1;
    min-width: 0;
}

.oa-conv-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.oa-conv-top strong {
    font-size: 13px;
}

.oa-conv-preview {
    font-size: 12px;
    color: var(--oa-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* پنجره چت */
.oa-chat-window {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.oa-chat-window-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--oa-border);
    background: #fff;
}

.oa-chat-peer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.oa-chat-peer-info strong {
    display: block;
    font-size: 14px;
}

.oa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.oa-chat-placeholder {
    margin: auto;
    text-align: center;
    color: var(--oa-muted);
}

.oa-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.oa-bubble.mine {
    align-self: flex-start;
    background: linear-gradient(135deg, var(--oa-primary), var(--oa-primary-dark));
    color: #fff;
    border-bottom-right-radius: 4px;
}

.oa-bubble.theirs {
    align-self: flex-end;
    background: #fff;
    border: 1px solid var(--oa-border);
    border-bottom-left-radius: 4px;
}

.oa-bubble-meta {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: left;
}

.oa-bubble.theirs .oa-bubble-meta {
    text-align: right;
}

.oa-msg-failed {
    opacity: 0.6;
    border: 1px dashed var(--oa-danger) !important;
}

.oa-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid var(--oa-border);
    background: #fff;
}

.oa-chat-input-area form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.oa-chat-input-area textarea {
    flex: 1;
    resize: none;
    min-height: 42px;
    max-height: 120px;
    border-radius: 21px;
    padding: 10px 16px;
}

.oa-chat-input-area .oa-btn-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* وضعیت WebSocket */
.oa-ws-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--oa-muted);
    padding: 6px 12px;
    border-radius: 20px;
    background: #f1f5f9;
}

.oa-ws-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
}

.oa-ws-dot.online {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.25);
}

.oa-ws-dot.offline {
    background: #d97706;
}

@media (max-width: 900px) {
    .oa-chat-sidebar {
        width: 240px;
    }
}

@media (max-width: 640px) {
    .oa-chat-container {
        flex-direction: column;
    }
    .oa-chat-sidebar {
        width: 100%;
        height: 40%;
        border-left: none;
        border-bottom: 1px solid var(--oa-border);
    }
}


/* فونت سراسری */
body, .oa-wrap, .oa-portal-body, .oa-portal-root, input, select, textarea, button {
    font-family: Vazirmatn, Tahoma, 'Segoe UI', system-ui, sans-serif !important;
}

/* تقویم شمسی */
jdp-container, .jdp-container {
    font-family: Vazirmatn, Tahoma, sans-serif !important;
    z-index: 100001 !important;
    direction: rtl;
}

.oa-bubble-att { margin-top:6px; font-size:12px; }
.oa-bubble-att a { color: inherit; text-decoration: underline; opacity: 0.9; }
.oa-bubble.mine .oa-bubble-att a { color: #e0e7ff; }


/* ========== استایل جذاب‌تر نسخه ۱.۵ ========== */
.oa-portal-body {
    background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 40%, #f1f5f9 100%) !important;
}
.oa-header {
    background: rgba(255,255,255,0.92) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(15,23,42,0.06);
}
.oa-logo {
    background: linear-gradient(135deg, #4f46e5, #2563eb) !important;
    box-shadow: 0 8px 20px rgba(37,99,235,0.35);
}
.oa-sidebar {
    background: rgba(255,255,255,0.95) !important;
    box-shadow: -4px 0 24px rgba(15,23,42,0.04);
}
.oa-nav a {
    border-radius: 12px !important;
}
.oa-nav a.active {
    background: linear-gradient(135deg, var(--oa-primary-light, #eef2ff), var(--oa-primary-soft, #dbeafe)) !important;
    color: var(--oa-primary-dark, #1d4ed8) !important;
    font-weight: 700;
    box-shadow: inset 3px 0 0 var(--oa-primary, #2563eb);
}
.oa-stat-card, .oa-card {
    border: none !important;
    box-shadow: 0 4px 20px rgba(15,23,42,0.06) !important;
    border-radius: 16px !important;
}
.oa-btn-primary {
    background: linear-gradient(135deg, #4f46e5, #2563eb) !important;
    box-shadow: 0 6px 16px rgba(37,99,235,0.3);
}
.oa-btn-primary:hover {
    box-shadow: 0 8px 22px rgba(37,99,235,0.4);
    transform: translateY(-1px);
}

/* بج منو چت */
.oa-nav-badge {
    margin-right: auto;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    line-height: 1;
}

/* تیک‌های پیام */
.oa-ticks {
    display: inline-block;
    margin-right: 4px;
    font-size: 12px;
    letter-spacing: -2px;
    opacity: 0.85;
}
.oa-ticks.read { color: #38bdf8; }
.oa-ticks.sent { opacity: 0.65; }

/* وضعیت آنلاین */
.oa-online-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-left: 6px;
    background: #94a3b8;
}
.oa-online-dot.on {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.25);
}

/* لاگین */
.oa-login-page {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(145deg, #1e1b4b 0%, #312e81 35%, #1d4ed8 100%) !important;
    font-family: Vazirmatn, Tahoma, sans-serif !important;
}
.oa-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.oa-login-card {
    background: #fff;
    border-radius: 24px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.25);
    text-align: center;
}
.oa-login-brand { margin-bottom: 28px; }
.oa-login-logo {
    margin: 0 auto 16px !important;
    width: 64px !important;
    height: 64px !important;
    font-size: 30px !important;
    border-radius: 18px !important;
}
.oa-login-card h2 { margin: 0 0 6px; font-size: 22px; color: #0f172a; }
.oa-login-card > .oa-login-brand p,
.oa-login-brand p { color: #64748b; margin: 0; font-size: 13px; }
.oa-login-card .oa-form-group { text-align: right; margin-bottom: 14px; }
.oa-login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.oa-login-card .oa-form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.oa-login-card .oa-form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.oa-login-remember {
    text-align: right;
    margin-bottom: 18px;
    font-size: 13px;
    color: #64748b;
}
.oa-login-submit {
    width: 100%;
    padding: 14px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    justify-content: center;
}
.oa-login-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: right;
}

/* چت جذاب‌تر */
.oa-chat-container {
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(15,23,42,0.08);
}
.oa-chat-messages {
    background: linear-gradient(180deg, #e0e7ff 0%, #f1f5f9 100%) !important;
}
.oa-bubble.mine {
    background: linear-gradient(135deg, #4f46e5, #2563eb) !important;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.oa-bubble.theirs {
    box-shadow: 0 2px 8px rgba(15,23,42,0.06);
}
.oa-conv-item.active {
    background: linear-gradient(90deg, #eef2ff, #dbeafe) !important;
}


/* ========== موبایل کامل ========== */

/* دکمه همبرگری */
.oa-menu-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    border: none;
    background: #f1f5f9;
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    flex-shrink: 0;
}
.oa-menu-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: #0f172a;
    border-radius: 2px;
    transition: transform .25s, opacity .25s;
}
body.oa-menu-open .oa-menu-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.oa-menu-open .oa-menu-bar:nth-child(2) {
    opacity: 0;
}
body.oa-menu-open .oa-menu-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
.oa-menu-toggle-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 18px;
    height: 18px;
    font-size: 10px;
}

.oa-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s, visibility .25s;
}
.oa-sidebar-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.oa-sidebar-mobile-head {
    display: none;
    padding: 16px;
    border-bottom: 1px solid var(--oa-border);
    align-items: center;
    justify-content: space-between;
}
.oa-sidebar-close {
    width: 40px;
    height: 40px;
    border: none;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 22px;
    cursor: pointer;
    color: #64748b;
}
.oa-sidebar-footer {
    padding: 16px;
    margin-top: auto;
    border-top: 1px solid var(--oa-border);
}
.oa-sidebar-ver {
    font-size: 11px;
    color: var(--oa-muted);
    text-align: center;
    margin: 10px 0 0;
}

@media (max-width: 900px) {
    .oa-menu-toggle {
        display: inline-flex;
    }
    .oa-header {
        top: 0 !important;
        height: 56px;
        padding: 0 12px;
        position: sticky;
        z-index: 100;
    }
    .oa-header-title h1 {
        font-size: 14px;
    }
    .oa-header-title p {
        display: none;
    }
    .oa-user-info {
        display: none !important;
    }
    .oa-logout-btn {
        display: none !important;
    }
    .oa-ws-status .oa-ws-label {
        display: none;
    }
    .oa-logo {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .oa-header-brand {
        gap: 8px;
    }

    /* سایدبار کشویی از راست */
    .oa-sidebar {
        position: fixed !important;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(300px, 86vw) !important;
        z-index: 95;
        transform: translateX(105%);
        transition: transform .28s cubic-bezier(.4,0,.2,1);
        display: flex !important;
        flex-direction: column;
        box-shadow: none;
        border: none;
        background: #fff !important;
        padding-top: 0;
    }
    .oa-sidebar.is-open {
        transform: translateX(0);
        box-shadow: -8px 0 32px rgba(15,23,42,0.18);
    }
    .oa-sidebar-mobile-head {
        display: flex;
    }
    .oa-sidebar-overlay {
        display: block;
    }
    body.oa-menu-open {
        overflow: hidden;
    }

    .oa-layout {
        display: block;
    }
    .oa-main {
        padding: 12px !important;
        min-height: calc(100vh - 56px);
        width: 100%;
    }

    .oa-page-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
    }
    .oa-page-header h2 {
        font-size: 18px !important;
    }
    .oa-page-header .oa-btn {
        width: 100%;
        justify-content: center;
    }

    .oa-stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    .oa-stat-card {
        padding: 14px !important;
    }
    .oa-stat-info h3 {
        font-size: 20px !important;
    }
    .oa-stat-info p {
        font-size: 11px !important;
    }
    .oa-grid-2 {
        grid-template-columns: 1fr !important;
    }

    /* جداول اسکرول افقی */
    .oa-card-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .oa-table {
        min-width: 560px;
        font-size: 12px;
    }
    .oa-table th, .oa-table td {
        padding: 10px 8px;
    }

    /* مودال تمام‌عرض */
    .oa-modal-overlay {
        padding: 0 !important;
        align-items: flex-end !important;
    }
    .oa-modal {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh;
    }

    /* چت موبایل */
    .oa-chat-container {
        flex-direction: column !important;
        height: calc(100vh - 56px) !important;
        margin: -12px !important;
        border-radius: 0 !important;
    }
    .oa-chat-sidebar {
        width: 100% !important;
        height: auto;
        max-height: 40%;
        border-left: none !important;
        border-bottom: 1px solid var(--oa-border);
    }
    .oa-chat-window {
        flex: 1;
        min-height: 0;
    }
    .oa-bubble {
        max-width: 85% !important;
    }
    .oa-chat-input-area form {
        gap: 6px;
    }
    .oa-chat-input-area textarea {
        font-size: 16px; /* جلوگیری از زوم iOS */
    }

    /* فرم‌ها */
    .oa-form-control {
        font-size: 16px; /* جلوگیری از زوم iOS */
    }
    .oa-login-card {
        padding: 28px 20px !important;
        border-radius: 20px !important;
    }
}

@media (max-width: 480px) {
    .oa-stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }
    .oa-stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .oa-header-actions .oa-btn {
        padding: 6px 10px;
    }
}

/* تقویم شمسی بالای مودال */
jdp-container, .jdp-container, .jalali-datepicker {
    z-index: 200000 !important;
}


/* 2.1.6 — هویت سازمانی و فرم‌ساز */
.oa-logo img{width:100%;height:100%;object-fit:contain;padding:4px;border-radius:inherit;background:#fff}
.oa-brand-color-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.oa-brand-color-row input[type=color]{width:58px;height:44px;padding:3px;border:1px solid var(--oa-border);border-radius:10px;background:#fff;cursor:pointer}
.oa-brand-color-row input[type=text]{max-width:150px}
.oa-company-logo-preview{margin-top:12px;padding:14px;display:inline-flex;align-items:center;justify-content:center;min-width:110px;min-height:80px;border:1px solid var(--oa-border);border-radius:12px;background:#fff}
.oa-company-logo-preview img{max-width:180px;max-height:90px;object-fit:contain}
.oa-fields-list .oa-field-row{position:relative;cursor:grab;transition:box-shadow .15s,border-color .15s;border:1px solid transparent}
.oa-fields-list .oa-field-row:active{cursor:grabbing}
.oa-fields-list .oa-field-row:hover{border-color:var(--oa-border);box-shadow:0 4px 14px rgba(15,23,42,.06)}
.oa-fields-list .oa-field-row.oa-field-dragging{opacity:.45}
.oa-drag-handle{display:flex;align-items:center;justify-content:center;color:var(--oa-muted);font-size:22px;cursor:grab;grid-column:1/-1;height:20px}
jdp-container{font-family:Vazirmatn,Tahoma,sans-serif!important;border:1px solid var(--oa-border)!important;border-radius:16px!important;box-shadow:0 18px 50px rgba(15,23,42,.18)!important;overflow:hidden}
jdp-container .jdp-day:not(.disabled-day):hover{background:var(--oa-primary)!important;color:#fff!important;border-radius:9px}
jdp-container .jdp-day.selected{background:var(--oa-primary)!important;color:#fff!important;border-radius:9px}
jdp-container .jdp-day.today{border:1px solid var(--oa-primary)!important}
@media(max-width:700px){.oa-fields-list .oa-field-row{grid-template-columns:1fr 1fr!important}}
