:root{
  --bg:#0b0f19;
  --card:#10182a;
  --text:#e6e9f2;
  --muted:#aab2c5;
  --line:#25304a;
  --primary:#4da3ff;
  --danger:#ff5d5d;
  --radius:16px;
}
*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(77,163,255,.25), transparent 60%),
              radial-gradient(900px 500px at 90% 0%, rgba(73,209,122,.18), transparent 55%),
              var(--bg);
  color:var(--text);
}
.container{ max-width: 1900px; margin:0 auto; padding:20px; }
.topbar{
  position:sticky; top:0;
  background: rgba(11,15,25,.8);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  z-index:10;
}
.topbar-inner{ display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand{ display:flex; align-items:center; gap:12px; }
.logo{
  width:40px; height:40px; border-radius:12px;
  background: linear-gradient(135deg, rgba(77,163,255,.8), rgba(73,209,122,.8));
  display:flex; align-items:center; justify-content:center;
  font-weight:800; color:#06101f;
}
.brand-title{ font-weight:800; letter-spacing:.2px; }
.brand-subtitle{ font-size:12px; color:var(--muted); }
.nav{ display:flex; gap:10px; }
.nav-link{
  color:var(--text); text-decoration:none;
  padding:10px 12px; border-radius:12px;
  border:1px solid transparent;
}
.nav-link:hover{ border-color:var(--line); background:rgba(255,255,255,.03); }
.nav-primary{ border-color:rgba(77,163,255,.45); }

h1{ font-size:28px; margin:10px 0 16px; }
.h2{ margin:0; font-size:16px; }
.card{
  background: linear-gradient(180deg, rgba(16,24,42,.92), rgba(16,24,42,.78));
  border: 1px solid rgba(37,48,74,.85);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
  margin-bottom: 16px;
}
.muted{ color:var(--muted); font-size:13px; margin-top:10px; }
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
.flash-wrap{ margin: 14px 0; display:grid; gap:8px; }
.flash{
  border-radius: 14px;
  padding: 12px 14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.flash-success{ border-color: rgba(73,209,122,.35); }
.flash-error{ border-color: rgba(255,93,93,.45); }

.form .grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.field{ display:grid; gap:6px; }
.field.full{ grid-column:1 / -1; }
.label{ font-size:13px; color:var(--muted); }
input, select, textarea{
  width:100%;
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(37,48,74,.95);
  background: rgba(6,10,18,.55);
  color: var(--text);
  outline: none;
}
input:focus, select:focus, textarea:focus{
  border-color: rgba(77,163,255,.7);
  box-shadow: 0 0 0 3px rgba(77,163,255,.12);
}
.hint{ font-size:12px; color:var(--muted); }

.actions{ display:flex; gap:10px; margin-top: 14px; }
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid rgba(37,48,74,.95);
  background: rgba(255,255,255,.03);
  color: var(--text);
  text-decoration:none;
  cursor:pointer;
}
.btn:hover{ border-color: rgba(77,163,255,.45); }
.btn-primary{
  border-color: rgba(77,163,255,.55);
  background: rgba(77,163,255,.14);
}
.btn-danger{
  border-color: rgba(255,93,93,.55);
  background: rgba(255,93,93,.12);
}
.btn-sm{ padding:8px 10px; border-radius: 10px; font-size: 13px; }

.filters{ display:grid; gap:10px; }
.filter-row{
  display:grid;
  grid-template-columns: 260px minmax(0,1fr) 260px;
  gap:12px;
  align-items:center;
}
.filter-actions{ display:flex; gap:10px; justify-content:flex-end; }
.check{ display:flex; gap:10px; align-items:center; color:var(--text); font-size:14px; }
.check input{ width:auto; }

.table-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom: 10px; }
.table-meta{ color:var(--muted); font-size:13px; }

.table-wrap{ overflow:auto; border-radius: 12px; border:1px solid rgba(37,48,74,.85); }
table{ width:100%; border-collapse: collapse; min-width: 980px; }
th, td{ padding:10px 10px; border-bottom:1px solid rgba(37,48,74,.65); vertical-align:top; }
th{ text-align:left; font-size:12px; color:var(--muted); letter-spacing:.3px; background: rgba(6,10,18,.35); position: sticky; top: 0; }
tr:hover td{ background: rgba(255,255,255,.02); }

