/* WX Custom UI – DaisyUI-inspired "Nord" theme (no framework, no compiler)
   Goal: consistent, professional light UI with Nord palette, strong contrast.
   Keeps Bulma-like classnames used in templates (navbar, button, tabs, card, etc.).
*/

:root{
  /* Nord palette */
  --nord0:#2E3440;
  --nord1:#3B4252;
  --nord2:#434C5E;
  --nord3:#4C566A;
  --nord4:#D8DEE9;
  --nord5:#E5E9F0;
  --nord6:#ECEFF4;
  --nord7:#8FBCBB;
  --nord8:#88C0D0;
  --nord9:#81A1C1;
  --nord10:#5E81AC;
  --nord11:#BF616A;
  --nord12:#D08770;
  --nord13:#EBCB8B;
  --nord14:#A3BE8C;
  --nord15:#B48EAD;

  /* DaisyUI-ish tokens */
  --b1: var(--nord6);   /* base-100 */
  --b2: var(--nord5);   /* base-200 */
  --b3: var(--nord4);   /* base-300 */
  --bc: var(--nord0);   /* base-content */

  --p:  var(--nord10);  /* primary */
  --pc: var(--nord6);   /* primary-content */
  --s:  var(--nord9);   /* secondary */
  --a:  var(--nord8);   /* accent */
  --n:  var(--nord1);   /* neutral */
  --nc: var(--nord6);   /* neutral-content */

  --su: var(--nord14);
  --wa: var(--nord13);
  --er: var(--nord11);
  --in: var(--nord8);

  /* Radii & shadows */
  --radius-btn: 4px;
  --radius-badge: 6px;
  --radius-card: 8px;
  --radius-pop: 10px;

  --border: rgba(46,52,64,.14);
  --border-strong: rgba(46,52,64,.22);

  --shadow-sm: 0 1px 2px rgba(46,52,64,.10);
  --shadow-md: 0 6px 18px rgba(46,52,64,.12);

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;

  /* Focus ring */
  --ring: 0 0 0 3px rgba(94,129,172,.22);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font-sans);
  color:var(--bc);
  background:
    radial-gradient(900px 450px at 20% 0%, rgba(129,161,193,.14), rgba(236,239,244,0) 60%),
    radial-gradient(900px 450px at 90% 10%, rgba(143,188,187,.12), rgba(236,239,244,0) 55%),
    var(--b1);
}

a{ color:var(--p); text-decoration:none; }
a:hover{ text-decoration:underline; }
hr, .wx-hr{ border:0; height:1px; background:var(--border); margin:1rem 0; }

::selection{ background: rgba(136,192,208,.28); }

/* ----- Layout helpers (Bulma-ish) ----- */
.section{ padding:1.25rem 0; }
.pt-4{ padding-top:1rem !important; }
.container{ width:100%; max-width:1120px; margin:0 auto; padding:0 1rem; }

.is-flex{ display:flex !important; }
.is-align-items-center{ align-items:center !important; }
.is-justify-content-space-between{ justify-content:space-between !important; }
.has-text-right{ text-align:right !important; }

/* Columns/Grid (subset) */
.columns{
  display:flex;
  flex-wrap:wrap;
  margin:-.75rem;
}
.columns.is-multiline{ flex-wrap:wrap; }
.column{
  padding:.75rem;
  flex: 1 1 0%;
  min-width: 0;
}
.column.is-12{ flex:0 0 100%; }
.column.is-4{ flex:0 0 33.3333%; }
.column.is-6{ flex:0 0 50%; }
@media (max-width: 1023px){
  .column.is-half-tablet{ flex:0 0 50%; }
}
@media (max-width: 768px){
  .column.is-half-mobile{ flex:0 0 50%; }
  .column.is-4{ flex:0 0 100%; }
}
@media (min-width: 1024px){
  .column.is-one-fifth-desktop{ flex:0 0 20%; }
}

/* Level (header rows) */
.level{ display:flex; align-items:center; gap:.75rem; }
.level-left{ display:flex; align-items:center; gap:.75rem; flex:1; }
.level-right{ display:flex; align-items:center; gap:.5rem; justify-content:flex-end; }

