/* =========================================================================
   M C B EASY OFFICE 9.0 — "Professional" screen style
   Loaded after app.css when Settings > Theme > Screen style = professional.
   Everything is scoped to html[data-ui="pro"], so "classic" is untouched.
   ========================================================================= */
html[data-ui="pro"] {
  --grid: #C9CED6;            /* Excel-like cell border */
  --grid-strong: #A9B0BB;
  --grid-head: #EEF1F5;       /* column header fill */
  --cell-focus: #107C41;      /* Excel green selection */
  --cell-bg: #FFFFFF;
  --cell-ro: #F3F4F6;         /* read-only cell */
  --label: #44546A;
  --radius: 6px; --radius-sm: 3px;
  --g-blue: linear-gradient(135deg, #2563EB, #4F46E5);
  --g-green: linear-gradient(135deg, #16A34A, #0D9488);
  --g-red: linear-gradient(135deg, #DC2626, #E11D48);
  --g-amber: linear-gradient(135deg, #F59E0B, #EA580C);
  --g-teal: linear-gradient(135deg, #0D9488, #0891B2);
  --g-violet: linear-gradient(135deg, #7C3AED, #DB2777);
  --g-slate: linear-gradient(135deg, #475569, #1E293B);
}
html[data-ui="pro"][data-bs-theme="dark"] {
  --grid: #2B3650; --grid-strong: #3B4866; --grid-head: #16213A; --cell-bg: #0E1628; --cell-ro: #131D33;
  --label: #A8B3C7; --cell-focus: #22C55E;
}

/* ---------- moving colours ---------- */
@keyframes pro-flow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes pro-shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(260%) skewX(-20deg); } }
@keyframes pro-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .55); } 50% { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); } }

html[data-ui="pro"] .app-topbar::after {
  height: 3px; opacity: 1; background-size: 300% 100%; animation: pro-flow 9s ease infinite;
  background-image: linear-gradient(90deg, #4F46E5, #2563EB, #0D9488, #16A34A, #F59E0B, #EA580C, #DB2777, #7C3AED, #4F46E5);
}
html[data-ui="pro"] .app-sidebar .brand-logo { background: linear-gradient(135deg, #4F46E5, #0D9488, #DB2777); background-size: 300% 300%; animation: pro-flow 8s ease infinite; }
html[data-ui="pro"] .dept-hero { background-size: 220% 220%; animation: pro-flow 14s ease infinite;
  background-image: linear-gradient(120deg, var(--dept), color-mix(in srgb, var(--dept) 55%, #7C3AED), color-mix(in srgb, var(--dept) 60%, #0F172A), var(--dept)); }
html[data-ui="pro"] .tb-btn .count, html[data-ui="pro"] .side-link .badge.bg-danger { animation: pro-pulse 2.2s ease-in-out infinite; }
html[data-ui="pro"] .auth-art { background-size: 240% 240% !important; animation: pro-flow 16s ease infinite; }

/* ---------- buttons: every button has a colour ---------- */
html[data-ui="pro"] .btn {
  --pg: var(--g-slate);
  position: relative; overflow: hidden; border-radius: 4px; font-weight: 600; letter-spacing: .1px;
  border: 1px solid transparent; transition: transform .08s ease, box-shadow .15s ease, filter .15s ease;
}
html[data-ui="pro"] .btn-sm { border-radius: 3px; }
/* solid (filled) buttons get a gradient and a light sweep on hover */
html[data-ui="pro"] :is(.btn-dept, .btn-primary, .btn-success, .btn-approve, .btn-danger, .btn-warning, .btn-info, .btn-secondary, .btn-dark) {
  background-image: var(--pg); background-size: 200% 200%; background-color: transparent; color: #fff !important; border-color: transparent;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .18), inset 0 1px 0 rgba(255, 255, 255, .18);
}
html[data-ui="pro"] :is(.btn-dept, .btn-primary, .btn-success, .btn-approve, .btn-danger, .btn-warning, .btn-info, .btn-secondary, .btn-dark)::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 35%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); transform: translateX(-120%) skewX(-20deg);
}
html[data-ui="pro"] :is(.btn-dept, .btn-primary, .btn-success, .btn-approve, .btn-danger, .btn-warning, .btn-info, .btn-secondary, .btn-dark):hover::after { animation: pro-shine .7s ease; }
html[data-ui="pro"] :is(.btn-dept, .btn-primary, .btn-success, .btn-approve, .btn-danger, .btn-warning, .btn-info, .btn-secondary, .btn-dark):hover {
  animation: pro-flow 3s ease infinite; filter: saturate(1.15) brightness(1.04); box-shadow: 0 4px 12px rgba(15, 23, 42, .22);
}
html[data-ui="pro"] .btn:active { transform: translateY(1px); }
html[data-ui="pro"] .btn-dept { --pg: linear-gradient(135deg, var(--dept), color-mix(in srgb, var(--dept) 55%, #7C3AED), var(--dept)); }
html[data-ui="pro"] .btn-primary { --pg: var(--g-blue); }
html[data-ui="pro"] :is(.btn-success, .btn-approve) { --pg: var(--g-green); }
html[data-ui="pro"] .btn-danger { --pg: var(--g-red); }
html[data-ui="pro"] .btn-warning { --pg: var(--g-amber); }
html[data-ui="pro"] .btn-info { --pg: var(--g-teal); }
html[data-ui="pro"] :is(.btn-secondary, .btn-dark) { --pg: var(--g-slate); }

/* outline / light buttons: tinted fill in the colour of what they do */
html[data-ui="pro"] :is(.btn-outline-secondary, .btn-light, .btn-outline-dept, .btn-outline-primary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark) {
  --c: #475569; color: var(--c) !important; background: color-mix(in srgb, var(--c) 9%, var(--card-bg)); border-color: color-mix(in srgb, var(--c) 45%, transparent) !important;
}
html[data-ui="pro"] :is(.btn-outline-secondary, .btn-light, .btn-outline-dept, .btn-outline-primary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark):hover,
html[data-ui="pro"] :is(.btn-outline-secondary, .btn-light, .btn-outline-dept, .btn-outline-primary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info, .btn-outline-dark).active {
  color: #fff !important; background: var(--c); border-color: var(--c) !important; box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 35%, transparent);
}
html[data-ui="pro"] .btn-outline-dept { --c: var(--dept); }
html[data-ui="pro"] .btn-outline-primary { --c: #2563EB; }
html[data-ui="pro"] .btn-outline-success { --c: #16A34A; }
html[data-ui="pro"] .btn-outline-danger { --c: #DC2626; }
html[data-ui="pro"] .btn-outline-warning { --c: #D97706; }
html[data-ui="pro"] .btn-outline-info { --c: #0891B2; }
/* colour by the action's icon (works for every grey button in the app) */
html[data-ui="pro"] .btn:has(> .bi-plus-lg, > .bi-plus, > .bi-file-earmark-plus, > .bi-person-plus, > .bi-calendar-plus, > .bi-envelope-plus) { --c: #16A34A; --pg: var(--g-green); }
html[data-ui="pro"] .btn:has(> .bi-pencil, > .bi-pencil-square, > .bi-wrench-adjustable) { --c: #D97706; }
html[data-ui="pro"] .btn:has(> .bi-check2, > .bi-check2-circle, > .bi-check-lg, > .bi-person-check, > .bi-send-check, > .bi-save) { --c: #16A34A; }
html[data-ui="pro"] .btn:has(> .bi-x, > .bi-x-lg, > .bi-x-circle, > .bi-trash, > .bi-trash3, > .bi-slash-circle) { --c: #DC2626; }
html[data-ui="pro"] .btn:has(> .bi-file-earmark-excel, > .bi-table, > .bi-filetype-csv) { --c: #107C41; }
html[data-ui="pro"] .btn:has(> .bi-file-earmark-pdf, > .bi-file-pdf) { --c: #B91C1C; }
html[data-ui="pro"] .btn:has(> .bi-printer) { --c: #334155; }
html[data-ui="pro"] .btn:has(> .bi-send, > .bi-envelope, > .bi-box-arrow-up-right) { --c: #2563EB; }
html[data-ui="pro"] .btn:has(> .bi-eye, > .bi-search, > .bi-funnel, > .bi-journal-text, > .bi-list-check) { --c: #0891B2; }
html[data-ui="pro"] .btn:has(> .bi-upload, > .bi-download, > .bi-box-arrow-in-down, > .bi-cloud-arrow-up) { --c: #7C3AED; }
html[data-ui="pro"] .btn:has(> .bi-arrow-return-left, > .bi-arrow-counterclockwise, > .bi-arrow-repeat) { --c: #EA580C; }
html[data-ui="pro"] .btn:has(> .bi-chevron-left, > .bi-chevron-right, > .bi-three-dots, > .bi-three-dots-vertical, > .bi-arrow-left) { --c: #64748B; }
html[data-ui="pro"] .btn-link { background: none !important; border-color: transparent !important; box-shadow: none !important; }
html[data-ui="pro"] .btn:disabled, html[data-ui="pro"] .btn.disabled { filter: grayscale(.7); opacity: .55; }

/* ---------- inputs look like spreadsheet cells ---------- */
html[data-ui="pro"] :is(.form-control, .form-select, .input-group-text) {
  border-radius: 0; border: 1px solid var(--grid); background-color: var(--cell-bg); box-shadow: none;
  min-height: 32px; padding-top: .3rem; padding-bottom: .3rem; font-size: .88rem; font-variant-numeric: tabular-nums;
  transition: border-color .08s ease, box-shadow .08s ease, background-color .08s ease;
}
html[data-ui="pro"] :is(.form-control-sm, .form-select-sm) { min-height: 27px; font-size: .82rem; }
html[data-ui="pro"] .input-group-text { background: var(--grid-head); color: var(--label); font-weight: 600; }
html[data-ui="pro"] :is(.form-control, .form-select):hover:not(:focus):not(:disabled):not([readonly]) { border-color: var(--grid-strong); background-color: color-mix(in srgb, var(--cell-focus) 3%, var(--cell-bg)); }
html[data-ui="pro"] :is(.form-control, .form-select):focus {
  border-color: var(--cell-focus); outline: 0; position: relative; z-index: 3;
  box-shadow: inset 0 0 0 1px var(--cell-focus), 0 0 0 3px color-mix(in srgb, var(--cell-focus) 16%, transparent);
}
html[data-ui="pro"] :is(.form-control, .form-select):is(:disabled, [readonly]) { background-color: var(--cell-ro); color: var(--muted); }
html[data-ui="pro"] input[type="number"].form-control, html[data-ui="pro"] .form-control.text-end, html[data-ui="pro"] input[inputmode="decimal"] { text-align: right; }
html[data-ui="pro"] .form-control.is-invalid, html[data-ui="pro"] .was-validated .form-control:invalid { border-color: #DC2626; background-color: #FEF2F2; box-shadow: inset 3px 0 0 #DC2626; }
html[data-ui="pro"] textarea.form-control { min-height: 64px; }
html[data-ui="pro"] .form-label, html[data-ui="pro"] .col-form-label {
  font-size: .74rem; font-weight: 600; color: var(--label); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem;
}
html[data-ui="pro"] .form-check-input { border-radius: 2px; border-color: var(--grid-strong); }
html[data-ui="pro"] .form-check-input:checked { background-color: var(--cell-focus); border-color: var(--cell-focus); }
html[data-ui="pro"] .form-switch .form-check-input { border-radius: 2em; }
html[data-ui="pro"] .form-text { font-size: .72rem; }
/* a block of fields reads like one sheet: neighbouring cells share borders */
html[data-ui="pro"] .input-group > :not(:first-child) { margin-left: -1px; }

/* ---------- tables look like a spreadsheet grid (desktop) ---------- */
@media (min-width: 768px) {
  html[data-ui="pro"] .table { --bs-table-bg: var(--cell-bg); border-collapse: collapse; margin-bottom: 0; }
  html[data-ui="pro"] .table > :not(caption) > * > * { border: 1px solid var(--grid); padding: .38rem .55rem; }
  html[data-ui="pro"] .table-sm > :not(caption) > * > * { padding: .26rem .45rem; }
  html[data-ui="pro"] .table > thead > tr > * {
    background: linear-gradient(#F7F8FA, var(--grid-head)); color: var(--label); font-size: .72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--grid-strong); white-space: nowrap;
  }
  html[data-ui="pro"][data-bs-theme="dark"] .table > thead > tr > * { background: var(--grid-head); }
  html[data-ui="pro"] .table > tbody > tr:nth-child(even) > * { background-color: color-mix(in srgb, var(--grid-head) 45%, var(--cell-bg)); }
  html[data-ui="pro"] .table-hover > tbody > tr:hover > * { background-color: color-mix(in srgb, #2563EB 8%, var(--cell-bg)) !important; --bs-table-bg-state: transparent; }
  html[data-ui="pro"] .table > tbody > tr > td:first-child { box-shadow: inset 3px 0 0 transparent; }
  html[data-ui="pro"] .table-hover > tbody > tr:hover > td:first-child { box-shadow: inset 3px 0 0 var(--cell-focus); }
  html[data-ui="pro"] .table tfoot > tr > * { background: var(--grid-head); font-weight: 700; border-top: 2px solid var(--grid-strong); }
  html[data-ui="pro"] .table .tabular, html[data-ui="pro"] .table td.text-end { font-variant-numeric: tabular-nums; }
  /* inputs inside a table become the cell itself (line items, payroll, attendance grids) */
  html[data-ui="pro"] .table td:has(> .form-control, > .form-select) { padding: 0; }
  html[data-ui="pro"] .table td > :is(.form-control, .form-select) { border-color: transparent; background-color: transparent; min-height: 31px; width: 100%; }
  html[data-ui="pro"] .table td > :is(.form-control, .form-select):focus { background-color: var(--cell-bg); border-color: var(--cell-focus); }
  html[data-ui="pro"] .card > .table, html[data-ui="pro"] .card > .table-responsive > .table, html[data-ui="pro"] .card-body.p-0 > .table, html[data-ui="pro"] .card-body.p-0 > .table-responsive > .table { border-left: 0; border-right: 0; }
  html[data-ui="pro"] .card .table > :not(caption) > tr > :first-child { border-left: 0; }
  html[data-ui="pro"] .card .table > :not(caption) > tr > :last-child { border-right: 0; }
}

/* ---------- cards, panels, tabs: squarer, SAP-like ---------- */
html[data-ui="pro"] .card { border-radius: 6px; border-color: var(--grid); box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
html[data-ui="pro"] .card-header { background: linear-gradient(#FFFFFF, #F6F7F9); border-bottom: 1px solid var(--grid); padding: .6rem .9rem; font-size: .9rem; border-radius: 6px 6px 0 0; position: relative; }
html[data-ui="pro"][data-bs-theme="dark"] .card-header { background: var(--grid-head); }
html[data-ui="pro"] .card-header::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--dept); border-radius: 6px 0 0 0; }
html[data-ui="pro"] .kpi { border-radius: 6px; border-color: var(--grid); }
html[data-ui="pro"] .kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--k), color-mix(in srgb, var(--k) 40%, #fff), var(--k)); background-size: 200% 100%; animation: pro-flow 6s ease infinite; }
html[data-ui="pro"] .kpi .k-ico { border-radius: 6px; background-image: linear-gradient(135deg, var(--k), color-mix(in srgb, var(--k) 60%, #0F172A)); }
html[data-ui="pro"] .nav-tabs .nav-link { border-radius: 0; font-weight: 600; color: var(--label); }
html[data-ui="pro"] .nav-tabs .nav-link.active { border-top: 3px solid var(--dept); color: var(--bs-body-color); }
html[data-ui="pro"] .nav-pills .nav-link { border-radius: 3px; }
html[data-ui="pro"] .nav-pills .nav-link.active { background-image: linear-gradient(135deg, var(--dept), color-mix(in srgb, var(--dept) 60%, #7C3AED)); }
html[data-ui="pro"] .st { border-radius: 3px; }
html[data-ui="pro"] .badge { border-radius: 3px; }
html[data-ui="pro"] .modal-content { border-radius: 6px; border: 1px solid var(--grid-strong); }
html[data-ui="pro"] .modal-header { background: linear-gradient(#FFFFFF, #F6F7F9); border-bottom: 2px solid var(--dept); }
html[data-ui="pro"][data-bs-theme="dark"] .modal-header { background: var(--grid-head); }
html[data-ui="pro"] .dropdown-menu { border-radius: 4px; border-color: var(--grid); }
html[data-ui="pro"] .dropdown-item:active { background: var(--cell-focus); }
html[data-ui="pro"] .page-head h1 { font-weight: 700; letter-spacing: -.2px; }
html[data-ui="pro"] .page-head { border-bottom: 1px solid var(--grid); padding-bottom: .7rem; }
html[data-ui="pro"] .alert { border-radius: 4px; border-left-width: 4px; }
html[data-ui="pro"] .pagination .page-link { border-radius: 0 !important; }
html[data-ui="pro"] .side-link, html[data-ui="pro"] .side-link .ico { border-radius: 5px; }
html[data-ui="pro"] .topbar-search .form-control { border-radius: 4px; border: 1px solid var(--grid); min-height: 36px; }

/* ---------- login button and dashboard quick actions ---------- */
html[data-ui="pro"] .auth-form .btn-lg, html[data-ui="pro"] form .btn-lg.text-white {
  background: linear-gradient(120deg, #4F46E5, #2563EB, #0D9488, #4F46E5) !important; background-size: 300% 300% !important;
  animation: pro-flow 7s ease infinite; border: 0; box-shadow: 0 6px 18px rgba(79, 70, 229, .35);
}
html[data-ui="pro"] .quick-btn { border-radius: 6px; border: 1px solid var(--grid); transition: transform .12s ease, box-shadow .12s ease; }
html[data-ui="pro"] .quick-btn i { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; color: #fff; font-size: 1.15rem;
  background-image: linear-gradient(135deg, var(--q, var(--dept)), color-mix(in srgb, var(--q, var(--dept)) 55%, #0F172A)); box-shadow: 0 3px 8px color-mix(in srgb, var(--q, var(--dept)) 35%, transparent); }
html[data-ui="pro"] .quick-btn:hover { transform: translateY(-2px); border-color: var(--q, var(--dept)); box-shadow: 0 6px 16px rgba(15, 23, 42, .12); }
html[data-ui="pro"] .row > :nth-child(8n+1) > .quick-btn { --q: #4F46E5; }
html[data-ui="pro"] .row > :nth-child(8n+2) > .quick-btn { --q: #2563EB; }
html[data-ui="pro"] .row > :nth-child(8n+3) > .quick-btn { --q: #0D9488; }
html[data-ui="pro"] .row > :nth-child(8n+4) > .quick-btn { --q: #16A34A; }
html[data-ui="pro"] .row > :nth-child(8n+5) > .quick-btn { --q: #D97706; }
html[data-ui="pro"] .row > :nth-child(8n+6) > .quick-btn { --q: #EA580C; }
html[data-ui="pro"] .row > :nth-child(8n+7) > .quick-btn { --q: #DB2777; }
html[data-ui="pro"] .row > :nth-child(8n+8) > .quick-btn { --q: #7C3AED; }

/* ---------- keep it calm for people who turn off motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html[data-ui="pro"] *, html[data-ui="pro"] *::before, html[data-ui="pro"] *::after { animation: none !important; transition: none !important; }
}
@media print {
  html[data-ui="pro"] .btn { display: none !important; }
}
