/* ============================================================
   TechWaWi — Tricoma-Style Design System
   ============================================================ */

:root {
  --bar-h: 40px;
  --bar-bg: #1c2118;
  --bar-hover: rgba(114,184,54,.12);
  --bar-text: rgba(220,235,210,.9);
  --bar-border: rgba(255,255,255,.07);

  --accent: #72b836;
  --accent-dark: #5a9228;
  --accent-light: rgba(114,184,54,.12);

  --desktop-bg: #0f1610;

  --bg-card: #ffffff;
  --bg-body: #f2f4ef;
  --text-primary: #1a1d18;
  --text-secondary: #545c4e;
  --text-muted: #8a9280;

  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --info: #2196f3;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.1);
  --shadow-md: 0 4px 16px rgba(0,0,0,.15);

  --taskbar-h: 44px;
}

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: .875rem;
  color: var(--text-primary);
  background: var(--desktop-bg);
  line-height: 1.5;
  overflow: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top Menu Bar ─────────────────────────────────── */
.tw-bar {
  height: var(--bar-h);
  background: var(--bar-bg);
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(0,0,0,.5);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.tw-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px;
  border-right: 1px solid var(--bar-border);
  text-decoration: none; flex-shrink: 0;
}
.tw-brand:hover { text-decoration: none; }
.tw-brand-mark {
  width: 24px; height: 24px;
  background: var(--accent);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; color: #fff;
}
.tw-brand-name {
  font-size: .85rem; font-weight: 700;
  color: #fff; letter-spacing: .02em; white-space: nowrap;
}