/* Titles */
.title{ margin:0; font-weight:700; color:var(--bc); letter-spacing:-.01em; }
.subtitle{ margin:.25rem 0 0; color:rgba(46,52,64,.72); }
.title.is-4{ font-size:1.25rem; }
.title.is-5{ font-size:1.05rem; }
.subtitle.is-6{ font-size:.92rem; }
.heading{ font-size:.78rem; color:rgba(46,52,64,.65); text-transform:uppercase; letter-spacing:.06em; }

/* Spacing utils used in templates */
.mb-1{ margin-bottom:.25rem !important; }
.mb-2{ margin-bottom:.5rem !important; }
.mb-4{ margin-bottom:1rem !important; }

/* ----- Navbar ----- */
.navbar{
  position:sticky;
  top:0;
  z-index:20;
  background: rgba(229,233,240,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.navbar.is-dark{ /* templates keep is-dark; we override to Nord light */
  background: rgba(229,233,240,.86);
}
.wx-navbar .navbar-brand,
.wx-navbar .navbar-menu{
  display:flex;
  align-items:center;
}
.navbar-brand{ padding:.35rem .5rem; }
.navbar-item{
  display:flex;
  align-items:center;
  gap:.5rem;
  padding:.55rem .75rem;
  border-radius:8px;
  color:var(--bc);
  font-weight:600;
  font-size:.95rem;
}
.navbar-item strong{ font-weight:800; }
.navbar-item:hover{
  background: rgba(136,192,208,.18);
  text-decoration:none;
}
.navbar-item.is-active{
  background: rgba(94,129,172,.16);
  color: var(--bc);
  box-shadow: inset 0 0 0 1px rgba(94,129,172,.28);
}

.navbar-menu{ width:100%; justify-content:space-between; padding:.35rem .5rem; }
.navbar-start, .navbar-end{ display:flex; align-items:center; gap:.25rem; }

.navbar-burger{
  display:none;
  margin-left:auto;
  width:40px; height:40px;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(236,239,244,.8);
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.navbar-burger span{
  display:block; width:18px; height:2px;
  background: rgba(46,52,64,.75);
  margin:3px 0;
}
@media (max-width: 768px){
  .navbar-burger{ display:flex; }
  .navbar-menu{ display:none; flex-direction:column; align-items:stretch; gap:.35rem; padding:.5rem; }
  .navbar-menu.is-active{ display:flex; }
  .navbar-start, .navbar-end{ width:100%; justify-content:flex-start; flex-wrap:wrap; }
}

/* ----- Buttons (Bulma-like) ----- */
.buttons{ display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; }
.button{
  appearance:none;
  border:1px solid var(--border);
  background: rgba(236,239,244,.95);
  color:var(--bc);
  padding:.55rem .85rem;
  border-radius: var(--radius-btn);
  font-weight:700;
  font-size:.95rem;
  line-height:1;
  cursor:pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .04s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover{
  background: rgba(229,233,240,.98);
  border-color: var(--border-strong);
  text-decoration:none;
}
.button:active{ transform: translateY(1px); box-shadow:none; }
.button:focus{ outline:none; box-shadow: var(--shadow-sm), var(--ring); }

.button.is-small{ font-size:.82rem; padding:.45rem .7rem; }
.button.is-fullwidth{ width:100%; justify-content:center; }

.button.is-primary{
  background: var(--p);
  border-color: rgba(94,129,172,.55);
  color: var(--pc);
}
.button.is-primary:hover{ filter: brightness(0.98); }

.button.is-link{ /* daisyUI uses "info"; we map link to accent */
  background: rgba(136,192,208,.22);
  border-color: rgba(136,192,208,.45);
  color: var(--nord0);
}
.button.is-link:hover{ background: rgba(136,192,208,.28); }

.button.is-light{
  background: rgba(255,255,255,.75);
  border-color: var(--border);
  color: var(--bc);
}
.button.is-light:hover{ background: rgba(255,255,255,.88); }

.button.is-danger{
  background: rgba(191,97,106,.18);
  border-color: rgba(191,97,106,.38);
  color: var(--nord0);
}
.button.is-warning{
  background: rgba(235,203,139,.20);
  border-color: rgba(235,203,139,.44);
  color: var(--nord0);
}

/* Delete icon (modal close) */
.delete{
  width:32px; height:32px;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.75);
  cursor:pointer;
  position:relative;
}
.delete:before,.delete:after{
  content:"";
  position:absolute;
  top:50%; left:50%;
  width:14px; height:2px;
  background: rgba(46,52,64,.65);
  transform-origin:center;
}
.delete:before{ transform: translate(-50%,-50%) rotate(45deg); }
.delete:after{ transform: translate(-50%,-50%) rotate(-45deg); }
.delete:hover{ background: rgba(255,255,255,.92); }

/* ----- Tags/Badges ----- */
.tag, .wx-pill{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.22rem .55rem;
  font-size:.82rem;
  font-weight:700;
  border-radius: var(--radius-badge);
  border:1px solid var(--border);
  background: rgba(229,233,240,.75);
  color: rgba(46,52,64,.88);
}
.tag.is-light{ background: rgba(255,255,255,.68); }
.wx-user-tag{
  background: rgba(236,239,244,.92);
  border-color: rgba(236,239,244,.92);
  color: rgba(46,52,64,.92);
  box-shadow: inset 0 0 0 1px rgba(46,52,64,.10);
}

/* Custom badge used in dashboard/project */
.wx-badge{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.25rem .55rem;
  border-radius: var(--radius-badge);
  background: rgba(94,129,172,.10);
  border:1px solid rgba(94,129,172,.20);
  color: rgba(46,52,64,.92);
  font-weight:700;
  font-size:.84rem;
}
.wx-dot{
  width:10px; height:10px;
  border-radius:999px;
  box-shadow: 0 0 0 2px rgba(236,239,244,.95);
}

/* ----- Cards / Boxes ----- */
.card, .box{
  background: rgba(255,255,255,.78);
  border:1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.card-content{ padding:1rem; }
.box{ padding:1rem; }

.wx-card{ /* keep hook */
  background: rgba(255,255,255,.80);
}
.wx-box{
  background: rgba(255,255,255,.72);
}
.wx-stat{
  padding:.75rem .85rem;
  border-radius: var(--radius-card);
  background: rgba(94,129,172,.08);
  border:1px solid rgba(94,129,172,.16);
}

/* ----- Tabs (Nord) ----- */
.tabs{
  margin:.25rem 0 1rem;
}
.tabs ul{
  list-style:none;
  display:flex;
  gap:.35rem;
  padding: .25rem;
  margin:0;
  background: rgba(229,233,240,.78);
  border:1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.tabs ul li{ margin:0; }
.tabs ul li a{
  display:block;
  padding:.5rem .75rem;
  border-radius: 8px;
  color: rgba(46,52,64,.86);
  font-weight:800;
  font-size:.92rem;
  text-decoration:none;
}
.tabs ul li a:hover{ background: rgba(136,192,208,.16); }
.tabs ul li.is-active a{
  background: rgba(255,255,255,.86);
  color: var(--bc);
  box-shadow: inset 0 0 0 1px rgba(94,129,172,.22);
}

/* ----- Forms (Bulma-like) ----- */
.field{ margin-bottom:.85rem; }
.label{
  display:block;
  font-size:.84rem;
  font-weight:800;
  color: rgba(46,52,64,.88);
  margin-bottom:.35rem;
}
.control{ position:relative; }
.input, .textarea, .select select{
  width:100%;
  border:1px solid var(--border);
  background: rgba(255,255,255,.86);
  color: var(--bc);
  border-radius: var(--radius-btn);
  padding:.55rem .65rem;
  font-size:.95rem;
  box-shadow: inset 0 1px 0 rgba(46,52,64,.04);
}
.textarea{ min-height: 110px; resize:vertical; }
.input:focus, .textarea:focus, .select select:focus{
  outline:none;
  border-color: rgba(94,129,172,.55);
  box-shadow: var(--ring);
}
.select{ position:relative; }
.select:after{
  content:"";
  position:absolute;
  right:.75rem;
  top:50%;
  width:8px; height:8px;
  border-right:2px solid rgba(46,52,64,.55);
  border-bottom:2px solid rgba(46,52,64,.55);
  transform: translateY(-55%) rotate(45deg);
  pointer-events:none;
}
.select select{
  padding-right:2.1rem;
  appearance:none;
}

/* ----- Notifications (flash) ----- */
.notification{
  border-radius: var(--radius-card);
  padding:.75rem .9rem;
  border:1px solid var(--border);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-sm);
  margin-bottom:.75rem;
}
.notification.is-success{
  background: rgba(163,190,140,.18);
  border-color: rgba(163,190,140,.35);
}
.notification.is-danger{
  background: rgba(191,97,106,.18);
  border-color: rgba(191,97,106,.36);
}
.notification.is-info{
  background: rgba(136,192,208,.16);
  border-color: rgba(136,192,208,.34);
}

/* ----- Table ----- */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background: rgba(255,255,255,.76);
  border:1px solid var(--border);
  border-radius: var(--radius-card);
  overflow:hidden;
  box-shadow: var(--shadow-sm);
}
.table th, .table td{
  padding:.65rem .7rem;
  border-bottom:1px solid rgba(46,52,64,.10);
  vertical-align:top;
  font-size:.94rem;
}
.table th{
  background: rgba(229,233,240,.78);
  font-weight:900;
  color: rgba(46,52,64,.85);
}
.table tr:last-child td{ border-bottom:0; }
.table.is-hoverable tbody tr:hover td{
  background: rgba(136,192,208,.12);
}

/* ----- Modals ----- */
.modal{
  display:none;
  position:fixed; inset:0;
  z-index:50;
}
.modal.is-active{ display:block; }
.modal-background{
  position:absolute; inset:0;
  background: rgba(46,52,64,.55);
  backdrop-filter: blur(2px);
}
.modal-card{
  position:relative;
  max-width: 760px;
  margin: 6vh auto;
  border-radius: var(--radius-pop);
  overflow:hidden;
  border:1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow-md);
  background: rgba(255,255,255,.92);
}
.modal-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:.9rem 1rem;
  background: rgba(229,233,240,.86);
  border-bottom:1px solid var(--border);
}
.modal-card-title{
  font-weight:900;
  color: var(--bc);
}
.modal-card-body{ padding:1rem; }

/* ----- Board (Kanban) ----- */
.wx-board{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: .85rem;
}
@media (max-width: 1024px){
  .wx-board{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 640px){
  .wx-board{ grid-template-columns: 1fr; }
}
.wx-column{
  background: rgba(229,233,240,.78);
  border:1px solid var(--border);
  border-radius: var(--radius-card);
  padding:.75rem;
  box-shadow: var(--shadow-sm);
  min-height: 200px;
}
.wx-dropzone.is-over{
  outline: 2px dashed rgba(94,129,172,.55);
  outline-offset: 2px;
}
.wx-task{
  background: rgba(255,255,255,.82);
  border:1px solid rgba(46,52,64,.12);
  border-radius: var(--radius-card);
  padding:.6rem .65rem;
  margin-bottom:.55rem;
  box-shadow: var(--shadow-sm);
  cursor:grab;
}
.wx-task:active{ cursor:grabbing; }
.wx-task .title{ font-size:.95rem; }
.wx-task .wx-meta{ margin-top:.35rem; display:flex; flex-wrap:wrap; gap:.35rem; }

/* ----- Timeline / Gantt ----- */
.wx-gantt{
  border:1px solid var(--border);
  border-radius: var(--radius-card);
  background: rgba(255,255,255,.76);
  box-shadow: var(--shadow-sm);
  overflow:hidden;
}
.wx-gantt-row{
  display:grid;
  grid-template-columns: 240px 1fr;
  border-top:1px solid rgba(46,52,64,.10);
}
.wx-gantt-row:first-child{ border-top:0; }
.wx-gantt-label{
  padding:.65rem .75rem;
  background: rgba(229,233,240,.75);
  border-right:1px solid rgba(46,52,64,.10);
  font-weight:800;
}
.wx-gantt-bars{
  position:relative;
  padding:.65rem .75rem;
}
.wx-gantt-grid{
  position:absolute; inset:0;
  background:
    linear-gradient(to right, rgba(46,52,64,.06) 1px, transparent 1px);
  background-size: 48px 1px;
  pointer-events:none;
}
.wx-bar{
  position:relative;
  height: 22px;
  border-radius: 8px;
  background: rgba(94,129,172,.35);
  border:1px solid rgba(94,129,172,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  cursor: grab;
}
.wx-bar.is-critical{
  background: rgba(191,97,106,.30);
  border-color: rgba(191,97,106,.45);
}
.wx-bar:active{ cursor:grabbing; }

/* ----- Help sidebar (drawer) ----- */
.wx-help-backdrop{
  display:none;
  position:fixed; inset:0;
  background: rgba(46,52,64,.35);
  z-index:60;
}
.wx-help-backdrop.is-open{ display:block; }
.wx-help-sidebar{
  position:fixed;
  top:0; right:-420px;
  width: 420px;
  height: 100%;
  z-index:61;
  background: rgba(255,255,255,.92);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(46,52,64,.18);
  transition: right .22s ease;
  display:flex;
  flex-direction:column;
}
.wx-help-sidebar.is-open{ right:0; }
.wx-help-header{
  padding: 1rem 1rem .75rem;
  background: rgba(229,233,240,.86);
  border-bottom:1px solid var(--border);
}
.wx-help-title{ font-weight:900; margin:0; }
.wx-help-subtitle{ margin:.25rem 0 0; color: rgba(46,52,64,.70); font-size:.92rem; }
.wx-help-body{ padding: 1rem; overflow:auto; }
.wx-help-list{ margin:.5rem 0 0; padding-left:1.1rem; }
.wx-help-item{
  border:1px solid rgba(46,52,64,.10);
  border-radius: var(--radius-card);
  background: rgba(236,239,244,.78);
  padding: .75rem .85rem;
}
.wx-help-item > summary{
  cursor:pointer;
  font-weight:900;
  color: var(--bc);
  list-style:none;
}
.wx-help-item > summary::-webkit-details-marker{ display:none; }
.wx-help-item[open]{ background: rgba(255,255,255,.80); }
.wx-help-item[open] > summary{ margin-bottom:.35rem; }
.wx-help-list li{ margin:.25rem 0; color: rgba(46,52,64,.80); }
.wx-help-item strong{ display:block; margin-bottom:.25rem; }
.wx-help-text{ color: rgba(46,52,64,.80); font-size:.92rem; }

/* ----- Toasts ----- */
.wx-toast-host{
  position: fixed;
  top: 76px;
  right: 14px;
  z-index: 90;
  display:flex;
  flex-direction:column;
  gap:.5rem;
  max-width: 360px;
}
.wx-toast{
  display:flex;
  gap:.75rem;
  align-items:flex-start;
  justify-content:space-between;
  padding:.7rem .8rem;
  border-radius: var(--radius-card);
  border:1px solid var(--border);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-md);
}
.wx-toast-title{ font-weight:900; margin:0 0 .1rem; }
.wx-toast-text{ color: rgba(46,52,64,.80); font-size:.92rem; }
.wx-toast-close{
  border:0;
  background: transparent;
  color: rgba(46,52,64,.55);
  font-size: 18px;
  line-height: 1;
  cursor:pointer;
  padding:.1rem .2rem;
}
.wx-toast.is-success{ border-color: rgba(163,190,140,.40); }
.wx-toast.is-danger{ border-color: rgba(191,97,106,.45); }
.wx-toast.is-info{ border-color: rgba(136,192,208,.45); }

/* ----- Tooltip (simple) ----- */
.wx-tooltip{ position:relative; }
.wx-tooltip[data-tooltip]:hover:after{
  content: attr(data-tooltip);
  position:absolute;
  right:0;
  top: calc(100% + 10px);
  background: rgba(46,52,64,.92);
  color: var(--nord6);
  border-radius: 10px;
  padding:.45rem .6rem;
  font-size:.82rem;
  font-weight:700;
  box-shadow: var(--shadow-md);
  white-space:nowrap;
  z-index: 100;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; scroll-behavior:auto !important; }
}
