/*
 * Mess theme - purple (বেগুনি) with gradients.
 * Loaded last in admin/layouts/master.blade.php and in border/layout.blade.php,
 * so it wins over the boilerplate's blue/navy. Views use the --mt-* tokens
 * instead of hard-coded colours; change the palette here and everything follows.
 *
 * Semantic colours are deliberately NOT purple: green = advance / deposit,
 * red = due / cost stay as they are so balances still read at a glance.
 */
:root {
    --mt-950: #1e0b3b;
    --mt-900: #2e1065;
    --mt-800: #4c1d95;
    --mt-700: #5b21b6;
    --mt-600: #6d28d9;
    --mt-500: #7c3aed;
    --mt-400: #8b5cf6;
    --mt-300: #a78bfa;
    --mt-200: #ddd6fe;
    --mt-100: #ede9fe;
    --mt-pink: #c026d3;
    --mt-rose: #db2777;

    --mt-grad: linear-gradient(125deg, #3b0764 0%, #6d28d9 55%, #a855f7 100%);
    --mt-grad-money: linear-gradient(125deg, #4c1d95 0%, #7c3aed 60%, #a78bfa 100%);
    --mt-grad-rice: linear-gradient(125deg, #7e22ce 0%, #c026d3 60%, #ec4899 100%);
    --mt-grad-btn: linear-gradient(135deg, #6d28d9, #9333ea);
    --mt-grad-sidebar: linear-gradient(180deg, #1e0b3b 0%, #2e1065 55%, #3b0764 100%);
    --mt-soft: rgba(124, 58, 237, .1);
    --mt-soft-rice: rgba(192, 38, 211, .1);
    --mt-shadow: rgba(76, 29, 149, .55);

    /* Bootstrap primary -> purple */
    --bs-primary: #6d28d9;
    --bs-primary-rgb: 109, 40, 217;
    --bs-link-color: #6d28d9;
    --bs-link-color-rgb: 109, 40, 217;
    --bs-link-hover-color: #5b21b6;
    --bs-link-hover-color-rgb: 91, 33, 182;
}

html[data-bs-theme="dark"] {
    --bs-link-color: #a78bfa;
    --bs-link-color-rgb: 167, 139, 250;
    --bs-link-hover-color: #c4b5fd;
    --mt-soft: rgba(139, 92, 246, .16);
    --mt-soft-rice: rgba(217, 70, 239, .15);
}

/* ---- Buttons / badges / text ------------------------------------------ */
.btn-primary {
    --bs-btn-bg: #6d28d9; --bs-btn-border-color: #6d28d9;
    --bs-btn-hover-bg: #5b21b6; --bs-btn-hover-border-color: #5b21b6;
    --bs-btn-active-bg: #4c1d95; --bs-btn-active-border-color: #4c1d95;
    --bs-btn-disabled-bg: #8b5cf6; --bs-btn-disabled-border-color: #8b5cf6;
    background-image: var(--mt-grad-btn);
    border: 0;
    box-shadow: 0 8px 20px -12px var(--mt-shadow);
}
.btn-primary:hover { background-image: linear-gradient(135deg, #5b21b6, #7e22ce); }
.btn-outline-primary {
    --bs-btn-color: #6d28d9; --bs-btn-border-color: #8b5cf6;
    --bs-btn-hover-bg: #6d28d9; --bs-btn-hover-border-color: #6d28d9; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #5b21b6; --bs-btn-active-border-color: #5b21b6;
}
html[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #c4b5fd; --bs-btn-border-color: #7c3aed; }
.bg-primary { background: var(--mt-grad-btn) !important; }
.text-primary { color: #7c3aed !important; }
html[data-bs-theme="dark"] .text-primary { color: #a78bfa !important; }
.bg-light-primary { background-color: var(--mt-soft) !important; }
.border-primary { border-color: #8b5cf6 !important; }

.nav-pills { --bs-nav-pills-link-active-bg: #6d28d9; }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--mt-grad-btn); box-shadow: 0 8px 18px -12px var(--mt-shadow); }
.nav-pills .nav-link:not(.active) { color: var(--bs-link-color); }

.pagination { --bs-pagination-active-bg: #6d28d9; --bs-pagination-active-border-color: #6d28d9; --bs-pagination-color: #6d28d9; }

.form-check-input:checked { background-color: #7c3aed; border-color: #7c3aed; }
.form-control:focus, .form-select:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 .2rem rgba(124, 58, 237, .18);
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background-color: #7c3aed !important; }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single { border-color: #a78bfa !important; }

/* ---- Admin chrome: sidebar + header ------------------------------------ */
html .sidebar-wrapper,
html.semi-dark .sidebar-wrapper,
html.semi-dark .sidebar-wrapper .sidebar-header,
html .sidebar-wrapper .sidebar-header {
    background: var(--mt-grad-sidebar);
    border-color: rgba(255, 255, 255, .06);
}
html.semi-dark .sidebar-wrapper .sidebar-header { background: #1e0b3b; border-bottom-color: rgba(255, 255, 255, .08); }
html .sidebar-wrapper .metismenu a,
html.semi-dark .sidebar-wrapper .metismenu a { color: #ddd6fe; }
html .sidebar-wrapper .metismenu ul a,
html.semi-dark .sidebar-wrapper .metismenu ul a { color: #c4b5fd; }
html .sidebar-wrapper .menu-label,
html.semi-dark .sidebar-wrapper .menu-label { color: #a78bfa; opacity: .8; }
html .sidebar-wrapper .toggle-icon,
html.semi-dark .sidebar-wrapper .toggle-icon { color: #ede9fe; }

html .sidebar-wrapper .metismenu .mm-active > a,
html .sidebar-wrapper .metismenu a:hover,
html .sidebar-wrapper .metismenu a:focus,
html .sidebar-wrapper .metismenu a:active,
html.semi-dark .sidebar-wrapper .metismenu .mm-active > a,
html.semi-dark .sidebar-wrapper .metismenu a:hover,
html.semi-dark .sidebar-wrapper .metismenu a:focus,
html.semi-dark .sidebar-wrapper .metismenu a:active {
    color: #fff;
    background: linear-gradient(90deg, rgba(167, 139, 250, .28), rgba(167, 139, 250, .06));
    border-left: 4px solid #c084fc;
    box-shadow: none;
}
html .sidebar-wrapper .metismenu ul .mm-active > a,
html.semi-dark .sidebar-wrapper .metismenu ul .mm-active > a { background: rgba(255, 255, 255, .08); }

.page-breadcrumb .breadcrumb-title { color: var(--mt-700); font-weight: 600; }
html[data-bs-theme="dark"] .page-breadcrumb .breadcrumb-title { color: #c4b5fd; }

.top-header .navbar { border-bottom: 3px solid transparent; border-image: var(--mt-grad) 1; }

/* Pending meal-off request badge in the sidebar */
.mill-pulse { box-shadow: 0 0 0 0 rgba(220, 53, 69, .6); animation: mill-pulse 1.8s infinite; }
@keyframes mill-pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, .55); }
    70% { box-shadow: 0 0 0 8px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
@media (prefers-reduced-motion: reduce) { .mill-pulse { animation: none; } }

/* ---- Tables: soft purple header ---------------------------------------- */
.table-light, .table > thead.table-light > tr > th { --bs-table-bg: #f5f3ff; --bs-table-color: #3b0764; }
html[data-bs-theme="dark"] .table-light, html[data-bs-theme="dark"] .table > thead.table-light > tr > th { --bs-table-bg: #251541; --bs-table-color: #ede9fe; }