.pill{
  display:inline-flex; padding:4px 10px; border-radius: 999px;
  border:1px solid rgba(255,255,255,.12);
  font-size: 12px;
  white-space: nowrap;
}
.pill-выполнено{ border-color: rgba(73,209,122,.5); background: rgba(73,209,122,.12); }
.pill-не-выполнено{ border-color: rgba(255,176,32,.55); background: rgba(255,176,32,.10); }
.pill-отмена{ border-color: rgba(255,93,93,.6); background: rgba(255,93,93,.12); }
.pill-архив{ border-color: rgba(170,178,197,.45); background: rgba(170,178,197,.10); }

.footer{ padding: 26px 0 40px; color: var(--muted); font-size: 12px; }
@media (max-width: 900px){
  .filter-row{ grid-template-columns: 1fr; }
  .actions{ flex-wrap: wrap; }
  .form .grid{ grid-template-columns: 1fr; }
}


.nav-link.active{
  border-color: rgba(77,163,255,.55);
  background: rgba(77,163,255,.10);
}

.actions-right{
  justify-content: flex-end;
}

.row-actions{
  display:flex;
  gap:8px;
  align-items:center;
  white-space: nowrap;
}

.date-range{
  display:flex;
  gap:10px;
  align-items:center;
}

.export-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}

.pager{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  margin-top:12px;
}


/* tighter table */
table{ min-width: 1300px; }

/* icon buttons */
.icon-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius: 12px;
  border:1px solid rgba(37,48,74,.95);
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor:pointer;
  text-decoration:none;
  line-height: 1;
}
.icon-btn:hover{ border-color: rgba(77,163,255,.45); }
.icon-btn.danger:hover{ border-color: rgba(255,93,93,.55); }
.icon-btn.small{ width:28px; height:28px; border-radius: 10px; font-size: 14px; }

.row-actions form{ margin:0; }
.row-actions{ display:flex; gap:8px; align-items:center; }

