/* سامانه مدیریت ارتباط با مشتریان ایران فسفات - Main Stylesheet - RTL Persian Admin Panel */

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

:root {
    --sidebar-bg: #0b1c2c;
    --sidebar-hover: rgba(255,255,255,.06);
    --sidebar-active: #1f6f64;
    --sidebar-width: 276px;
    --sidebar-collapsed-width: 72px;
    --topbar-bg: #ffffff;
    --topbar-height: 64px;
    --primary: #1f6f64;
    --primary-light: #2d8a7c;
    --primary-soft: #eef6f4;
    --accent: #c4a574;
    --success: #2d8a6e;
    --warning: #b45309;
    --danger: #b42318;
    --info: #3d6b8a;
    --purple: #5b6472;
    --pink: #8a5a62;
    --body-bg: #f3f4f6;
    --card-bg: #ffffff;
    --text-dark: #15202b;
    --text-muted: #667085;
    --border: #e4e7ec;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04);
    --radius: 10px;
}

* { box-sizing: border-box; }

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    direction: rtl;
    background-color: var(--body-bg);
    color: var(--text-dark);
    font-size: 14px;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
}

a, a:link, a:visited, a:hover, a:focus, a:active {
    text-decoration: none;
}

.data-table a:not(.btn) {
    color: inherit;
    font-weight: 600;
}

/* ===================== SIDEBAR ===================== */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width .3s ease, transform .3s ease;
    box-shadow: none;
    border-left: 1px solid rgba(255,255,255,.06);
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 20px 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
.brand-lockup {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}
.brand-mark {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(196,165,116,.55);
    color: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(196,165,116,.08);
    box-sizing: border-box;
    line-height: 0;
    padding: 0;
}
.brand-mark i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
    margin: 0;
}
.brand-mark i::before {
    display: block;
    line-height: 1;
    width: 18px;
    height: 18px;
}

.btn-sidebar-collapse {
    background: rgba(255,255,255,.08);
    border: none;
    color: rgba(255,255,255,.75);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: background .2s, color .2s;
}

.btn-sidebar-collapse:hover {
    background: rgba(255,255,255,.15);
    color: white;
}

.sidebar-brand .logo-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(196,165,116,.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-brand .brand-name {
    color: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    display: block;
    max-width: 176px;
    white-space: normal;
    letter-spacing: -.1px;
}

.sidebar-brand .brand-sub {
    color: rgba(196,165,116,.85);
    font-size: 10.5px;
    display: block;
    margin-top: 3px;
    font-weight: 500;
    letter-spacing: .4px;
}

.sidebar-menu {
    padding: 14px 0;
    list-style: none;
    margin: 0;
    flex: 1 1 auto;
}

.sidebar-credit {
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: auto;
    flex-shrink: 0;
    text-align: center;
}
.sidebar-footer-text {
    text-align: center;
    color: rgba(255,255,255,.4);
    font-size: 10px;
    margin: 0;
    line-height: 1.7;
}
.sidebar-credit-link {
    display: inline-block;
    margin-top: 6px;
    color: rgba(196,165,116,.85);
    text-decoration: none;
}
.sidebar-credit-link:hover {
    color: var(--accent);
}

.sidebar-menu .menu-label {
    color: rgba(255,255,255,.35);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 14px 22px 6px;
    margin-top: 4px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
    transition: background .18s, color .18s;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    margin: 1px 10px;
    border-radius: 8px;
}

.sidebar-menu li a:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar-menu li.active a {
    background: rgba(31,111,100,.22);
    color: #fff;
    box-shadow: none;
}
.sidebar-menu li.active a::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    right: 0;
    width: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.sidebar-menu li a .menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    opacity: .9;
}

.sidebar-menu li a .menu-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Sidebar collapsed (desktop) ── */
body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .brand-lockup { display: none; }
body.sidebar-collapsed .sidebar-brand {
    padding: 14px 8px;
    justify-content: center;
}
body.sidebar-collapsed .sidebar-menu .menu-label,
body.sidebar-collapsed .sidebar-menu li a .menu-text,
body.sidebar-collapsed .sidebar-footer-text,
body.sidebar-collapsed .sidebar-footer-logo {
    display: none;
}

