/* ===== سامانه حضور و غیاب داتیس — استایل سفارشی RTL ===== */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

:root {
    --datees-primary: #AC44A1;
    --datees-primary-dark: #8d3384;
    --datees-primary-light: #f7ebf6;
}

body, h1, h2, h3, h4, h5, h6, p, a, span, div, td, th, input, select, textarea, button, label {
    font-family: 'Vazirmatn', 'Montserrat', sans-serif !important;
}

body.rtl {
    direction: rtl;
    text-align: right;
}

/* رنگ اصلی بنفش/ماژنتا */
.btn-primary,
.badge-primary,
.bg-primary,
.page-main-header {
    background-color: var(--datees-primary) !important;
    border-color: var(--datees-primary) !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--datees-primary-dark) !important;
    border-color: var(--datees-primary-dark) !important;
}

.btn-outline-primary {
    color: var(--datees-primary) !important;
    border-color: var(--datees-primary) !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background-color: var(--datees-primary) !important;
    color: #fff !important;
}

.text-primary, a.text-primary:hover { color: var(--datees-primary) !important; }

.font-primary { color: var(--datees-primary) !important; }

.card { border-radius: 12px; border: 1px solid #ecebf3; }

.dark-only .card, body.dark-only .card { border-color: #374558; }

/* ===== سایدبار ===== */
.datees-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 260px;
    background: #fff;
    border-left: 1px solid #ecebf3;
    overflow-y: auto;
    z-index: 1030;
    transition: transform .25s ease;
    padding-bottom: 40px;
}

.datees-sidebar .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    font-weight: 700;
    font-size: 16px;
    color: var(--datees-primary);
    border-bottom: 1px solid #f1eef5;
}

.datees-sidebar .nav-section {
    font-size: 11px;
    color: #999;
    padding: 14px 22px 4px;
}

.datees-sidebar a.side-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 22px;
    color: #3d434a;
    font-size: 13.5px;
    text-decoration: none;
    border-right: 3px solid transparent;
}

.datees-sidebar a.side-link:hover { background: var(--datees-primary-light); color: var(--datees-primary); }

.datees-sidebar a.side-link.active {
    background: var(--datees-primary-light);
    color: var(--datees-primary);
    border-right-color: var(--datees-primary);
    font-weight: 600;
}

.datees-sidebar a.side-sub {
    padding-right: 48px;
    font-size: 12.5px;
}

.datees-content {
    margin-right: 260px;
    min-height: 100vh;
    background: #f6f7fb;
    transition: margin .25s ease;
}

body.sidebar-collapsed .datees-sidebar { transform: translateX(100%); }
body.sidebar-collapsed .datees-content { margin-right: 0; }

.datees-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border-bottom: 1px solid #ecebf3;
    padding: 12px 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.datees-topbar .company-name { font-weight: 700; color: #333; }

.datees-page { padding: 24px; }

@media (max-width: 991px) {
    .datees-sidebar { transform: translateX(100%); }
    .datees-content { margin-right: 0; }
    body.sidebar-open .datees-sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.2); }
}