/* status/master pills clickable */
.pill{ cursor:pointer; color: #fff; }
.pill-master{ border-color: rgba(77,163,255,.35); background: rgba(77,163,255,.10); }

/* clock icon */
.clock{
  display:inline-flex;
  width:28px;
  height:28px;
  align-items:center;
  justify-content:center;
  border-radius: 10px;
  border:1px solid rgba(37,48,74,.85);
  background: rgba(255,255,255,.02);
}

/* due inline editor */
.due-cell{ display:flex; gap:8px; align-items:center; }
.due-input{
  border-radius: 10px;
  padding: 6px 8px;
  border:1px solid rgba(77,163,255,.55);
  background: rgba(6,10,18,.65);
  color: var(--text);
}

/* bulk bar */
.bulk-bar{
  display:flex;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.bulk-actions{ display:flex; gap:10px; flex-wrap: wrap; }

/* popover */
.popover-backdrop{
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 50;
}
.popover{
  position: absolute;
  width: 250px;
  background: linear-gradient(180deg, rgba(16,24,42,.98), rgba(16,24,42,.92));
  border: 1px solid rgba(37,48,74,.95);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
  padding: 10px;
  z-index: 60;
}
.pop-title{
  font-size: 13px;
  color: var(--muted);
  margin: 2px 2px 8px;
}
.pop-body{ display:grid; gap:6px; }
.pop-item{
  border-radius: 12px;
  border:1px solid rgba(37,48,74,.85);
  background: rgba(255,255,255,.03);
  color: var(--text);
  padding: 9px 10px;
  text-align:left;
  cursor:pointer;
}
.pop-item:hover{ border-color: rgba(77,163,255,.45); }

.hidden{ display:none !important; }

/* search input */
.search{
  width: 100%;
  min-width: 260px;
}

/* helper */
.readonly{
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(37,48,74,.95);
  background: rgba(6,10,18,.45);
}
.sel{ width: 42px; }
.right{ display:flex; justify-content:flex-end; gap:10px; align-items:center; }
.small{ font-size: 12px; }


/* Nav links: always show outline/contour */
.nav-link{
  border: 1px solid rgba(37,48,74,.95);
}

/* Remove number input steppers (Chrome/Edge/Safari) */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Remove number steppers (Firefox) */
input[type=number]{
  -moz-appearance: textfield;
}

/* New form layout: work name + qty/cost/sum on one row */
.grid.grid-new{
  grid-template-columns: repeat(12, 1fr);
}
.grid.grid-new .field.half{ grid-column: span 6; }
.grid.grid-new .field.third{ grid-column: span 2; } /* 6 + 2 + 2 + 2 = 12 */

/* уменьшить "расстояние" для колонок Клиент и Работы (примерно на треть) */
th.col-client, td.col-client,
th.col-work, td.col-work{
  padding-left: 6px;
  padding-right: 6px;
}

/* сделать эти колонки компактнее */
th.col-client, td.col-client{ max-width: 220px; }
th.col-work, td.col-work{ max-width: 320px; }
td.col-client, td.col-work{
  white-space: normal;
  word-break: break-word;
}

/* readonly input style for Sum */
input[readonly]{
  opacity: 0.85;
  cursor: default;
}


/* sum flash animation */
@keyframes flashBg{
  0%   { box-shadow: 0 0 0 rgba(77,163,255,0.0); border-color: rgba(77,163,255,.40); }
  30%  { box-shadow: 0 0 0 4px rgba(77,163,255,.12); border-color: rgba(77,163,255,.85); }
  100% { box-shadow: 0 0 0 rgba(77,163,255,0.0); border-color: rgba(77,163,255,.55); }
}
.flash{
  animation: flashBg .35s ease-out;
}
input[readonly]{
  opacity: 0.92;
}


.kanban{
  display:flex;
  gap:20px;
  align-items:flex-start;
}
.kanban-col{
  flex:1;
  background: rgba(255,255,255,.02);
  border:1px solid rgba(37,48,74,.95);
  border-radius:16px;
  padding:12px;
  min-height:400px;
}
.kanban-title{
  text-align:center;
  margin-bottom:10px;
}
.kanban-card{
  margin-bottom:8px;
  cursor:grab;
}


/* Kanban enhancements */
.kanban-list.dragover{
  outline: 2px dashed rgba(77,163,255,.45);
  outline-offset: 6px;
  border-radius: 14px;
}
.kanban-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  transition: transform .18s ease, box-shadow .18s ease;
  user-select:none;
}
.kanban-card.dragging{
  opacity: 0.65;
  transform: scale(0.98);
}
.kanban-card.moved{
  transform: scale(1.02);
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}
.kanban-count{
  display:inline-flex;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.18);
  color:#fff;
  font-size: 12px;
  line-height: 1;
}

.kanban-list{ min-height: 320px; }