body.sidebar-collapsed .sidebar-menu li a {
    justify-content: center;
    padding: 11px 0;
    margin: 1px 6px;
}

body.sidebar-collapsed .btn-sidebar-collapse i {
    transform: rotate(180deg);
}

body.sidebar-collapsed .main-wrapper {
    margin-right: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-menu li a .badge-count {
    display: none;
}

body.sidebar-collapsed .sidebar-menu li.menu-has-pending > a .menu-icon {
    position: relative;
}

body.sidebar-collapsed .sidebar-menu li.menu-has-pending > a .menu-icon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 9px;
    height: 9px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #0b1c2c;
}

#form1 {
    max-width: 100%;
    overflow-x: hidden;
}

.sidebar-menu li a .badge-count {
    margin-right: auto;
    background: transparent;
    color: var(--accent);
    border: 1px solid rgba(196,165,116,.45);
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 6px;
    font-weight: 600;
}

/* ===================== MAIN CONTENT ===================== */
.main-wrapper {
    margin-right: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin .3s ease;
    max-width: 100%;
    overflow-x: hidden;
}

/* ===================== TOPBAR ===================== */
.topbar {
    height: var(--topbar-height);
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: none;
}

.topbar .page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    flex: 1;
    letter-spacing: -.2px;
}
.topbar .page-title .bi {
    color: var(--primary);
    font-size: 18px;
    margin-left: 8px;
    opacity: .9;
}

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

.topbar .btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 4px;
    display: none;
}

body.sidebar-collapsed .topbar .btn-toggle-sidebar {
    display: block;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
}

.topbar .user-info:hover { background: var(--primary-soft); border-color: #cfe0db; }

.topbar .user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-soft);
    border: 1px solid #cfe0db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 13px;
}

.topbar .user-name { font-size: 12.5px; font-weight: 500; color: #344054; }
.topbar .user-info a { color: var(--text-muted) !important; font-size: 16px !important; }
.topbar .user-info a:hover { color: var(--primary) !important; }

/* ===================== CONTENT AREA ===================== */
.content-area {
    padding: 28px;
    flex: 1;
    max-width: 100%;
    overflow-x: hidden;
    min-width: 0;
}

.dash-range {
    margin: 0 0 20px;
    padding: 14px 16px;
    background: #eef6f4;
    border: 1px solid #cfe0db;
    border-radius: 12px;
    color: #1a3d38;
}
.dash-range-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.dash-range-kicker {
    font-size: 13px;
    font-weight: 700;
    color: #1f6f64;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dash-range-caption {
    font-size: 12px;
    color: #5b746f;
}
.dash-range-fields {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.dash-range-field {
    min-width: 160px;
}
.dash-range-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #3d5c56;
}
.dash-range .form-control,
.dash-range .date-field input {
    background: #fff;
    border: 1px solid #c5ddd4;
    border-radius: 8px;
    height: 40px;
    box-shadow: none;
}
.dash-range .form-control:focus,
.dash-range .date-field input:focus {
    border-color: #1f6f64;
    outline: none;
}
.dash-range-sep {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f6f64;
    font-size: 12px;
    font-weight: 700;
    padding: 0 2px;
}
.dash-range-clear {
    height: 40px;
    background: #fff;
    color: #1f6f64;
    border: 1px solid #c5ddd4;
    border-radius: 8px;
    padding: 0 14px;
}
.dash-range-clear:hover {
    background: #1f6f64;
    color: #fff;
    border-color: #1f6f64;
}

/* ===================== CARDS ===================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
    max-width: 100%;
}

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

.card-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header h5 .bi { color: var(--primary); font-size: 16px; }

.card-body { padding: 22px; }

/* ===================== STAT CARDS ===================== */
.stat-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius);
}
.stat-card-link:hover .stat-card {
    transform: none;
    box-shadow: var(--shadow);
    border-color: #cfe0db;
    cursor: pointer;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: border-color .18s, background .18s;
}