/* ===== تم تیره ===== */
body.theme-dark .datees-content { background: #1b2531; }
body.theme-dark .datees-sidebar,
body.theme-dark .datees-topbar,
body.theme-dark .card,
body.theme-dark .modal-content { background: #232f3e; border-color: #374558; }
body.theme-dark,
body.theme-dark .card,
body.theme-dark p, body.theme-dark td, body.theme-dark th,
body.theme-dark label, body.theme-dark .company-name,
body.theme-dark h1, body.theme-dark h2, body.theme-dark h3,
body.theme-dark h4, body.theme-dark h5, body.theme-dark h6 { color: #d5dce5; }
body.theme-dark .datees-sidebar a.side-link { color: #b8c2cf; }
body.theme-dark .datees-sidebar a.side-link:hover,
body.theme-dark .datees-sidebar a.side-link.active { background: rgba(172, 68, 161, .15); color: #e491da; }
body.theme-dark .form-control, body.theme-dark .custom-select, body.theme-dark select.form-control {
    background: #1b2531; border-color: #374558; color: #d5dce5;
}
body.theme-dark .table { color: #d5dce5; }
body.theme-dark .table thead th { background: #1f2937; border-color: #374558; }
body.theme-dark .table td, body.theme-dark .table th { border-color: #374558; }
body.theme-dark .list-group-item { background: #232f3e; border-color: #374558; color: #d5dce5; }
body.theme-dark .jdp-popup { background: #232f3e; border-color: #374558; color: #d5dce5; }
body.theme-dark .sce-month { background: #232f3e; }
body.theme-dark .app-confirm { background: #232f3e; }

/* ===== جدول‌ها ===== */
.table thead th {
    background: #faf7fb;
    font-size: 12.5px;
    white-space: nowrap;
}

.table td { vertical-align: middle; font-size: 13px; }

/* ===== Date Picker جلالی ===== */
.jdp-popup {
    position: absolute;
    z-index: 2000;
    background: #fff;
    border: 1px solid #e3dced;
    border-radius: 10px;
    box-shadow: 0 10px 35px rgba(60, 30, 60, .18);
    width: 268px;
    padding: 10px;
    direction: rtl;
}

.jdp-header { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }

.jdp-header select {
    flex: 1;
    border: 1px solid #e6e0ee;
    border-radius: 6px;
    padding: 4px;
    font-size: 12px;
    background: #fff;
}

.jdp-nav {
    border: 1px solid #e6e0ee;
    background: #fff;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    cursor: pointer;
}

.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.jdp-weekday { text-align: center; font-size: 11px; color: #a08aab; padding: 3px 0; }

.jdp-day {
    border: none;
    background: transparent;
    border-radius: 7px;
    padding: 5px 0;
    font-size: 12.5px;
    cursor: pointer;
}

.jdp-day:hover { background: var(--datees-primary-light); }
.jdp-friday { color: #d63031; }
.jdp-today { border: 1px solid var(--datees-primary); }
.jdp-selected { background: var(--datees-primary) !important; color: #fff !important; }

.jdp-footer { display: flex; justify-content: space-between; margin-top: 8px; }

.jdp-action {
    border: none;
    background: transparent;
    color: var(--datees-primary);
    font-size: 12px;
    cursor: pointer;
}

/* ===== Toast ===== */
.app-toasts {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.app-toast {
    background: #333;
    color: #fff;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    opacity: 0;
    transform: translateY(12px);
    transition: all .3s ease;
    max-width: 340px;
}

.app-toast.show { opacity: 1; transform: none; }
.app-toast-success { background: #1f9d61; }
.app-toast-error { background: #d63031; }
.app-toast-warning { background: #cf9016; }

/* ===== Confirm Modal ===== */
.app-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 10, 25, .45);
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-confirm { background: #fff; border-radius: 12px; padding: 22px; width: 340px; text-align: center; }
.app-confirm-message { margin-bottom: 16px; font-size: 14px; }
.app-confirm-actions { display: flex; gap: 8px; justify-content: center; }

/* ===== ادیتور تقویم شیفت ===== */
.sce-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }

.sce-month { padding: 10px; }

.sce-month-title { text-align: center; font-weight: 700; font-size: 13px; margin-bottom: 8px; color: var(--datees-primary); }

.sce-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.sce-weekday { text-align: center; font-size: 10px; color: #999; }

.sce-day {
    border: 1px solid transparent;
    background: #f1f2f6;
    border-radius: 6px;
    font-size: 11.5px;
    padding: 5px 0;
    cursor: pointer;
    color: #444;
}

.sce-undefined { background: #f1f2f6; color: #999; }
.sce-working { background: #d9f2e5; color: #14734a; }
.sce-night { background: #e6dcf5; color: #5b3d91; }
.sce-off { background: #fde3e3; color: #b33; }
.sce-friday { outline: 1px dashed #e5b9b9; }
.sce-selected { border-color: var(--datees-primary); box-shadow: 0 0 0 2px rgba(172, 68, 161, .35); }

.sce-selection-info { font-size: 12px; color: var(--datees-primary); font-weight: 600; }

.sce-legend { display: flex; gap: 14px; font-size: 11.5px; margin: 8px 0; flex-wrap: wrap; }
.sce-legend span { display: inline-flex; align-items: center; gap: 5px; }
.sce-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ===== فرم‌ها ===== */
.required-star::after { content: ' *'; color: #d63031; }

.form-help { font-size: 11.5px; color: #8a94a6; margin-top: 3px; }

.invalid-feedback { display: block; font-size: 11.5px; }

/* Empty state */
.empty-state { text-align: center; padding: 46px 16px; color: #97a1b2; }
.empty-state i { font-size: 42px; display: block; margin-bottom: 10px; opacity: .5; }

/* آمار داشبورد */
.stat-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.stat-card .stat-icon {
    width: 46px; height: 46px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--datees-primary-light); color: var(--datees-primary); font-size: 20px;
}
.stat-card .stat-value { font-size: 21px; font-weight: 700; }
.stat-card .stat-label { font-size: 12px; color: #8a94a6; }

/* نقشه */
#workplace-map { height: 380px; border-radius: 10px; z-index: 1; }

/* چاپ */
@media print {
    .datees-sidebar, .datees-topbar, .no-print { display: none !important; }
    .datees-content { margin: 0 !important; }
}

.pagination { direction: ltr; }

/* برچسب‌های badge فارسی */
.badge { font-weight: 500; padding: 5px 9px; }

.badge-success { background: #1f9d61; color: #fff; }
.badge-danger { background: #d63031; color: #fff; }
.badge-warning { background: #cf9016; color: #fff; }
.badge-info { background: #1e87c7; color: #fff; }
.badge-primary { background: var(--datees-primary); color: #fff; }
.badge-secondary { background: #6c757d; color: #fff; }
.badge-light { background: #eef0f4; color: #555; }