/* --- V6.3 new form grid fix --- */
.grid.grid-new{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.grid.grid-new .field{ grid-column: span 12; }
.grid.grid-new .field.half{ grid-column: span 6; }
.grid.grid-new .field.third{ grid-column: span 2; }
.grid.grid-new .field.full{ grid-column: span 12; }


/* --- V6.4 form row: 3 fields inside right half --- */
.grid.grid-new .label{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.triple-wrap{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-content: start;
}
.triple-wrap .triple-item{
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.triple-wrap .triple-hint{
  grid-column: 1 / -1;
  margin-top: -4px;
}


/* Suggestions dropdown (CRM-like) */
.suggest-box{
  position:absolute;
  left:0;
  right:0;
  top: calc(100% + 6px);
  background: linear-gradient(180deg, rgba(16,24,42,.98), rgba(16,24,42,.92));
  border:1px solid rgba(37,48,74,.95);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
  padding: 6px;
  z-index: 80;
  max-height: 220px;
  overflow:auto;
}
.suggest-item{
  padding: 10px 10px;
  border-radius: 12px;
  cursor: pointer;
  border:1px solid transparent;
}
.suggest-item:hover{
  border-color: rgba(77,163,255,.45);
  background: rgba(255,255,255,.03);
}
.suggest-item.active{
  border-color: rgba(77,163,255,.65);
  background: rgba(77,163,255,.10);
}


/* === Suggest dropdown alignment fix === */
.suggest-box{
  position:absolute;
  top:100%;
  left:0;
  width:100%;
  margin-top:6px;
  background:#111827;
  border:1px solid #2a3655;
  border-radius:12px;
  box-shadow:0 12px 30px rgba(0,0,0,.45);
  z-index:9999;
  max-height:240px;
  overflow-y:auto;
}

.suggest-item{
  padding:10px 12px;
  cursor:pointer;
  color:#fff;
}

.suggest-item:hover{
  background:#1f2937;
}

.suggest-item.active{
  background:#2563eb;
  color:#fff;
}


/* === Filter activation highlight animation === */
@keyframes filterGlow {
  0%   { box-shadow: 0 0 0 rgba(37,99,235,0); }
  40%  { box-shadow: 0 0 0 4px rgba(37,99,235,0.35); }
  100% { box-shadow: 0 0 0 rgba(37,99,235,0); }
}

.filter-activated {
  animation: filterGlow 0.6s ease-out;
}

/* === Suggest dropdown strictly under input === */
.suggest-box{
  position:absolute !important;
  top: calc(100% + 4px) !important;
  left: 0 !important;
  right: auto !important;
  width: 100% !important;
}


/* === Suggest dropdown animation (fade + slide) === */
.suggest-box{
  opacity: 1;
  transform: translateY(0);
  transition: opacity .14s ease, transform .14s ease;
}
.suggest-box.hidden{
  display:block;              /* keep for animation; hide via opacity */
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

/* Ensure wrapper drives positioning */
.suggest-wrap{
  position: relative;
  width: 100%;
  display: block;
}

/* Stronger guarantee: strictly under input */
.suggest-wrap > .suggest-box{
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  width: 100% !important;
}

/* === Active filter field: soft persistent border while checkbox enabled === */
:is(input,select,textarea).filter-enabled{
  border-color: rgba(37,99,235,.55) !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.14);
}


/* === Selected row highlight (checkbox in table row) === */
tr.row-selected > td{
  background: rgba(37,99,235,.10);
}
tr.row-selected{
  box-shadow: inset 3px 0 0 rgba(37,99,235,.75);
}
tr.row-selected:hover > td{
  background: rgba(37,99,235,.14);
}


/* === Validation UI === */
.is-invalid{
  border-color: rgba(239,68,68,.85) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.18) !important;
}
.field-error{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(239,68,68,.95);
}
.btn-disabled{
  opacity: .55;
  cursor: not-allowed;
}


/* Kanban card second line (master) */
.kanban-card{ display:flex; flex-direction:column; gap:4px; }
.kanban-client{ font-weight:700; }
.kanban-master{ font-size:12px; opacity:.9; }
.kanban-count{ font-size:12px; opacity:.9; }


/* === Kanban card typography (bigger text) === */
.kanban-card{
  font-size: 16px;
  line-height: 1.2;
  padding: 10px 12px;
}
.kanban-card .kanban-client{
  font-size: 17px;
  font-weight: 700;
  display:block;
}
.kanban-card .kanban-master{
  font-size: 14px;
  opacity: .95;
  display:block;
  margin-top: 4px;
}
.kanban-card .kanban-count{
  font-size: 12px;
  opacity: .8;
  display:block;
  margin-top: 6px;
}


/* === Kanban: header and count typography === */
.kanban-col-title{
  font-size: 17px;
  font-weight: 700;
}
.kanban-top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}
.kanban-count{
  font-size: 17px;
  font-weight: 700;
  opacity: .95;
}


/* === Kanban typography & layout tweaks === */
.kanban-title{
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.kanban-top{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 10px;
}

.kanban-client{
  font-size: 18px;
  font-weight: 700;
}

.kanban-count{
  font-size: 18px;
  font-weight: 700;
  opacity: .95;
}
.kanban-master{
  display:block;
  margin-top: 4px;
  font-size: 14px;
  opacity: .95;
}


/* === Kanban bigger typography === */
.kanban-title{ font-size: 20px; font-weight: 700; }
.kanban-client{ font-size: 20px; font-weight: 700; }
.kanban-count{ font-size: 20px; font-weight: 700; }


/* === Kanban counter ABSOLUTE size === */
.kanban-count{
  font-size: 30px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}


/* === Kanban counter ABSOLUTE 22px === */
.kanban-count{
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}


/* === Planning board (8 columns) === */
.planning-board{
  grid-template-columns: repeat(8, minmax(220px, 1fr));
  overflow-x: auto;
  padding-bottom: 10px;
}
.planning-board .kanban-col{
  min-width: 220px;
}


/* === Planning board: horizontal columns === */
.planning-board{
  display: flex !important;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}
.planning-board .kanban-col{
  flex: 0 0 260px;   /* fixed column width */
  min-width: 260px;
  scroll-snap-align: start;
}
.planning-board .kanban-dropzone{
  min-height: 60vh;
}


/* === Planning: 'Waiting' column sizing === */
.planning-board .kanban-col[data-col="waiting"]{
  flex: 0 0 260px; /* keep fixed width */
  min-width: 260px;
  align-self: flex-start; /* don't stretch column height */
}
.planning-board .kanban-col[data-col="waiting"] .kanban-dropzone{
  min-height: auto !important; /* adapt height to cards */
  height: auto;
}

/* Ensure cards keep the same compact height everywhere (including Waiting) */
.planning-board .kanban-card{
  height: auto;
  min-height: 0;
}


/* === Planning layout === */
.planning-waiting{
  margin-bottom: 14px;
}
.planning-waiting .kanban-col{
  width: 260px;
  max-width: 260px;
}
.planning-waiting .kanban-dropzone{
  min-height: auto !important;
  height: auto;
}

/* Horizontal day columns */
.planning-board{
  display: flex !important;
  gap: 14px;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}
.planning-board .kanban-col{
  flex: 0 0 260px;
  min-width: 260px;
  scroll-snap-align: start;
}

/* Restore column/card contour + fill (in case overridden elsewhere) */
.planning-waiting .kanban-col,
.planning-board .kanban-col{
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15,23,42,.06);
}
.planning-waiting .kanban-col-title,
.planning-board .kanban-col-title{
  padding: 10px 12px;
}
.planning-waiting .kanban-dropzone,
.planning-board .kanban-dropzone{
  padding: 10px 10px 12px;
}

.planning-waiting .kanban-card,
.planning-board .kanban-card{
  background: rgba(255,255,255,1);
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(15,23,42,.06);
  margin-bottom: 10px;
}
.planning-waiting .kanban-card:last-child,
.planning-board .kanban-card:last-child{
  margin-bottom: 0;
}


/* === v6_49 Planning: waiting full-width + restore dark theme === */

/* Waiting row full width */
.planning-waiting{
  width: 100% !important;
}
.planning-waiting .kanban-col{
  width: 100% !important;
  max-width: none !important;
}
.planning-waiting .kanban-dropzone{
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  min-height: auto !important;
  height: auto !important;
}

/* Cards in waiting wrap nicely */
.planning-waiting .kanban-card{
  width: 320px;
  max-width: calc(100% - 4px);
}

/* Restore kanban dark contour/fill (override any accidental white overrides) */
.planning-waiting .kanban-col,
.planning-board .kanban-col{
  background: rgba(255,255,255,.02) !important;
  border: 1px solid rgba(37,48,74,.95) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}
.planning-waiting .kanban-card,
.planning-board .kanban-card{
  background: rgba(0,0,0,.10) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 999px !important; /* keep pill look */
  box-shadow: none !important;
}

/* Make column titles clearly visible */
.planning-waiting .kanban-col-title,
.planning-board .kanban-col-title{
  color: rgba(255,255,255,.92) !important;
}

/* Keep the count readable on dark */
.planning-waiting .kanban-count,
.planning-board .kanban-count{
  color: #fff !important;
}


/* === v6_50 Planning UI polish (A+C+D+E) === */
.planning-waiting .kanban-title,
.planning-board .kanban-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size: 18px;
  font-weight: 700;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.col-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.92);
  font-weight: 700;
  font-size: 14px;
}
.col-subtitle{
  padding: 6px 14px 0;
  color: rgba(255,255,255,.55);
  font-size: 13px;
}
.planning-waiting .kanban-card{
  width: 300px;
}
.planning-waiting .kanban-card,
.planning-board .kanban-card{
  padding: 10px 12px;
  border-radius: 14px !important;
  cursor: grab;
}
.planning-waiting .kanban-card:active,
.planning-board .kanban-card:active{
  cursor: grabbing;
}
.planning-waiting .kanban-client,
.planning-board .kanban-client{
  font-size: 16px;
  font-weight: 700;
}
.planning-waiting .kanban-master,
.planning-board .kanban-master{
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,.70);
}
.kanban-card.dragging{
  opacity: .65;
  transform: scale(0.98);
}
.kanban-col.col-dragover{
  border-color: rgba(80,160,255,.55) !important;
  box-shadow: 0 0 0 2px rgba(80,160,255,.12);
}
.kanban-dropzone.drag-over{
  outline: 1px dashed rgba(80,160,255,.45);
  outline-offset: 6px;
}
.planning-board .kanban-dropzone{
  min-height: 55vh;
}