.stat-card:hover {
    transform: none;
    box-shadow: var(--shadow);
    background: #fcfdfd;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid #d5e8e2;
}

.stat-icon.bg-primary,
.stat-icon.bg-success,
.stat-icon.bg-warning,
.stat-icon.bg-danger,
.stat-icon.bg-info,
.stat-icon.bg-purple,
.stat-icon.bg-pink,
.stat-icon.bg-teal {
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid #d5e8e2;
}
.stat-icon.bg-warning { background: #fbf6ee; color: #9a6b2f; border-color: #ead9b8; }
.stat-icon.bg-danger  { background: #f8eeed; color: #b42318; border-color: #ead4d2; }
.stat-icon.bg-info    { background: #eef3f6; color: #3d6b8a; border-color: #d3dee6; }

.stat-info .stat-value {
    font-size: 22px;
    font-weight: 650;
    color: var(--text-dark);
    line-height: 1.15;
    margin-bottom: 4px;
    letter-spacing: -.4px;
}

.stat-info .stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===================== TABLES ===================== */
.table-responsive {
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    position: relative;
}

.table-dual-scroll {
    max-width: 100%;
    position: relative;
}

.table-scroll-top {
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    height: 14px;
    margin-bottom: 4px;
    border-radius: 8px 8px 0 0;
}

.table-scroll-top-inner {
    height: 1px;
    pointer-events: none;
}

.table-dual-scroll > .table-responsive,
.table-dual-scroll > .portal-table-wrap {
    margin-top: 0;
}

.table-responsive::after,
.portal-table-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(to left, rgba(255,255,255,0.9), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

@media (max-width: 768px) {
    .table-responsive::after,
    .portal-table-wrap::after {
        opacity: 1;
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    table-layout: auto;
}

.data-table thead tr {
    background: #f8f9fb;
    color: #475467;
}

.data-table thead th {
    padding: 11px 16px;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
    border: none;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    letter-spacing: .3px;
    color: #667085;
}

@media (max-width: 992px) {
    .data-table thead th {
        white-space: normal;
    }
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .15s;
}

.data-table tbody tr:hover { background: #f8faf9; }
.data-table .tbl-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}
.data-table a.btn-sm,
.data-table .btn-sm {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    box-shadow: none;
    width: auto;
    min-width: 0;
    height: 32px;
    min-height: 32px;
    padding: 0 12px !important;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1 !important;
    font-size: 12px;
    box-sizing: border-box;
    vertical-align: middle;
}
.data-table .btn-sm.btn-icon {
    width: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
}
.data-table .btn-sm .bi {
    font-size: 14px;
    line-height: 1;
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.data-table .btn-sm.btn-icon .bi {
    width: 16px;
    height: 16px;
    font-size: 15px;
}
.data-table .btn-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}
.data-table .btn-sm.btn-success,
.data-table .btn-sm.btn-success:hover {
    color: var(--success);
    border-color: #c5ddd4;
    background: #f3faf7;
}
.data-table .btn-sm.btn-danger,
.data-table .btn-sm.btn-danger:hover {
    color: var(--danger);
    border-color: #ead4d2;
    background: #fdf6f6;
}
.data-table .btn-sm.btn-warning,
.data-table .btn-sm.btn-warning:hover {
    color: #9a6b2f;
    border-color: #ead9b8;
    background: #fffdf8;
}
.data-table .btn-sm.btn-info,
.data-table .btn-sm.btn-info:hover {
    color: var(--info);
    border-color: #d3dee6;
    background: #f7fafc;
}
.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
    color: var(--text-dark);
}

/* ===================== BADGES ===================== */
.badge {
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success { background: #eef6f2; color: #1f6f64; }
.badge-danger  { background: #f8eeed; color: #b42318; }
.badge-warning { background: #fbf6ee; color: #9a6b2f; }
.badge-info    { background: #eef3f6; color: #3d6b8a; }
.badge-purple  { background: #f2f4f7; color: #475467; }
.badge-gray    { background: #f2f4f7; color: #475467; }

/* ===================== BUTTONS ===================== */
.btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 13px;
    font-weight: 550;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .15s, border-color .15s, color .15s;
    text-decoration: none;
    line-height: 1.4;
}

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 7px; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #185a51; color: white; box-shadow: none; }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #246f58; color: white; }

.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover  { background: #912018; color: white; }

.btn-warning { background: #fff; color: #9a6b2f; border: 1px solid #ead9b8; }
.btn-warning:hover { background: #fbf6ee; color: #7a5424; }

.btn-info    { background: #fff; color: var(--info); border: 1px solid #d3dee6; }
.btn-info:hover    { background: #eef3f6; color: var(--info); }

.btn-secondary { background: #fff; color: var(--text-dark); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f8f9fb; color: var(--text-dark); }

.btn-outline-primary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary-soft); color: var(--primary); }

.btn-outline-success {
    background: transparent;
    color: var(--success);
    border: 1px solid #b7d4c8;
}
.btn-outline-success:hover { background: #f0f7f4; color: var(--success); }

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid #ead4d2;
}
.btn-outline-danger:hover { background: #fdf6f6; color: var(--danger); }

.btn-outline-secondary {
    background: transparent;
    color: #475467;
    border: 1px solid var(--border);
}
.btn-outline-secondary:hover { background: #f8f9fb; color: var(--text-dark); }

/* ===================== FORMS ===================== */
.form-group { margin-bottom: 18px; }

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

.form-control, .form-select {
    width: 100%;
    max-width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 13.5px;
    color: var(--text-dark);
    background: white;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31,111,100,.12);
}

.form-control::placeholder { color: #94a3b8; }

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

/* ===================== ALERTS ===================== */
.alert {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.alert-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.alert-danger  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }

/* ===================== PAGINATION ===================== */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0 4px;
}

.pagination {
    display: flex;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination li a, .pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: 13px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all .2s;
    font-weight: 600;
}

.pagination li.active span, .pagination li a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===================== ALERT SECTION DASHBOARD ===================== */
.alert-panel {
    background: #fbf6ee;
    border: 1px solid #ead9b8;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 24px;
}

.alert-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #9a3412;
    font-size: 14px;
    margin-bottom: 12px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: white;
    border-radius: 10px;
    margin-bottom: 8px;
    border-right: 3px solid var(--warning);
    font-size: 13px;
    color: var(--text-dark);
}

.alert-item:last-child { margin-bottom: 0; }
.alert-item .alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); flex-shrink: 0; }

/* ===================== LOGIN PAGE ===================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(31,111,100,.18), transparent 50%),
        radial-gradient(900px 400px at 0% 100%, rgba(196,165,116,.12), transparent 46%),
        #0b1c2c;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    padding: 40px 36px 32px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 16px 48px rgba(0,0,0,.28);
    border-top: 2px solid var(--accent);
}

.login-logo {
    width: 56px;
    height: 56px;
    background: var(--primary-soft);
    border: 1px solid #d5e8e2;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--primary);
    margin: 0 auto 20px;
}

.login-title { text-align: center; font-size: 16px; font-weight: 650; margin-bottom: 6px; line-height: 1.7; color: var(--text-dark); }
.login-sub   { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }

.login-footer-short {
    text-align: center;
    color: #98a2b3;
    font-size: 12px;
    font-weight: 500;
    margin-top: 22px;
    margin-bottom: 0;
}

.login-footer-long {
    text-align: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    font-weight: 400;
    margin-top: 18px;
    margin-bottom: 0;
    letter-spacing: 0;
}

/* ===================== BALANCE DISPLAY ===================== */
.balance-positive { color: var(--danger); font-weight: 700; }
.balance-negative { color: var(--success); font-weight: 700; }
.balance-zero     { color: var(--text-muted); font-weight: 600; }

/* ===================== CREDIT BAR ===================== */
.credit-bar-wrap { margin-top: 8px; }
.credit-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}
.credit-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--success), var(--info));
    transition: width .4s;
}
.credit-bar-fill.danger { background: linear-gradient(90deg, var(--warning), var(--danger)); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
        width: var(--sidebar-width) !important;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    body.sidebar-collapsed .sidebar {
        width: var(--sidebar-width) !important;
    }
    body.sidebar-collapsed .sidebar-brand .brand-name,
    body.sidebar-collapsed .sidebar-menu .menu-label,
    body.sidebar-collapsed .sidebar-menu li a .menu-text,
    body.sidebar-collapsed .sidebar-footer-text,
    body.sidebar-collapsed .sidebar-footer-logo {
        display: block;
    }
    body.sidebar-collapsed .sidebar-menu li a {
        justify-content: flex-start;
        padding: 11px 22px;
    }
    .main-wrapper {
        margin-right: 0 !important;
    }
    .topbar .btn-toggle-sidebar {
        display: block;
    }
    body.sidebar-collapsed .topbar .btn-toggle-sidebar {
        display: block;
    }
    .btn-sidebar-collapse {
        display: none;
    }
    .topbar { padding: 0 16px; }
    .content-area { padding: 18px; }
    .overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 999;
    }
    .overlay.show { display: block; }
    .pagination-wrapper { flex-direction: column; gap: 10px; align-items: flex-start; }
    .topbar .page-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .card-header { flex-wrap: wrap; gap: 10px; }
}

@media (max-width: 576px) {
    .content-area { padding: 14px; }
    .stat-card { padding: 16px; }
    .stat-icon { width: 48px; height: 48px; font-size: 20px; }
    .stat-info .stat-value { font-size: 20px; }
    .card-body { padding: 16px; }
    .card-header {
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 10px;
        align-items: flex-start;
    }
    .card-header h5 { font-size: 14px; }
    .card-header > .d-flex,
    .card-header > div:not(h5) {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-header .btn,
    .card-header a.btn { flex: 1 1 auto; justify-content: center; min-width: 0; }
    .card-body .form-select,
    .card-body .form-control,
    .card-body select.form-select,
    .card-body input.form-control {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }
    .card-body .d-flex { gap: 8px; }
    .data-table thead th, .data-table tbody td { padding: 10px 12px; font-size: 12px; }
    .topbar { padding: 0 12px; gap: 10px; }
    .topbar .user-name { display: none; }
    .topbar .page-title {
        font-size: 14px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .login-card { padding: 32px 20px; }
    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-sm { padding: 5px 10px; font-size: 11px; }
    .sub-items-table th,
    .sub-items-table td { white-space: normal; font-size: 11px; }
    .request-details-row td { padding: 10px !important; }
    .filter-toolbar > .form-select,
    .filter-toolbar > .form-control,
    .filter-toolbar > a.btn,
    .filter-toolbar > .btn,
    .card-toolbar > .btn,
    .card-toolbar > a.btn { width: 100%; }
    .filter-toolbar .search-box { width: 100%; }
    input.form-control,
    select.form-select,
    textarea.form-control,
    .portal-form-control,
    .portal-form-select { font-size: 16px; }
}

/* ===================== MISC ===================== */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }
.fw-bold { font-weight: 700 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 16px !important; }

.input-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.input-group .form-control {
    flex: 1 1 160px;
    min-width: 0;
}

.input-group .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.d-flex { display: flex !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.flex-wrap { flex-wrap: wrap !important; }

.row { display: flex; flex-wrap: wrap; margin: 0 -12px; max-width: 100%; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 12px; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding: 0 12px; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 12px; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; padding: 0 12px; }
.col-lg-3 { flex: 0 0 25%; max-width: 25%; padding: 0 12px; }
.col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; padding: 0 12px; }
.col-lg-6 { flex: 0 0 50%; max-width: 50%; padding: 0 12px; }
.col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; padding: 0 12px; }

@media (max-width: 992px) {
    .col-md-6, .col-md-4, .col-md-3,
    .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 576px) {
    .col-md-6, .col-md-4, .col-md-3,
    .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.mb-4 { margin-bottom: 24px; }
.mb-3 { margin-bottom: 16px; }
.ms-auto { margin-right: auto; }
.me-auto { margin-left: auto; }
.p-0 { padding: 0 !important; }
.w-100 { width: 100%; }

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.search-box {
    position: relative;
    display: inline-block;
}

.search-box input {
    padding-right: 38px;
    min-width: 0;
    max-width: 100%;
    width: 240px;
    background: #f8f9fb;
    height: 36px;
}

@media (max-width: 992px) {
    .search-box { width: 100%; }
    .search-box input { width: 100%; }
}

.search-box .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}

.number-fa { font-family: 'Vazirmatn', 'Tahoma', sans-serif; }

/* نام ستون‌های اکسل — بدون فونت monospace که فارسی را خراب می‌کند */
.excel-col-name {
    display: inline-block;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: #0f766e;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 2px 8px;
    margin: 0 2px;
    direction: rtl;
    unicode-bidi: embed;
    text-decoration: none;
}

/* انتخاب ستون PDF */
.pdf-col-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(15, 23, 42, 0.45);
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.pdf-col-modal.show { display: flex; }
.pdf-col-dialog {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
    direction: rtl;
}
.pdf-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
}
.pdf-col-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pdf-col-close {
    border: 0;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
}
.pdf-col-actions-top {
    display: flex;
    gap: 8px;
    padding: 12px 18px 0;
}
.pdf-col-list {
    padding: 12px 18px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pdf-col-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-size: 13px;
    margin: 0;
}
.pdf-col-item:hover { background: #f8fafc; }
.pdf-col-item input { width: 16px; height: 16px; accent-color: #0f766e; }
.pdf-col-footer {
    padding: 14px 18px 18px;
    border-top: 1px solid #e2e8f0;
}
.pdf-col-footer .btn { width: 100%; justify-content: center; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ── Jalali Datepicker ──────────────────────────────────────────────────── */
.jpick-popup {
    position: fixed;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(15,23,42,.12);
    width: 280px;
    z-index: 9999;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    padding: 14px;
    direction: rtl;
    -webkit-user-select: none;
    user-select: none;
}
.jpick-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.jpick-header-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}
.jpick-nav {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #475569;
    padding: 0;
    line-height: 1;
    transition: background .13s, border-color .13s;
}
.jpick-nav:hover { background: #f1f5f9; border-color: #94a3b8; }
.jpick-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.jpick-title-btn {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 6px;
    font-family: inherit;
    transition: background .13s;
}
.jpick-title-btn:hover { background: #f1f5f9; color: #1f6f64; }
.jpick-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.jpick-weekdays span {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    padding: 3px 0;
}
.jpick-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.jpick-cell {
    text-align: center;
    padding: 6px 0;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.4;
}
.jpick-day {
    cursor: pointer;
    color: #334155;
    transition: background .12s, color .12s;
}
.jpick-day:hover { background: #eef6f4; color: #1f6f64; }
.jpick-day.is-today { color: #1f6f64; font-weight: 700; background: #eef6f4; }
.jpick-day.is-sel,
.jpick-day.is-sel:hover { background: #1f6f64; color: #fff; font-weight: 700; }
.jpick-footer {
    margin-top: 10px;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
    display: flex;
    gap: 8px;
}
.jpick-today-btn,
.jpick-clear-btn {
    flex: 1;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 10px;
    font-family: inherit;
    font-size: 12px;
    color: #1f6f64;
    cursor: pointer;
    transition: background .13s;
}
.jpick-today-btn:hover { background: #eef6f4; }
.jpick-clear-btn { color: #667085; }
.jpick-clear-btn:hover { background: #f8f9fb; }

.date-field {
    position: relative;
    display: block;
    width: 100%;
}
.date-field input.jalali-date {
    width: 100%;
    padding-left: 40px;
    cursor: pointer;
    background-color: #fff;
}
.date-field-btn {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    border-radius: 6px;
}
.date-field-btn:hover { background: var(--primary-soft); }
.jpick-year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-top: 6px;
}
.jpick-ycell {
    text-align: center;
    padding: 7px 2px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    color: #334155;
    transition: background .12s;
}
.jpick-ycell:hover { background: #eef6f4; color: #1f6f64; }
.jpick-ycell.is-sel { background: #1f6f64; color: #fff; font-weight: 700; }
.jpick-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 6px;
}
.jpick-mcell {
    text-align: center;
    padding: 9px 2px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 12px;
    color: #334155;
    transition: background .12s;
}
.jpick-mcell:hover { background: #eef6f4; color: #1f6f64; }
.jpick-mcell.is-sel { background: #1f6f64; color: #fff; font-weight: 700; }

.rep-cat-list label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px 14px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}
.rep-cat-list input { margin: 0; }

@media (max-width: 576px) {
    .jpick-popup {
        width: min(280px, calc(100vw - 16px));
        max-width: calc(100vw - 16px);
    }
}

@media print {
    .sidebar, .topbar, .overlay, .no-print, .btn-sidebar-collapse, .btn-toggle-sidebar { display: none !important; }
    .main-wrapper { margin: 0 !important; }
    .content-area { padding: 0 !important; }
    body { background: white !important; }
    .card { box-shadow: none !important; break-inside: avoid; }
}

/* ===================== PWA INSTALL BANNER ===================== */
.pwa-install-bar {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    z-index: 10050;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
    direction: rtl;
    font-family: Vazirmatn, Tahoma, sans-serif;
}
.pwa-install-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f8fafc;
}
.pwa-install-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pwa-install-text strong {
    font-size: 13px;
    color: #0f172a;
}
.pwa-install-text span {
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}
.pwa-install-btn {
    border: none;
    border-radius: 10px;
    background: #1f6f64;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 9px 12px;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}
.pwa-install-close {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
}
@media (min-width: 901px) {
    .pwa-install-bar { display: none !important; }
}

.product-search-hidden { display: none !important; }

/* ===================== CRM extras ===================== */
.kanban-wrap { display:flex; gap:12px; overflow-x:auto; padding-bottom:12px; align-items:flex-start; }
.kanban-col { min-width:240px; max-width:260px; background:#f8f9fb; border:1px solid var(--border); border-radius:10px; padding:12px; flex:1; transition: border-color .15s, background .15s; }
.kanban-col.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.kanban-col h4 { margin:0 0 12px; font-size:12.5px; font-weight:600; display:flex; justify-content:space-between; align-items:center; color:#475467; }
.kanban-drop { min-height: 48px; }
.kanban-card { background:#fff; border-radius:8px; padding:12px; margin-bottom:10px; border:1px solid var(--border); box-shadow:none; display:block; color:inherit; text-decoration:none; cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: .55; }
.kanban-card:hover { border-color:#cfe0db; box-shadow:var(--shadow); }
.kanban-card .kc-title { font-weight:700; font-size:13px; margin-bottom:4px; display:block; color: var(--text-dark); text-decoration: none; }
.kanban-card .kc-title:hover { color: var(--primary); text-decoration: none; }
.kanban-card .kc-meta { color:var(--text-muted); font-size:11px; line-height:1.6; }
.kanban-card .kc-drag-hint { margin-top:8px; font-size:10px; color:#98a2b3; }
.pipe-modal { position:fixed; inset:0; background:rgba(11,28,44,.45); z-index:30000; display:flex; align-items:center; justify-content:center; padding:16px; }
.pipe-modal[hidden] { display:none !important; }
.price-input { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }

.recent-opp-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
}
.recent-opp-link:hover {
    color: var(--primary);
    text-decoration: none;
}
.timeline { border-right:2px solid #e2e8f0; padding-right:18px; margin-right:8px; }
.timeline-item { position:relative; padding-bottom:16px; }
.timeline-item:before { content:''; position:absolute; right:-23px; top:6px; width:10px; height:10px; border-radius:50%; background:var(--primary); }
.tab-bar { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; }
.tab-bar a, .tab-bar .tab-btn { padding:8px 14px; border-radius:10px; background:#f1f5f9; color:#334155; text-decoration:none; font-size:13px; font-weight:600; }
.tab-bar a.active, .tab-bar .tab-btn.active { background:var(--primary); color:#fff; }
.profile-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 18px; }
@media (max-width:768px) { .profile-grid { grid-template-columns:1fr; } }
.kv { font-size:13px; }
.kv b { display:block; color:var(--text-muted); font-size:11px; font-weight:600; margin-bottom:2px; }
.lost-box { background:#fff7ed; border:1px solid #fed7aa; border-radius:12px; padding:14px; margin-top:12px; }
.filter-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.filter-toolbar .form-control, .filter-toolbar .form-select { width:auto; min-width:140px; }
.badge-overdue { background:#fee2e2; color:#991b1b; }
.badge-today { background:#fef3c7; color:#92400e; }
.sub-card { background:#f8fafc; border:1px dashed #cbd5e1; border-radius:12px; padding:14px; margin-top:12px; }
.login-hint { background:#f8f9fb; border:1px solid var(--border); border-radius:8px; padding:10px 12px; margin-top:16px; font-size:11px; color:#667085; line-height:1.7; }
.notify-bell { position:relative; color:#475467; font-size:18px; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; width:36px; height:36px; border:1px solid var(--border); border-radius:8px; background:#fff; }
.notify-bell:hover { color:var(--primary); border-color:#cfe0db; background:var(--primary-soft); }
.notify-bell .badge-count {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 18px;
    height: 18px;
    min-width: 18px;
    padding: 0 0 1px;
    margin: 0;
    background: #dc2626;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
    direction: ltr;
    letter-spacing: 0;
    box-shadow: 0 0 0 1px rgba(220,38,38,.25);
}
.tag-checks label { margin-left:14px; margin-left:0; margin-right:12px; font-size:13px; }
.crm-tag { display:inline-block; color:#fff; border-radius:999px; padding:2px 10px; font-size:11px; font-weight:600; margin-left:4px; }
.cal-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.cal-head { text-align:center; font-weight:700; font-size:12px; color:#64748b; }
.cal-day { background:#fff; border:1px solid var(--border); border-radius:12px; min-height:96px; padding:8px; transition: border-color .15s, background .15s; }
.cal-day.empty { background:transparent; border:none; }
.cal-day.today { border-color:var(--primary); box-shadow:0 0 0 2px rgba(31,111,100,.15); }
.cal-day.overdue { background:#fff7ed; }
.cal-day.drag-over { border-color: var(--primary); background: var(--primary-soft); }
.cal-num { font-weight:700; font-size:13px; margin-bottom:4px; }
.cal-drop { min-height: 28px; max-height: 140px; overflow-y: auto; }
.cal-item { display:block; font-size:11px; color:#334155; text-decoration:none; background:#eef2ff; border-radius:6px; padding:3px 6px; margin-top:4px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor: grab; }
.cal-item:active { cursor: grabbing; }
.cal-item.dragging { opacity: .5; }
.cal-item:hover { background:#c7d2fe; }
.cal-item-title { color: inherit; text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; }

.help-layout { display:grid; grid-template-columns: 240px minmax(0,1fr); gap:24px; align-items:start; }
.help-toc { position:sticky; top:16px; background:#fff; border:1px solid var(--border); border-radius:12px; padding:16px; max-height:calc(100vh - 120px); overflow:auto; }
.help-toc h4 { margin:0 0 10px; font-size:14px; }
.help-toc a { display:block; font-size:13px; color:#334155; text-decoration:none; padding:6px 8px; border-radius:8px; }
.help-toc a:hover { background:var(--primary-soft); color:var(--primary); }
.help-doc h2 { font-size:20px; margin:28px 0 12px; color:var(--text-dark); scroll-margin-top:18px; }
.help-doc h3 { font-size:16px; margin:18px 0 8px; }
.help-doc p, .help-doc li { font-size:14px; line-height:1.9; color:#334155; }
.help-doc ul, .help-doc ol { padding-right:18px; }
.help-box { border-radius:12px; padding:14px 16px; margin:12px 0; }
.help-box.warn { background:#fff7ed; border:1px solid #fdba74; }
.help-box.ok { background:#ecfdf5; border:1px solid #6ee7b7; }
.help-box.info { background:#eff6ff; border:1px solid #93c5fd; }
.help-k { display:inline-block; background:#f1f5f9; border:1px solid #e2e8f0; border-radius:6px; padding:1px 8px; font-size:12px; }
@media (max-width: 900px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-toc { position:static; max-height:none; }
}
