/* =====================================================================
   BEVEL / 3D LOOK for every shape (admin pages; the public apply pages have the same in apply.css).
     raised  cards, panels, buttons, chips: light top edge + shade below + a soft drop shadow
     sunken  input boxes, kanban columns, the search box: inner shadow
     pressed buttons and the selected chip/tab press in when clicked or chosen
   Remove this file from UNFOLD["STYLES"] (config/settings.py) to go back to the flat look.

   Performance: every effect is a static gradient or shadow, painted once. Nothing animates a shadow;
   pressing only moves the button 1px (transform). Selectors start with "html" so they outrank the
   theme's own utility classes without !important.
   ===================================================================== */
html {
  --bv-hi: #ffffff;                         /* light along the top edge */
  --bv-lo: rgb(16 24 40 / .09);             /* shade along the bottom edge */
  --bv-edge: #d3dbe7;
  --bv-edge-low: #bcc6d6;                   /* the bottom edge is darker: the shape stands up */
  --bv-panel: linear-gradient(180deg, #ffffff 0%, #f8fafd 45%, #ebf0f7 100%);
  --bv-raise: 0 1px 0 var(--bv-edge-low), 0 2px 3px rgb(16 24 40 / .10), 0 14px 26px -12px rgb(16 24 40 / .30);
  --bv-raise-sm: 0 1px 1px rgb(16 24 40 / .06), 0 2px 5px -2px rgb(16 24 40 / .14);
  --bv-sunk: inset 0 2px 3px rgb(16 24 40 / .07), inset 0 -1px 0 rgb(255 255 255 / .8);
  --bv-btn2: linear-gradient(180deg, #ffffff 0%, #f1f4f8 100%);
  --bv-btn2-edge: #cdd5e1;
}
html.dark {
  --bv-hi: rgb(255 255 255 / .07);
  --bv-lo: rgb(0 0 0 / .35);
  --bv-edge: rgb(255 255 255 / .08);
  --bv-edge-low: rgb(0 0 0 / .55);
  --bv-panel: linear-gradient(180deg, rgb(var(--color-base-800) / .95) 0%, rgb(var(--color-base-900) / .96) 100%);
  --bv-raise: 0 1px 0 rgb(0 0 0 / .4), 0 4px 10px -2px rgb(0 0 0 / .45), 0 18px 36px -18px rgb(0 0 0 / .8);
  --bv-raise-sm: 0 1px 0 rgb(0 0 0 / .45), 0 3px 8px -3px rgb(0 0 0 / .55);
  --bv-sunk: inset 0 2px 4px rgb(0 0 0 / .45), inset 0 -1px 0 rgb(255 255 255 / .04);
  --bv-btn2: linear-gradient(180deg, rgb(var(--color-base-700)) 0%, rgb(var(--color-base-800)) 100%);
  --bv-btn2-edge: rgb(255 255 255 / .1);
}

/* ---------- raised panels: forms, tables, cards on every page ---------- */
html fieldset.module > .aligned,
html #result_list,
html .rk-card, html .rk-cv-card, html .rk-cc-card, html .rk-fill-wrap, html .rk-ta-table,
html .rk-guide, html .kb-card, html .rk-pcard-plain {
  background: var(--bv-panel);
  border: 1px solid var(--bv-edge);
  border-bottom-color: var(--bv-edge-low);
  box-shadow: inset 0 1px 0 var(--bv-hi), inset 0 -3px 0 var(--bv-lo), var(--bv-raise);
}
/* the page behind is a shade darker, so the raised shapes stand out */
html:not(.dark) { --rk-canvas: #e8edf4; }
html:not(.dark) body::before {
  background:
    radial-gradient(46rem 26rem at 8% -8%, rgb(var(--color-primary-200) / .45), transparent 70%),
    radial-gradient(40rem 24rem at 102% -4%, rgb(196 181 253 / .25), transparent 70%),
    linear-gradient(180deg, #f1f4f9 0%, #e8edf4 40%, #e3e9f1 100%);
}
/* dashboard icons sit in small raised round buttons */
html .rk-ico { width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(180deg, #ffffff 0%, #e9eef5 100%); border: 1px solid var(--bv-edge);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 0 rgb(16 24 40 / .07), 0 2px 4px -1px rgb(16 24 40 / .18); }
html.dark .rk-ico { background: linear-gradient(180deg, rgb(var(--color-base-700)), rgb(var(--color-base-800)));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .1), 0 2px 5px -1px rgb(0 0 0 / .6); }
html fieldset.module > .aligned, html #result_list { border-radius: 14px; }
html .rk-card { border-radius: 14px; }
html .rk-wrap { --card-top: transparent; --card-bottom: transparent; }   /* the dashboard cards take the panel above */
html .rk-card::after { display: none; }                                  /* the old 1px glint line */
/* the dashboard banner and the profile card keep their colours, with a bevelled edge */
html .rk-hero, html .rk-pcard {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .55), inset 0 -3px 0 rgb(16 24 40 / .08), var(--bv-raise);
}
html.dark .rk-hero, html.dark .rk-pcard { box-shadow: inset 0 1px 0 rgb(255 255 255 / .12), inset 0 -3px 0 rgb(0 0 0 / .3), var(--bv-raise); }

/* table headings: a bevelled bar */
html #result_list thead th, html .rk-cv-people th, html .rk-fill-table th, html .rk-ta-head {
  background: linear-gradient(180deg, #f9fbfd 0%, #eef2f7 100%);
  box-shadow: inset 0 1px 0 var(--bv-hi), inset 0 -1px 0 var(--bv-edge);
}
html.dark #result_list thead th, html.dark .rk-cv-people th, html.dark .rk-fill-table th, html.dark .rk-ta-head {
  background: linear-gradient(180deg, rgb(var(--color-base-800)) 0%, rgb(var(--color-base-900)) 100%);
}

/* ---------- buttons: raised, pressed when clicked ---------- */
/* primary (blue) */
html .rounded-default.bg-primary-600, html .rk-btn:not(.ghost):not(.on), html .rk-cv-btn, html .rk-cc-btn.sms {
  color: #fff !important;
  background: linear-gradient(180deg, rgb(var(--color-primary-600)) 0%, rgb(var(--color-primary-800)) 100%);
  border: 1px solid rgb(var(--color-primary-800));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), inset 0 -2px 0 rgb(0 0 0 / .16),
              0 1px 2px rgb(var(--color-primary-900) / .3), 0 6px 14px -6px rgb(var(--color-primary-700) / .55);
  text-shadow: 0 1px 0 rgb(0 0 0 / .2);
}
/* secondary (outlined) */
html button.rounded-default.border:not(.bg-primary-600), html a.rounded-default.border:not(.bg-primary-600),
html .rk-btn.ghost, html .rk-cv-ghost, html .rk-cc-btn.ghost, html .rk-qf-btn, html .rk-cc-hist,
html .rk-ta-quick button, html .rk-cv-ord-btns button {
  background: var(--bv-btn2);
  border: 1px solid var(--bv-btn2-edge);
  box-shadow: inset 0 1px 0 var(--bv-hi), inset 0 -1px 0 var(--bv-lo), var(--bv-raise-sm);
}
/* danger (red) */
html .rounded-default.bg-red-600, html .rk-cc-btn.wa {
  background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
  border: 1px solid #991b1b;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 -2px 0 rgb(0 0 0 / .18), 0 4px 10px -4px rgb(185 28 28 / .55);
  color: #fff !important; text-shadow: 0 1px 0 rgb(0 0 0 / .2);
}
html .rk-cc-btn.wa { background: linear-gradient(180deg, #15803d 0%, #14532d 100%); border-color: #14532d;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 -2px 0 rgb(0 0 0 / .18), 0 4px 10px -4px rgb(21 128 61 / .55); }
html.dark .rounded-default.bg-red-600 { color: #fff !important; }
/* hover: a touch brighter; click: pressed in */
html .rounded-default.bg-primary-600:hover, html .rk-btn:not(.ghost):hover, html .rk-cv-btn:hover,
html .rounded-default.bg-red-600:hover, html .rk-cc-btn:hover { filter: brightness(1.07); }
html button.rounded-default.border:hover, html a.rounded-default.border:hover, html .rk-btn.ghost:hover,
html .rk-cv-ghost:hover, html .rk-qf-btn:hover { background: linear-gradient(180deg, #ffffff 0%, #e9eef5 100%); }
html.dark button.rounded-default.border:hover, html.dark a.rounded-default.border:hover, html.dark .rk-btn.ghost:hover,
html.dark .rk-cv-ghost:hover, html.dark .rk-qf-btn:hover {
  background: linear-gradient(180deg, rgb(var(--color-base-600)) 0%, rgb(var(--color-base-700)) 100%); }
html .rounded-default.bg-primary-600:active, html .rk-btn:active, html .rk-cv-btn:active, html .rk-cv-ghost:active,
html .rounded-default.bg-red-600:active, html button.rounded-default.border:active, html a.rounded-default.border:active,
html .rk-qf-btn:active, html .rk-cc-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgb(0 0 0 / .22) !important;
  filter: none;
}

/* chosen chip / quick filter: pressed in and coloured */
html .rk-qf-btn.on, html .rk-cv-chip input:checked + span, html button.rk-cv-chip[aria-pressed="true"] span {
  color: #fff !important;
  background: linear-gradient(180deg, rgb(var(--color-primary-700)) 0%, rgb(var(--color-primary-600)) 100%);
  border-color: rgb(var(--color-primary-800));
  box-shadow: inset 0 2px 4px rgb(0 0 0 / .25), 0 1px 0 var(--bv-hi);
}
html .rk-cv-chip span { background: var(--bv-btn2); border-color: var(--bv-btn2-edge);
  box-shadow: inset 0 1px 0 var(--bv-hi), var(--bv-raise-sm); }
html .rk-cv-format > span { background: var(--bv-panel); box-shadow: inset 0 1px 0 var(--bv-hi), var(--bv-raise-sm); }
html .rk-cv-format input:checked + span { box-shadow: inset 0 2px 5px rgb(var(--color-primary-700) / .18), 0 0 0 3px rgb(var(--color-primary-500) / .18); }

/* ---------- sunken: input boxes, search, kanban columns ---------- */
html #content input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]):not([type=submit]):not(#searchbar),
html #content select, html #content textarea,
html .rk-cv-search input, html .rk-cc-f input, html .rk-cc-f select, html .rk-cc-f textarea {
  border-color: var(--bv-btn2-edge);
  box-shadow: var(--bv-sunk);
}
html #searchbar { box-shadow: none; }
html div:has(> #searchbar) { box-shadow: var(--bv-sunk) !important; border-color: var(--bv-btn2-edge) !important; }
html .kb-col {
  background: linear-gradient(180deg, rgb(16 24 40 / .035), rgb(16 24 40 / .06));
  box-shadow: inset 0 2px 6px rgb(16 24 40 / .08), inset 0 -1px 0 var(--bv-hi);
  border: 1px solid var(--bv-edge);
}
html.dark .kb-col { background: rgb(0 0 0 / .22); box-shadow: inset 0 2px 8px rgb(0 0 0 / .5); }

/* ---------- sidebar: the open page is a raised pill ---------- */
html:not(.dark) #nav-sidebar a.font-semibold {
  background: linear-gradient(180deg, #ffffff 0%, rgb(var(--color-primary-50)) 100%);
  border: 1px solid rgb(var(--color-primary-200));
  box-shadow: inset 3px 0 0 rgb(var(--color-primary-600)), inset 0 1px 0 #fff, 0 2px 6px -2px rgb(var(--color-primary-700) / .3);
}
html.dark #nav-sidebar a.font-semibold {
  background: linear-gradient(180deg, rgb(255 255 255 / .09), rgb(255 255 255 / .03));
  box-shadow: inset 3px 0 0 rgb(var(--color-primary-400)), inset 0 1px 0 rgb(255 255 255 / .08), 0 3px 8px -3px rgb(0 0 0 / .6);
}
/* top bar: a gentle bevel under the page title */
html:not(.dark) #main > div.border-b.z-40 { box-shadow: inset 0 -1px 0 #fff, 0 2px 6px -3px rgb(16 24 40 / .18); }
/* the sun / moon and print buttons: small raised round buttons */
html .rk-topbtn { background: var(--bv-btn2); border: 1px solid var(--bv-btn2-edge);
  box-shadow: inset 0 1px 0 var(--bv-hi), var(--bv-raise-sm); }
html .rk-topbtn:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgb(0 0 0 / .2); }

/* ---------- badges and counters: tiny raised pills ---------- */
html .rk-acc, html .rk-qf-n, html .rk-cv-doc {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 1px 1px rgb(16 24 40 / .08);
}
html.dark .rk-acc, html.dark .rk-qf-n, html.dark .rk-cv-doc { box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 1px 1px rgb(0 0 0 / .4); }

@media (prefers-reduced-motion: reduce) {
  html .rounded-default:active, html .rk-btn:active, html .rk-qf-btn:active, html .rk-topbtn:active { transform: none; }
}
@media print {
  html fieldset.module > .aligned, html #result_list, html .rk-card { box-shadow: none !important; }
}