/* === v6_51 Planning: placeholder + insertion indicator === */
.drop-placeholder{
  border-radius: 14px;
  border: 2px dashed rgba(80,160,255,.45);
  background: rgba(80,160,255,.06);
  transition: all .12s ease;
  box-sizing: border-box;
}
.drop-placeholder.drop-indicator{
  border-color: rgba(80,160,255,.9);
  box-shadow: 0 0 0 3px rgba(80,160,255,.12);
}

.planning-waiting .kanban-card,
.planning-board .kanban-card{
  transition: transform .12s ease, opacity .12s ease;
}


/* === v6_52 Planning: allow drop into empty waiting + smoother === */
.planning-waiting .kanban-dropzone[data-col="waiting"]{
  min-height: 120px !important; /* so you can drop back when empty */
  align-content: flex-start;
}


/* === v6_53 Planning: waiting card width matches day columns === */
.planning-waiting .kanban-card{
  width: 260px !important;
}

/* Placeholder: solid blue outline for "new place" while dragging */
.drop-placeholder{
  border: 2px solid rgba(80,160,255,.95) !important;
  background: rgba(80,160,255,.08) !important;
}


/* === v6_54 Planning: compact waiting height + match widths === */
:root{
  --plan-col-width: 260px;
}

/* Ensure columns use same width variable */
.planning-board .kanban-col{
  flex: 0 0 var(--plan-col-width) !important;
  min-width: var(--plan-col-width) !important;
}
.planning-waiting .kanban-card{
  width: var(--plan-col-width) !important;
}