/* Nav */
.tw-nav { display: flex; align-items: stretch; flex: 1; }
.tw-nav .dropdown { display: flex; }
.tw-nav .dropdown-toggle {
  display: flex; align-items: center; gap: 5px;
  padding: 0 14px;
  background: none; border: none; cursor: pointer;
  color: var(--bar-text);
  font-size: .82rem; font-weight: 500;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.tw-nav .dropdown-toggle::after {
  display: inline-block;
  border-top: .28em solid;
  border-right: .28em solid transparent;
  border-left: .28em solid transparent;
  margin-top: 2px;
}
.tw-nav .dropdown-toggle:hover,
.tw-nav .dropdown-toggle.show { background: var(--bar-hover); color: var(--accent); }
.tw-nav .dropdown-toggle.tw-active { color: var(--accent); }
.tw-nav .tw-nav-link {
  display: flex; align-items: center; gap: 5px;
  padding: 0 14px;
  color: var(--bar-text);
  font-size: .82rem; font-weight: 500;
  text-decoration: none;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.tw-nav .tw-nav-link:hover { background: var(--bar-hover); color: var(--accent); }
.tw-nav .tw-nav-link.tw-active { color: var(--accent); }

.tw-nav .dropdown-menu {
  padding: 4px 0; min-width: 210px;
  background: #232e1f;
  border: 1px solid rgba(0,0,0,.5);
  border-top: 2px solid var(--accent);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
  margin-top: 0;
}
.tw-nav .dropdown-item {
  padding: 8px 16px; font-size: .82rem;
  color: rgba(220,235,210,.8);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.tw-nav .dropdown-item:hover { background: var(--bar-hover); color: var(--accent); text-decoration: none; }
.tw-nav .dropdown-item i { font-size: 13px; width: 15px; text-align: center; opacity: .65; }
.tw-nav .dropdown-item.tw-disabled { opacity: .3; pointer-events: none; cursor: default; }
.tw-nav .dropdown-divider { border-color: rgba(255,255,255,.07); margin: 3px 0; }
.tw-nav .dropdown-header {
  padding: 6px 16px 2px;
  font-size: .67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,.25);
}

/* Right bar */
.tw-bar-right {
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px; border-left: 1px solid var(--bar-border); flex-shrink: 0;
}
.tw-search { position: relative; }
.tw-search input {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  padding: 5px 10px 5px 27px;
  font-size: .78rem; color: #fff; width: 165px; outline: none;
  transition: all .2s;
}
.tw-search input::placeholder { color: rgba(255,255,255,.28); }
.tw-search input:focus { background: rgba(255,255,255,.1); border-color: var(--accent); width: 210px; }
.tw-search-ico {
  position: absolute; left: 8px; top: 50%;
  transform: translateY(-50%);
  font-size: 11px; color: rgba(255,255,255,.3); pointer-events: none;
}
.tw-bar-btn {
  width: 30px; height: 30px; background: none; border: none;
  border-radius: var(--radius-sm); color: var(--bar-text); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .12s, color .12s; position: relative;
}
.tw-bar-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.tw-clock { font-size: .72rem; color: rgba(220,235,210,.4); white-space: nowrap; padding: 0 6px; }

.tw-user { display: flex; align-items: center; }
.tw-user .dropdown-toggle {
  display: flex; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer;
  padding: 5px 8px; border-radius: var(--radius-sm);
  transition: background .12s; color: var(--bar-text); font-size: .8rem;
}
.tw-user .dropdown-toggle:hover { background: rgba(255,255,255,.08); }
.tw-user .dropdown-toggle::after { display: none; }
.tw-user-avatar {
  width: 26px; height: 26px; background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .64rem; font-weight: 700; color: #fff;
}
.tw-user .dropdown-menu {
  min-width: 170px; background: #232e1f;
  border: 1px solid rgba(0,0,0,.5); border-top: 2px solid var(--accent);
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 4px 0;
}
.tw-user .dropdown-item { padding: 8px 16px; font-size: .82rem; color: rgba(220,235,210,.8); display: flex; align-items: center; gap: 8px; }
.tw-user .dropdown-item:hover { background: var(--bar-hover); color: var(--accent); }
.tw-user .dropdown-item-text { padding: 6px 16px; font-size: .73rem; color: rgba(255,255,255,.3); display: block; }

/* ── Desktop Layout ───────────────────────────────── */
.tw-desktop {
  margin-top: var(--bar-h);
  min-height: calc(100vh - var(--bar-h));
  display: flex;
}
.tw-desktop-main { flex: 1; padding: 24px; overflow-y: auto; }
.tw-desktop-right {
  width: 284px; flex-shrink: 0;
  border-left: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.015);
  padding: 14px; overflow-y: auto;
}

.tw-section-lbl {
  font-size: .64rem; text-transform: uppercase; letter-spacing: .13em;
  color: rgba(255,255,255,.18);
  padding-bottom: 7px; margin-bottom: 10px; margin-top: 26px;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.tw-section-lbl:first-child { margin-top: 0; }

/* Desktop icon grid */
.tw-icon-grid { display: flex; flex-wrap: wrap; gap: 4px; }

.tw-icon {
  width: 92px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 8px; border-radius: var(--radius-md);
  text-decoration: none; cursor: pointer; transition: background .15s; position: relative;
}
.tw-icon:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.tw-icon:active { background: rgba(114,184,54,.14); }

.tw-icon-img {
  width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 25px; flex-shrink: 0;
}
.tw-icon-img.c-green  { background: rgba(114,184,54,.18); color: #8ed048; }
.tw-icon-img.c-blue   { background: rgba(33,150,243,.18); color: #4fc3f7; }
.tw-icon-img.c-amber  { background: rgba(255,152,0,.18);  color: #ffb74d; }
.tw-icon-img.c-red    { background: rgba(244,67,54,.18);  color: #ef9a9a; }
.tw-icon-img.c-purple { background: rgba(156,39,176,.18); color: #ce93d8; }
.tw-icon-img.c-teal   { background: rgba(0,150,136,.18);  color: #4db6ac; }
.tw-icon-img.c-gray   { background: rgba(255,255,255,.06); color: rgba(255,255,255,.22); }

.tw-icon-lbl {
  font-size: .71rem; font-weight: 500;
  color: rgba(220,235,210,.82);
  text-align: center; line-height: 1.25;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
  max-width: 80px;
}
.tw-icon.coming .tw-icon-img,
.tw-icon.coming .tw-icon-lbl { opacity: .28; }
.tw-icon.coming { cursor: default; pointer-events: none; }

.tw-icon-badge {
  position: absolute; top: 9px; right: 11px;
  background: var(--danger); color: #fff;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── Desktop Right Panel ──────────────────────────── */
.tw-kpi-strip {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: rgba(255,255,255,.05);
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 12px;
}
.tw-kpi { background: rgba(255,255,255,.03); padding: 10px 12px; text-align: center; }
.tw-kpi-val { font-size: 1.3rem; font-weight: 700; color: #fff; }
.tw-kpi-lbl { font-size: .63rem; color: rgba(255,255,255,.32); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }

.tw-panel {
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--radius-sm);
  overflow: hidden; margin-bottom: 10px;
}
.tw-panel-head {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  background: rgba(255,255,255,.02);
  display: flex; align-items: center; justify-content: space-between;
}
.tw-panel-head-lbl {
  font-size: .71rem; font-weight: 600;
  color: rgba(220,235,210,.65);
  display: flex; align-items: center; gap: 6px;
}
.tw-panel-head-lbl i { color: var(--accent); }
.tw-panel-head-link { font-size: .68rem; color: var(--accent); text-decoration: none; }
.tw-panel-head-link:hover { text-decoration: underline; }

.tw-panel-item {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  display: flex; align-items: flex-start; gap: 9px;
}
.tw-panel-item:last-child { border-bottom: none; }
.tw-panel-item-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 5px;
}
.tw-panel-item-dot.new        { background: #4fc3f7; }
.tw-panel-item-dot.processing { background: #ffb74d; }
.tw-panel-item-dot.shipped    { background: #81c784; }
.tw-panel-item-dot.critical   { background: #ef9a9a; }
.tw-panel-item-main { flex: 1; min-width: 0; }
.tw-panel-item-title { font-size: .74rem; color: rgba(255,255,255,.72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-panel-item-sub { font-size: .67rem; color: rgba(255,255,255,.3); margin-top: 1px; }
.tw-panel-item-val { font-size: .74rem; font-weight: 600; color: var(--accent); flex-shrink: 0; }

/* ── Module Window ────────────────────────────────── */
.tw-module-wrap {
  margin-top: var(--bar-h);
  min-height: calc(100vh - var(--bar-h));
  padding: 14px;
}
.module-window {
  background: var(--bg-body);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,.45);
  border: 1px solid rgba(0,0,0,.2);
  min-height: calc(100vh - var(--bar-h) - 28px);
}
.module-titlebar {
  background: #fff;
  border-bottom: 2px solid var(--accent);
  padding: 11px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.module-titlebar h1 {
  font-size: .95rem; font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.module-titlebar h1 i { color: var(--accent); }
.module-titlebar-actions { display: flex; gap: 8px; align-items: center; }
.module-body { padding: 20px; }

/* ── Page elements ────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.page-header h1 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--bg-card); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); border: 1px solid #e6ebe1;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 0;
}
.card-title { font-size: .87rem; font-weight: 600; margin: 0; }
.card-body { padding: 18px; }
.card-body.no-pad { padding: 0; }

/* ── Filter Bar ───────────────────────────────────── */
.filter-bar {
  background: var(--bg-card); border: 1px solid #e6ebe1;
  border-radius: var(--radius-md); padding: 12px 14px;
  margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row .form-control,
.filter-row .form-select {
  height: 34px; font-size: .82rem; border-color: #d8dfd3; border-radius: var(--radius-sm);
}
.filter-row .form-control:focus,
.filter-row .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(114,184,54,.15);
}
.filter-search { position: relative; flex: 1; min-width: 200px; }
.filter-search i { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: #999; font-size: 12px; }
.filter-search input { padding-left: 30px; width: 100%; }
.btn-filter-reset {
  height: 34px; padding: 0 12px; border: 1px solid #d8dfd3; background: none;
  border-radius: var(--radius-sm); font-size: .8rem; color: var(--text-secondary);
  cursor: pointer; white-space: nowrap; transition: all .12s;
}
.btn-filter-reset:hover { border-color: var(--danger); color: var(--danger); }

/* ── DataTable ────────────────────────────────────── */
.dt-card { overflow: hidden; }
.dt-card .dataTables_wrapper .row { margin: 0; }
.dt-card .dataTables_length,
.dt-card .dataTables_info { padding: 10px 18px; font-size: .79rem; color: var(--text-muted); }
.dt-card .dataTables_paginate { padding: 8px 18px; }

table.dataTable { border-collapse: collapse !important; width: 100% !important; }
table.dataTable thead th {
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  border-bottom: 1px solid #e6ebe1 !important; border-top: none !important;
  padding: 9px 14px !important; white-space: nowrap; background: #f5f7f3;
}
table.dataTable tbody tr { cursor: pointer; transition: background .1s; }
table.dataTable tbody tr:hover { background: #f5f7f3; }
table.dataTable tbody td {
  padding: 10px 14px !important; border-top: 1px solid #eef1eb !important;
  vertical-align: middle; font-size: .855rem;
}

/* ── Status Badges ────────────────────────────────── */
.badge-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: .71rem; font-weight: 600; white-space: nowrap;
}
.badge-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-new        { background: #e6f4fb; color: #1278b0; }
.badge-processing { background: #fef3e2; color: #b87011; }
.badge-shipped    { background: #edf7ee; color: #2e7d32; }
.badge-delivered  { background: #e6f4ea; color: #1b5e20; }
.badge-cancelled  { background: #fdecea; color: #c62828; }
.badge-returned   { background: #fef1e0; color: #bf360c; }
.badge-neutral    { background: #f0f3ed; color: #5a7050; }

/* Marketplace badges */
.mp-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: .71rem; font-weight: 600; white-space: nowrap;
}
.mp-amazon   { background: #fff5e6; color: #c5700c; }
.mp-ebay     { background: #e8edfb; color: #1a4cb3; }
.mp-kaufland { background: #fde8e8; color: #b00020; }
.mp-shopware { background: #e8f5e9; color: #1b7a36; }
.mp-manual   { background: #f0f3ed; color: #5a7050; }

/* Logo variant: image instead of text label */
.mp-badge.mp-logo { background: transparent; padding: 0; }
.mp-badge.mp-logo img { display: block; height: 18px; width: auto; }

/* Stock */
.stock-ok       { color: #2e7d32; font-weight: 600; }
.stock-low      { color: #b87011; font-weight: 600; }
.stock-critical { color: #c62828; font-weight: 600; }
.stock-zero     { color: var(--text-muted); }

/* ── Buttons ──────────────────────────────────────── */
.btn-primary { background: var(--accent); border-color: var(--accent); font-weight: 500; border-radius: var(--radius-sm); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-sm { padding: .28rem .65rem; font-size: .78rem; }

/* ── Timeline ─────────────────────────────────────── */
.timeline { padding: 0; list-style: none; }
.timeline-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline-item:not(:last-child) .tl-line {
  position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: #e6ebe1;
}
.tl-dot {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; margin-top: 1px; z-index: 1;
}
.tl-dot.blue  { background: #e6f4fb; color: #1278b0; }
.tl-dot.green { background: #edf7ee; color: #2e7d32; }
.tl-dot.amber { background: #fef3e2; color: #b87011; }
.tl-dot.red   { background: #fdecea; color: #c62828; }
.tl-body { flex: 1; }
.tl-label { font-size: .83rem; font-weight: 500; }
.tl-time  { font-size: .73rem; color: var(--text-muted); }

/* ── Empty state ──────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state i { font-size: 36px; opacity: .28; display: block; margin-bottom: 10px; }

/* ── Stat bar ─────────────────────────────────────── */
.stat-bar {
  display: flex; gap: 1px; background: #e6ebe1;
  border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 18px;
}
.stat-bar-item { flex: 1; background: var(--bg-card); padding: 13px 16px; text-align: center; }
.stat-bar-value { font-size: 1.3rem; font-weight: 700; }
.stat-bar-label { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }

/* ── Detail grid ──────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-row { display: flex; gap: 6px; padding: 6px 0; border-bottom: 1px solid #eef1eb; align-items: baseline; }
.detail-label { font-size: .76rem; color: var(--text-muted); min-width: 130px; font-weight: 500; flex-shrink: 0; }
.detail-value { font-size: .85rem; }

/* ── Login Page · "Aurora Grid" ───────────────────── */
@property --angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.login-shell {
  min-height: 100vh;
  margin: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #14211a 0%, #0a110c 60%, #07090a 100%);
  color: #eaf3e2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  position: relative;
}

/* ── Background layers ──────────────────────────── */
.login-bg {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
}
.aurora {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .55; mix-blend-mode: screen;
  will-change: transform;
}
.aurora-1 {
  width: 60vmax; height: 60vmax; top: -20vmax; left: -10vmax;
  background: radial-gradient(circle, rgba(114,184,54,.55), rgba(114,184,54,0) 65%);
  animation: aurora-drift-a 28s ease-in-out infinite alternate;
}
.aurora-2 {
  width: 55vmax; height: 55vmax; bottom: -25vmax; right: -15vmax;
  background: radial-gradient(circle, rgba(60,180,140,.45), rgba(60,180,140,0) 65%);
  animation: aurora-drift-b 36s ease-in-out infinite alternate;
}
.aurora-3 {
  width: 38vmax; height: 38vmax; top: 30%; left: 50%;
  background: radial-gradient(circle, rgba(180,230,90,.30), rgba(180,230,90,0) 65%);
  animation: aurora-drift-c 22s ease-in-out infinite alternate;
}
@keyframes aurora-drift-a {
  0%   { transform: translate(0,0) scale(1)      rotate(0deg); }
  100% { transform: translate(8vw,6vh) scale(1.15) rotate(40deg); }
}
@keyframes aurora-drift-b {
  0%   { transform: translate(0,0) scale(1)      rotate(0deg); }
  100% { transform: translate(-6vw,-8vh) scale(1.2) rotate(-50deg); }
}
@keyframes aurora-drift-c {
  0%   { transform: translate(-50%,-50%) scale(.9) rotate(0deg); }
  100% { transform: translate(-40%,-60%) scale(1.1) rotate(60deg); }
}

/* Perspective grid floor */
.login-grid {
  position: absolute; left: 50%; bottom: -10%;
  width: 220vw; height: 130vh;
  transform: translateX(-50%) perspective(700px) rotateX(62deg);
  transform-origin: 50% 100%;
  background-image:
    linear-gradient(to right, rgba(114,184,54,.18) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(114,184,54,.18) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 100%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 100%, #000 30%, transparent 75%);
  animation: grid-pan 14s linear infinite;
  opacity: .85;
}
@keyframes grid-pan {
  0%   { background-position: 0 0; }
  100% { background-position: 0 64px; }
}

/* Floating particles */
.login-particles {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .8;
}
.login-particles circle {
  fill: #b8e879;
  animation: particle-float var(--d, 12s) ease-in-out infinite alternate;
  animation-delay: var(--dl, 0s);
  filter: drop-shadow(0 0 4px rgba(180,230,120,.6));
  transform-box: fill-box;
  transform-origin: center;
}
@keyframes particle-float {
  0%   { transform: translateY(0) translateX(0); opacity: .15; }
  50%  { opacity: .9; }
  100% { transform: translateY(-30px) translateX(12px); opacity: .25; }
}

/* Subtle film grain to kill banding */
.login-noise {
  position: absolute; inset: 0; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ── Stage + card ────────────────────────────────── */
.login-stage {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px; padding: 24px;
}
.login-card {
  position: relative;
  background: linear-gradient(160deg, rgba(28,42,24,.78), rgba(18,28,18,.72));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 40px 36px 28px;
  box-shadow:
    0 30px 80px rgba(0,0,0,.6),
    0 1px 0 rgba(255,255,255,.06) inset,
    0 0 0 1px rgba(114,184,54,.05) inset;
  animation: card-rise .9s cubic-bezier(.2,.85,.2,1) both;
  overflow: hidden;
  isolation: isolate;
}
@keyframes card-rise {
  from { opacity: 0; transform: translateY(28px) scale(.97); clip-path: inset(0 0 100% 0 round 18px); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   clip-path: inset(0 0 0 0     round 18px); }
}

/* Conic light sweep on border */
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 19px; padding: 1px;
  background: conic-gradient(from var(--angle),
    transparent 0deg,
    rgba(114,184,54,.0) 280deg,
    rgba(180,230,120,.85) 330deg,
    rgba(114,184,54,1) 350deg,
    transparent 360deg);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  animation: border-sweep 8s linear infinite;
  z-index: 2;
}
@keyframes border-sweep { to { --angle: 360deg; } }

/* Soft inner glow blob behind content */
.login-card-glow {
  position: absolute; top: -40%; left: 50%; transform: translateX(-50%);
  width: 120%; height: 80%;
  background: radial-gradient(ellipse at center, rgba(114,184,54,.22), transparent 60%);
  filter: blur(20px); pointer-events: none; z-index: 0;
  animation: glow-breath 5s ease-in-out infinite alternate;
}
@keyframes glow-breath {
  0%   { opacity: .6; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 1;  transform: translate(-50%, -4%) scale(1.05); }
}

/* Stagger reveal for inner blocks */
.login-card > *:not(.login-card-glow) {
  position: relative; z-index: 1;
  animation: item-rise .7s cubic-bezier(.2,.85,.2,1) both;
  animation-delay: calc(120ms + var(--seq, 0) * 90ms);
}
@keyframes item-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Logo ────────────────────────────────────────── */
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-logo-mark {
  position: relative;
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--accent), #4f8a1f);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px;
  box-shadow:
    0 6px 24px rgba(114,184,54,.45),
    0 0 0 1px rgba(255,255,255,.12) inset;
  animation: mark-float 5s ease-in-out infinite alternate;
}
@keyframes mark-float {
  0%   { transform: translateY(0) rotate(-2deg); }
  100% { transform: translateY(-3px) rotate(2deg); }
}
.login-logo-pulse {
  position: absolute; inset: -4px; border-radius: 14px;
  background: radial-gradient(circle, rgba(114,184,54,.6), transparent 70%);
  filter: blur(10px); z-index: -1;
  animation: mark-pulse 3.2s ease-in-out infinite;
}
@keyframes mark-pulse {
  0%, 100% { opacity: .4; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.2); }
}
.login-logo-text {
  font-size: 1.15rem; font-weight: 700; color: #fff;
  letter-spacing: .02em;
  background: linear-gradient(120deg, #fff 0%, #d8f0b9 50%, #fff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: text-shimmer 5s linear infinite;
}
@keyframes text-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.login-logo-sub { font-size: .74rem; color: rgba(220,235,210,.5); letter-spacing: .04em; }

/* ── Headings ────────────────────────────────────── */
.login-title {
  font-size: 1.55rem; font-weight: 700; margin: 0 0 6px; color: #fff;
  letter-spacing: -.01em;
}
.login-sub {
  font-size: .88rem; color: rgba(220,235,210,.55); margin: 0 0 26px;
}

/* ── Flash messages ──────────────────────────────── */
.login-flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.login-flash {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px; font-size: .84rem;
  border: 1px solid transparent;
  animation: flash-in .5s cubic-bezier(.2,.85,.2,1) both;
}
.login-flash i { font-size: 1rem; flex-shrink: 0; }
.login-flash-danger {
  background: rgba(244,67,54,.12); color: #ff8a80;
  border-color: rgba(244,67,54,.35);
  animation: flash-in .5s cubic-bezier(.2,.85,.2,1) both, flash-shake .5s ease .5s;
}
.login-flash-success {
  background: rgba(76,175,80,.14); color: #b8e6a0;
  border-color: rgba(76,175,80,.4);
}
.login-flash-info, .login-flash-warning {
  background: rgba(255,180,60,.12); color: #ffd089;
  border-color: rgba(255,180,60,.35);
}
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes flash-shake {
  0%,100%{transform:translateX(0)} 20%{transform:translateX(-5px)}
  40%{transform:translateX(5px)} 60%{transform:translateX(-3px)} 80%{transform:translateX(3px)}
}

/* ── Form fields (floating labels) ───────────────── */
.login-form { display: flex; flex-direction: column; gap: 18px; }
.login-field {
  position: relative;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.login-field:focus-within {
  background: rgba(255,255,255,.07);
  border-color: rgba(114,184,54,.5);
  box-shadow: 0 0 0 4px rgba(114,184,54,.12);
}
.login-field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: rgba(220,235,210,.4); font-size: 1rem;
  pointer-events: none;
  transition: color .25s, transform .25s;
}
.login-field:focus-within .login-field-icon {
  color: var(--accent);
  transform: translateY(-50%) scale(1.1);
}
.login-input {
  width: 100%;
  background: transparent; border: 0; outline: none;
  color: #fff; font-size: .95rem;
  padding: 22px 14px 8px 44px;
  border-radius: 12px;
  -webkit-text-fill-color: #fff;
}
.login-field-pw .login-input { padding-right: 78px; }
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fff;
  -webkit-box-shadow: 0 0 0 1000px rgba(28,42,24,.001) inset;
  transition: background-color 9999s ease-in-out 0s;
  caret-color: #fff;
}
.login-label {
  position: absolute; left: 44px; top: 50%; transform: translateY(-50%);
  color: rgba(220,235,210,.45); font-size: .9rem;
  pointer-events: none;
  transition: top .2s ease, font-size .2s ease, color .2s ease, transform .2s ease;
}
.login-input:focus + .login-label,
.login-input:not(:placeholder-shown) + .login-label {
  top: 9px; transform: translateY(0);
  font-size: .68rem; font-weight: 500;
  color: var(--accent); letter-spacing: .04em; text-transform: uppercase;
}
.login-field-line {
  position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  transform: scaleX(0); transform-origin: center;
  transition: transform .35s cubic-bezier(.2,.85,.2,1);
  border-radius: 2px;
}
.login-field:focus-within .login-field-line { transform: scaleX(1); }

.login-pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  background: transparent; border: 0; border-radius: 8px;
  color: rgba(220,235,210,.5); cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s;
}
.login-pw-toggle:hover { color: var(--accent); background: rgba(114,184,54,.08); }
.login-pw-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.login-caps {
  position: absolute; right: 50px; top: 50%; transform: translateY(-50%);
  color: #ffc857; font-size: .9rem;
  display: inline-flex; align-items: center;
  animation: caps-fade .25s ease both;
}
.login-caps[hidden] { display: none; }
@keyframes caps-fade { from { opacity: 0; transform: translateY(-50%) scale(.7); } to { opacity: 1; transform: translateY(-50%) scale(1); } }

/* ── Submit button ───────────────────────────────── */
.login-submit {
  --mx: 50%; --my: 50%;
  position: relative;
  margin-top: 6px;
  width: 100%; padding: 14px 18px;
  border: 0; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; font-weight: 600; font-size: .95rem; letter-spacing: .02em;
  overflow: hidden;
  box-shadow:
    0 10px 26px rgba(114,184,54,.35),
    0 0 0 1px rgba(255,255,255,.08) inset;
  transition: transform .15s ease, box-shadow .25s ease, filter .2s ease;
  isolation: isolate;
}
.login-submit::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(180px circle at var(--mx) var(--my),
    rgba(255,255,255,.35), transparent 60%);
  opacity: 0; transition: opacity .25s;
}
.login-submit:hover::before { opacity: 1; }
.login-submit:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 36px rgba(114,184,54,.5),
    0 0 0 1px rgba(255,255,255,.12) inset;
}
.login-submit:active { transform: translateY(0); filter: brightness(.95); }
.login-submit:focus-visible {
  outline: none;
  box-shadow:
    0 10px 26px rgba(114,184,54,.45),
    0 0 0 4px rgba(114,184,54,.35);
}
.login-submit-shine {
  position: absolute; top: 0; left: -60%; width: 50%; height: 100%; z-index: 1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%);
  transform: skewX(-20deg);
  animation: btn-shine 4.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes btn-shine {
  0%, 60% { left: -60%; }
  100%    { left: 130%; }
}
.login-submit-label {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  transition: opacity .2s, transform .2s;
}
.login-submit-label i { font-size: 1.05rem; }
.login-submit-spinner {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0; pointer-events: none;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.login-submit.is-loading { cursor: wait; }
.login-submit.is-loading .login-submit-label { opacity: 0; transform: scale(.9); }
.login-submit.is-loading .login-submit-spinner { opacity: 1; }

/* ── Footer ──────────────────────────────────────── */
.login-foot {
  margin-top: 22px;
  display: flex; justify-content: center; gap: 8px;
  font-size: .72rem; color: rgba(220,235,210,.35); letter-spacing: .03em;
}
.login-foot-dot { opacity: .6; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 480px) {
  .login-stage { padding: 16px; }
  .login-card { padding: 30px 22px 22px; border-radius: 16px; }
  .login-title { font-size: 1.35rem; }
  .aurora { filter: blur(70px); }
  .login-grid { transform: translateX(-50%) perspective(600px) rotateX(70deg); }
}

/* ── Reduced motion ──────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .aurora, .login-grid, .login-particles circle,
  .login-card::before, .login-card-glow, .login-logo-mark,
  .login-logo-pulse, .login-logo-text, .login-submit-shine {
    animation: none !important;
  }
  .login-card { animation: none; }
  .login-card > *:not(.login-card-glow) { animation: none; }
}

/* ── Toast container ──────────────────────────────── */
#toast-container { z-index: 1090; }

/* ── Order Detail ─────────────────────────────────── */

/* Header */
.ord-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 0 0 18px;
  border-bottom: 1px solid #e8ede4;
  margin-bottom: 16px;
}

/* ── Quick-Action-Kacheln ───────────────────────────────────── */
.ord-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 20px;
}
.ord-action-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px 10px 10px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid #e8ede4;
  cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  min-width: 148px;
}
.ord-action-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  border-color: transparent;
  text-decoration: none;
}
.ord-action-tile.ord-act-done { opacity: .82; }
.ord-action-tile.ord-act-done:hover { opacity: 1; }
.ord-act-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff; flex-shrink: 0;
}
.ord-act-text { min-width: 0; }
.ord-act-label { display: block; font-size: .82rem; font-weight: 600; line-height: 1.2; color: var(--text-primary); }
.ord-act-sub   { display: block; font-size: .72rem; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
/* colour variants */
.ord-act-green  .ord-act-icon { background: #22c55e; }
.ord-act-green:hover           { background: linear-gradient(135deg,#f0fdf4,#dcfce7); }
.ord-act-amber  .ord-act-icon { background: #f59e0b; }
.ord-act-amber:hover           { background: linear-gradient(135deg,#fffbeb,#fef3c7); }
.ord-act-slate  .ord-act-icon { background: #64748b; }
.ord-act-slate:hover           { background: linear-gradient(135deg,#f8fafc,#f1f5f9); }
.ord-act-blue   .ord-act-icon { background: #3b82f6; }
.ord-act-blue:hover            { background: linear-gradient(135deg,#eff6ff,#dbeafe); }
.ord-act-neutral .ord-act-icon { background: #94a3b8; }
.ord-act-neutral:hover         { background: linear-gradient(135deg,#f8fafc,#f1f5f9); }
/* done-state (label already exists) */
.ord-act-done .ord-act-icon { filter: brightness(.92); }
@media (max-width: 680px) {
  .ord-actions { gap: 6px; }
  .ord-action-tile { min-width: calc(50% - 3px); }
}
.ord-header-left { display: flex; align-items: center; gap: 14px; }
.ord-back {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: #f0f4ed; color: var(--text-muted);
  text-decoration: none; flex-shrink: 0;
  transition: background .12s, color .12s;
}
.ord-back:hover { background: var(--accent); color: #fff; }
.ord-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ord-number { font-size: 1.05rem; font-weight: 700; font-family: monospace; letter-spacing: .03em; }
.ord-meta { font-size: .78rem; color: var(--text-muted); margin-top: 3px; }

.ord-header-right { display: flex; align-items: center; gap: 10px; }
.ord-total-box {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 8px 14px; background: #f5f8f3; border-radius: var(--radius-sm);
  border: 1px solid #e2e9dc;
}
.ord-total-label { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.ord-total-value { font-size: 1.1rem; font-weight: 700; color: var(--accent-dark); }

/* Layout */
.ord-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .ord-layout { grid-template-columns: 1fr; } }
.ord-main   { display: flex; flex-direction: column; gap: 16px; }
.ord-sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }

/* Card base */
.ord-card { border: 1px solid #e8ede4; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.ord-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; border-bottom: 1px solid #f0f4ed;
  background: #fafcf9;
}
.ord-card-title { font-size: .82rem; font-weight: 600; color: #3a4a35; }
.ord-card-badge {
  font-size: .72rem; font-weight: 600; padding: 2px 8px;
  background: #e8f0e4; color: #4a7040; border-radius: 20px;
}

/* Items */
.ord-items { padding: 0; }
.ord-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  transition: background .1s;
}
.ord-item:hover { background: #fafcf9; }
.ord-item-sep { border-top: 1px solid #f0f4ed; }
.ord-item-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: #f0f4ed; color: #6a8a60;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; flex-shrink: 0;
}
.ord-item-info { flex: 1; min-width: 0; }
.ord-item-name { font-size: .855rem; font-weight: 500; line-height: 1.35; }
.ord-item-sku  { font-size: .72rem; color: var(--text-muted); font-family: monospace; margin-top: 2px; }
.qty-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; padding: 3px 7px;
  background: #f0f4ed; border-radius: 6px;
  font-size: .78rem; font-weight: 600; color: #4a6a40;
}
.ord-item-price { text-align: right; flex-shrink: 0; }
.ord-item-total { font-size: .875rem; font-weight: 600; }
.ord-item-unit  { font-size: .72rem; color: var(--text-muted); margin-top: 1px; }
.ord-items-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  background: #f5f8f3; border-top: 1px solid #e8ede4;
  font-size: .82rem; font-weight: 600; color: #3a4a35;
}
.ord-grand-total { font-size: 1rem; font-weight: 700; color: var(--accent-dark); }

/* Timeline */
.ord-timeline { list-style: none; padding: 12px 0 0; margin: 0; }
.ord-tl-item {
  display: flex; gap: 12px;
  padding-bottom: 20px;
  position: relative;
}
.ord-tl-item:not(.ord-tl-last)::before {
  content: ''; position: absolute;
  left: 14px; top: 28px; bottom: 0;
  width: 1px; background: #e8ede4;
}
.ord-tl-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: #e8f0e4; color: #4a7040;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d4e3ce;
  margin-top: 2px;
}
.ord-tl-body { flex: 1; padding-top: 3px; }
.ord-tl-text { font-size: .83rem; line-height: 1.5; color: #2d3a28; }
.ord-tl-text b { font-weight: 600; }
.ord-tl-meta { font-size: .72rem; color: var(--text-muted); margin-top: 4px; }

/* Info block (sidebar) */
.ord-info-block { padding: 4px 0 8px; }
.ord-info-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 9px 18px;
  border-bottom: 1px solid #f3f6f1;
}
.ord-info-row:last-child { border-bottom: none; }
.ord-info-total { background: #fafcf9; }
.ord-info-label { font-size: .75rem; color: var(--text-muted); font-weight: 500; flex-shrink: 0; }
.ord-info-value { font-size: .83rem; text-align: right; }
.ord-info-value.mono { font-family: monospace; font-size: .8rem; }
.ord-info-amount { font-size: .95rem; font-weight: 700; color: var(--accent-dark); }

/* Address row (2-column above items) */
.ord-addr-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 680px) { .ord-addr-row { grid-template-columns: 1fr; } }
.ord-addr-card { margin: 0 !important; }

/* Address block */
.ord-address-block { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.ord-address-name { font-size: .9rem; font-weight: 600; color: #2d3a28; }
.ord-address-company { font-size: .82rem !important; color: #4a5a45; }
.ord-address-email {
  font-size: .78rem; color: var(--accent-dark); text-decoration: none;
  display: flex; align-items: center;
}
.ord-address-email:hover { text-decoration: underline; }
.ord-address-line { font-size: .82rem; color: #4a5a45; display: flex; align-items: center; }

/* Empty states */
.ord-empty { text-align: center; color: var(--text-muted); font-size: .83rem; padding: 32px 16px; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  .tw-nav .dropdown-toggle { padding: 0 10px; font-size: .77rem; }
  .tw-search { display: none; }
}

/* ================================================================
   Desktop Window Manager
   ================================================================ */

/* ── Desktop canvas ───────────────────────────────── */
#tw-desktop {
  position: fixed; top: var(--bar-h); left: 0; right: 0; bottom: var(--taskbar-h);
  background: var(--desktop-bg); overflow: hidden;
}

/* ── Desktop layout (icon grid + right panel) ─────── */
.tw-desktop-layout {
  display: flex; height: 100%; gap: 0;
}
.tw-desktop-main {
  flex: 1; padding: 20px 24px; overflow-y: auto;
}
.tw-desktop-right {
  width: 240px; flex-shrink: 0; border-left: 1px solid rgba(255,255,255,.06);
  overflow-y: auto; background: rgba(0,0,0,.15);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.tw-desktop-right::-webkit-scrollbar { width: 4px; }
.tw-desktop-right::-webkit-scrollbar-track { background: transparent; }
.tw-desktop-right::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* Section labels */
.tw-section-lbl {
  font-size: .65rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: rgba(255,255,255,.25);
  margin: 16px 0 8px;
}
.tw-section-lbl:first-child { margin-top: 0; }
.tw-section-soon {
  font-weight: 400; font-size: .6rem; margin-left: 6px;
  color: rgba(255,255,255,.18); letter-spacing: 0;
}

/* Desktop icon grid */
.tw-icon-grid { display: flex; flex-wrap: wrap; gap: 6px; }

.tw-icon {
  position: relative; display: inline-flex; flex-direction: column;
  align-items: center; gap: 6px; width: 84px; padding: 12px 6px 9px;
  border: none; border-radius: 10px; background: transparent;
  color: rgba(220,235,210,.8); cursor: pointer; font-size: .7rem;
  text-align: center; transition: background .15s; font-family: inherit;
  text-decoration: none;
}
.tw-icon:hover { background: rgba(114,184,54,.13); color: #fff; text-decoration: none; }
.tw-icon:active { background: rgba(114,184,54,.2); }
.tw-icon.coming { opacity: .38; cursor: default; pointer-events: none; }

.tw-icon-img {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.tw-icon-lbl { line-height: 1.3; }
.tw-icon-badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 17px; height: 17px; border-radius: 9px; padding: 0 4px;
  background: #e53935; color: #fff; font-size: .62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* Icon color variants */
.c-green  { background: linear-gradient(135deg,#2e7d32,#4caf50); color:#fff; }
.c-amber  { background: linear-gradient(135deg,#e65100,#ff9800); color:#fff; }
.c-blue   { background: linear-gradient(135deg,#1565c0,#42a5f5); color:#fff; }
.c-teal   { background: linear-gradient(135deg,#00695c,#26a69a); color:#fff; }
.c-red    { background: linear-gradient(135deg,#b71c1c,#e53935); color:#fff; }
.c-purple { background: linear-gradient(135deg,#6a1b9a,#ab47bc); color:#fff; }
.c-gray   { background: linear-gradient(135deg,#37474f,#78909c); color:#fff; }

/* ── Taskbar ──────────────────────────────────────── */
#tw-taskbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--taskbar-h);
  background: var(--bar-bg); border-top: 1px solid var(--bar-border);
  display: flex; align-items: center; padding: 0 8px; gap: 4px; z-index: 9999;
}
#tw-taskbar-windows {
  display: flex; align-items: center; gap: 4px; flex: 1; overflow: hidden;
}
.tw-task-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 10px; border: none; border-radius: 6px;
  background: rgba(255,255,255,.06); color: var(--bar-text);
  font-size: .77rem; cursor: pointer; font-family: inherit;
  max-width: 180px; overflow: hidden; white-space: nowrap;
  transition: background .12s; flex-shrink: 0;
}
.tw-task-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-task-btn:hover   { background: var(--bar-hover); }
.tw-task-btn.is-active { background: rgba(114,184,54,.2); color: var(--accent); }
.tw-task-btn i { font-size: .82rem; flex-shrink: 0; }
.tw-taskbar-right { display: flex; align-items: center; padding-right: 4px; }
.tw-clock { color: var(--bar-text); font-size: .77rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Floating Window ──────────────────────────────── */
.tw-window {
  position: absolute; display: flex; flex-direction: column;
  background: var(--bg-body); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06);
  overflow: hidden; min-width: 440px; min-height: 300px;
  transition: box-shadow .12s;
}
.tw-window.is-focused { box-shadow: 0 16px 56px rgba(0,0,0,.6), 0 0 0 1.5px var(--accent); }
.tw-window.is-hidden  { display: none; }

/* Window title bar */
.tw-win-bar {
  display: flex; align-items: center; gap: 8px; height: 36px;
  padding: 0 6px 0 12px; background: #1e2a1c;
  cursor: move; user-select: none; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.tw-win-icon  { color: var(--accent); font-size: .85rem; flex-shrink: 0; }
.tw-win-title {
  flex: 1; font-size: .78rem; font-weight: 500; color: var(--bar-text);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tw-win-ctrls {
  display: flex; align-items: center; gap: 4px;
  padding: 2px; border-radius: 8px;
  background: rgba(255,255,255,.035);
}
.tw-win-btn {
  width: 26px; height: 26px; border: 1px solid rgba(255,255,255,.055); border-radius: 7px;
  background: rgba(255,255,255,.06); color: rgba(220,235,210,.72);
  font-size: .76rem; cursor: pointer; display: flex; align-items: center;
  justify-content: center; transition: background .14s, color .14s, border-color .14s, transform .14s; flex-shrink: 0;
  font-family: inherit; line-height: 1;
}
.tw-win-btn i { font-size: .82rem; line-height: 1; }
.tw-win-btn:hover {
  background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.13);
  color: #fff; transform: translateY(-1px);
}
.tw-win-btn:active { transform: translateY(0); }
.tw-win-close:hover {
  background: rgba(220,53,69,.9) !important; border-color: rgba(255,255,255,.14);
  color: #fff !important;
}
.tw-win-max:hover {
  background: rgba(114,184,54,.22) !important; border-color: rgba(114,184,54,.32);
  color: #a4df6a !important;
}

/* Window content area */
.tw-win-body  { flex: 1; overflow-y: auto; overflow-x: hidden; background: var(--bg-body); padding: 10px; }
.tw-win-loader {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; height: 100%; min-height: 200px; color: var(--text-muted); font-size: .82rem;
}
.tw-win-error {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: var(--danger); font-size: .85rem; gap: 8px;
}
.tw-spinner {
  width: 22px; height: 22px; border: 2px solid rgba(114,184,54,.2);
  border-top-color: var(--accent); border-radius: 50%;
  animation: tw-spin .7s linear infinite;
}
@keyframes tw-spin { to { transform: rotate(360deg); } }

/* Panel items as buttons (for WM.open links) */
.tw-panel-item-btn {
  width: 100%; border: none; background: transparent;
  font-family: inherit; text-align: left; cursor: pointer; padding: 0;
}
.tw-panel-item-btn:hover { background: rgba(255,255,255,.05); }

/* ── Resize Handles ───────────────────────────────── */
.tw-win-resize { position: absolute; z-index: 200; }

/* Edges */
.tw-resize-n  { top: 0;    left: 10px; right: 10px; height: 4px; cursor: n-resize; }
.tw-resize-s  { bottom: 0; left: 10px; right: 10px; height: 6px; cursor: s-resize; }
.tw-resize-e  { right: 0;  top: 10px; bottom: 10px; width: 4px;  cursor: e-resize; }
.tw-resize-w  { left: 0;   top: 10px; bottom: 10px; width: 4px;  cursor: w-resize; }

/* Corners — larger hit area, visible grip indicator on SE */
.tw-resize-ne { top: 0;    right: 0;  width: 14px; height: 14px; cursor: ne-resize; }
.tw-resize-nw { top: 0;    left: 0;   width: 14px; height: 14px; cursor: nw-resize; }
.tw-resize-se { bottom: 0; right: 0;  width: 14px; height: 14px; cursor: se-resize; }
.tw-resize-sw { bottom: 0; left: 0;   width: 14px; height: 14px; cursor: sw-resize; }

/* Subtle grip dots on SE corner */
.tw-resize-se::after {
  content: '';
  position: absolute; bottom: 3px; right: 3px;
  width: 6px; height: 6px;
  background: radial-gradient(circle, rgba(255,255,255,.25) 1px, transparent 1px) 0 0 / 3px 3px;
  border-radius: 1px;
}

/* ── Edit button in card headers ──────────────────────────── */
.btn-ord-edit {
  background: none; border: none; padding: 3px 6px;
  color: var(--text-muted); cursor: pointer; border-radius: 4px;
  font-size: .9rem; line-height: 1; transition: color .15s, background .15s;
}
.btn-ord-edit:hover { color: var(--accent-dark); background: var(--accent-light); }

/* ── Small label for modals ───────────────────────────────── */
.modal .form-label-sm {
  font-size: .75rem; font-weight: 500; margin-bottom: 3px;
  color: var(--text-secondary, #64748b);
}
