/* ============================================================
   PMS Local Overrides
   - Local Arabic font (Noto Sans Arabic)
   - Override Google Fonts imports
   - RTL & Arabic UX tweaks
   ============================================================ */

@font-face {
    font-family: 'NotoSansArabic';
    src: url('/static/assets/fonts/NotoSansArabic.ttf') format('truetype');
    font-weight: 100 900;
    font-display: swap;
}

/* Override entire font stack to use Arabic font + fallbacks */
:root {
    --bs-body-font-family: 'NotoSansArabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
    --pe-font-sans-serif: 'NotoSansArabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

body,
.form-control,
.form-select,
.btn,
.card,
.nav-link,
.table,
.badge,
.alert,
input,
textarea,
select {
    font-family: 'NotoSansArabic', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

/* ── Status badge colors ── */
.badge-status-pending    { background-color: #f7b84b; color: #000; }
.badge-status-approved   { background-color: #0ab39c; color: #fff; }
.badge-status-rejected   { background-color: #f06548; color: #fff; }
.badge-status-draft      { background-color: #74788d; color: #fff; }
.badge-status-paid       { background-color: #299cdb; color: #fff; }
.badge-status-delivered  { background-color: #405189; color: #fff; }
.badge-status-cancelled  { background-color: #adb5bd; color: #000; }

/* ── Table improvements ── */
.table th {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.table td {
    font-size: 13.5px;
    vertical-align: middle;
}

/* ── Form improvements ── */
.form-label {
    font-weight: 600;
    font-size: 13px;
    color: #495057;
    margin-bottom: 4px;
}
.form-control:focus,
.form-select:focus {
    border-color: #405189;
    box-shadow: 0 0 0 0.2rem rgba(64, 81, 137, 0.15);
}
.form-text {
    font-size: 12px;
    color: #74788d;
}

/* ── Card header ── */
.card-header {
    background: transparent;
    border-bottom: 1px solid #e9ebec;
    padding: 1rem 1.25rem;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
}

/* ── Page title ── */
.page-title-box h4 {
    font-size: 17px;
    font-weight: 700;
}

/* ── Amount display ── */
.amount-sar {
    font-weight: 700;
    color: #405189;
    font-size: 1.05em;
}
.amount-sar::after {
    content: ' ريال';
    font-size: 0.85em;
    color: #74788d;
    font-weight: 400;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #74788d;
}
.empty-state i {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.4;
}
.empty-state p {
    font-size: 14px;
    margin: 0;
}

/* ── Toast notification ── */
#pms-toast-container {
    position: fixed;
    top: 80px;
    left: 24px;
    z-index: 9999;
    width: 320px;
}
[dir="rtl"] #pms-toast-container {
    left: auto;
    right: 24px;
}
.pms-toast {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: pms-toast-in .25s ease;
}
.pms-toast.success { background:#d1fae5; border-right:4px solid #059669; color:#065f46; }
.pms-toast.error   { background:#fee2e2; border-right:4px solid #dc2626; color:#991b1b; }
.pms-toast.info    { background:#dbeafe; border-right:4px solid #2563eb; color:#1e40af; }
.pms-toast.warning { background:#fef9c3; border-right:4px solid #d97706; color:#92400e; }

@keyframes pms-toast-in {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Page header breadcrumb ── */
.page-title-box {
    padding-bottom: 16px;
    margin-bottom: 4px;
}

/* ── Action buttons row ── */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

/* ── Dashboard cards ── */
.dash-card {
    transition: transform .15s ease, box-shadow .15s ease;
    cursor: pointer;
}
.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.10) !important;
}
.dash-card-warning {
    border-right: 4px solid #f7b84b !important;
}
.fs-dash-label {
    font-size: 11px;
    letter-spacing: .04em;
}

/* ── Action Required card ── */
.dash-action-card {
    border: 1px solid #fde68a !important;
}
.dash-action-header {
    background: #fffbeb;
    border-bottom: 1px solid #fde68a;
}

/* ── Status dot in summary list ── */
.dash-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Hide sidebar toggle button on desktop (sidebar is always open) ── */
@media (min-width: 1024px) {
    #pmsSidebarToggle { display: none !important; }
}

/* ── Sidebar icon mode: hide text labels, section titles, arrows ── */
[data-sidebar="icon"] .pe-menu-title {
    display: none !important;
}
[data-sidebar="icon"] .pe-nav-content {
    display: none !important;
}
[data-sidebar="icon"] .pe-nav-arrow {
    display: none !important;
}
[data-sidebar="icon"] .pe-app-sidebar-logo {
    justify-content: center;
}
[data-sidebar="icon"] .pe-app-sidebar-logo img {
    max-width: 36px !important;
}

/* ── Sidebar backdrop (mobile overlay) ── */
#sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 998;
    cursor: pointer;
}
#sidebar-backdrop.show {
    display: block;
}

/* On mobile: sidebar slides over content */
@media (max-width: 1023px) {
    #sidebar.show {
        z-index: 999;
    }
}


    @page {
        margin: 1.2cm;
    }
}