/* Waiting area compact: no huge empty space */
.planning-waiting .kanban-dropzone{
  padding-bottom: 8px !important;
}
.planning-waiting .kanban-dropzone[data-col="waiting"]{
  min-height: 0 !important;
}

/* The waiting column container should hug its content */
.planning-waiting .kanban-col{
  padding-bottom: 6px;
}


/* === v6_55 Planning: remove extra waiting empty space + ghost placeholder text === */
.planning-waiting .kanban-dropzone[data-col="waiting"]{
  min-height: 0 !important;
  height: auto !important;
  padding-bottom: 6px !important;
}
.planning-waiting .kanban-col{
  padding-bottom: 0 !important;
}
.planning-waiting{
  margin-bottom: 10px !important;
}

/* Ghost placeholder shows card content with good contrast */
.drop-placeholder.drop-ghost{
  color: #fff !important;
}
.drop-placeholder.drop-ghost .kanban-client,
.drop-placeholder.drop-ghost .kanban-master,
.drop-placeholder.drop-ghost .kanban-count{
  color: #fff !important;
}
/* slightly dim secondary line for readability */
.drop-placeholder.drop-ghost .kanban-master{
  opacity: .9;
}


/* === v6_56 Planning: center text in drag ghost, keep counter right === */
.drop-placeholder.drop-ghost{
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  text-align: center;
}

.drop-placeholder.drop-ghost .kanban-count{
  position: absolute !important;
  right: 10px;
  top: 8px;
  align-self: auto !important;
}


/* === v6_57 Planning: stabilize waiting placeholder in empty area === */
.planning-waiting .kanban-dropzone[data-col="waiting"]{
  padding-bottom: 6px !important;
}


/* === v6_58 Planning: remove big empty gap in Waiting === */
.planning-waiting .kanban-col{
  height: auto !important;
  align-self: flex-start;
}
.planning-waiting .kanban-dropzone[data-col="waiting"]{
  /* when there are cards, hug content */
  min-height: 0 !important;
  height: auto !important;
  align-content: flex-start;
}
/* keep a small droppable area when Waiting is empty */
.planning-waiting .kanban-dropzone[data-col="waiting"]:empty{
  min-height: 84px !important;
}

/* ensure no inherited min-height from generic kanban styles */
.planning-waiting .kanban-dropzone{
  min-height: 0 !important;
}


/* === v6_61 Planning: compact Waiting without side effects === */
/* Global kanban columns have min-height:400px; Waiting must not. */
.planning-waiting .kanban-col,
.planning-waiting .kanban-col.planning-waiting-col{
  min-height: 0 !important;
  height: auto !important;
  align-self: flex-start;
}

/* Waiting dropzone hugs content */
.planning-waiting .kanban-dropzone[data-col="waiting"]{
  min-height: 0 !important;
  height: auto !important;
}

/* Keep small droppable area when empty */
.planning-waiting .kanban-dropzone[data-col="waiting"]:empty{
  min-height: 84px !important;
}

/* v6_73 admin panel */
.admin-add .row{display:flex; gap:12px; align-items:center; margin-top:8px;}
.admin-table{margin-top:18px; border-top:1px solid rgba(255,255,255,.08);}
.admin-head,.admin-row{display:grid; grid-template-columns: 280px 1fr 160px; gap:16px; padding:12px 0; align-items:center; border-top:1px solid rgba(255,255,255,.06);}
.admin-head{display:grid; grid-template-columns: 280px 1fr 160px; gap:16px; padding:10px 0; color:rgba(255,255,255,.7); font-size:14px;}
.admin-row{border-top:1px solid rgba(255,255,255,.06);}
.admin-name{font-weight:600;}
.admin-inline{display:flex; gap:8px; align-items:center;}
.input-sm{padding:8px 10px; font-size:14px;}
.btn-sm{padding:8px 12px; font-size:14px;}
.btn-danger{border-color: rgba(255,90,90,.35); color:#ffd7d7;}
.muted{color:rgba(255,255,255,.45);}

/* v6_75: small refresh button in admin */
[data-refresh-masters]{min-width:44px; padding:10px 12px; line-height:1; border-radius:14px;}

.admin-name{font-weight:600;}
.admin-toggle{display:flex; justify-content:flex-start;}
.admin-rename .input-sm{flex:1; min-width:220px;}
@media (max-width: 1100px){
  .admin-head{grid-template-columns: 1fr; row-gap:6px;}
  .admin-row{grid-template-columns: 1fr; row-gap:10px;}
  .admin-toggle{justify-content:flex-start;}
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toggle-password,
.generate-password {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

#strength-indicator {
    margin-top: 5px;
    font-size: 14px;
}

/* password controls: place icons inside input field */
.password-wrapper {
    position: relative;
    display: block;
}

.password-wrapper .input {
    padding-right: 42px;
}

.password-wrapper.has-generator .input {
    padding-right: 74px;
}

.password-wrapper .toggle-password,
.password-wrapper .generate-password {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.password-wrapper .toggle-password {
    right: 8px;
}

.password-wrapper .generate-password {
    right: 34px;
}

#strength-indicator {
    margin-top: 5px;
    font-size: 14px;
}
