/* ===================================================================
 * RiLoPos Backoffice - Theme variants
 * Active via [data-theme] sur <html>. Default = aucun attribut.
 * =================================================================== */

/* ===========================================================
 * Boutons fenetre: ordre Windows (min-max-close de gauche a droite)
 * Tous les themes Windows. Les themes macOS gardent l ordre macOS
 * (close-min-max gauche).
 * =========================================================== */
[data-theme^="win"] .win-min   { order: 1; }
[data-theme^="win"] .win-max   { order: 2; }
[data-theme^="win"] .win-close { order: 3; }

/* ===========================================================
 * WINDOWS XP (Luna) - completed by xp.css via CDN
 * =========================================================== */
[data-theme="win-xp"] {
  --bg-app:      #5a7edc;
  --bg-desktop:  #5a7edc;
  --bg-window:   #ece9d8;
  --bg-titlebar: linear-gradient(180deg, #0997ff 0%, #0053ee 8%, #0050ee 40%, #06f 88%, #0e7bdc 100%);
  --bg-sidebar:  #ece9d8;
  --bg-input:    #ffffff;
  --bg-input-h:  #f4f3e9;
  --bg-row-hover: #d7e4f8;
  --bg-row-active:#316ac5;
  --bg-elev:     #ece9d8;
  --bd-window:   #0831d9;
  --bd-strong:   #0831d9;
  --bd-inset:    #7f9db9;
  --bd-divider:  #d4d0c8;
  --text:        #000;
  --text-muted:  #555;
  --text-faint:  #888;
  --accent:      #316ac5;
  --accent-2:    #0053ee;
  --accent-soft: rgba(49,106,197,0.15);
  --r-window: 8px;
  --r-input:  0;
  --r-button: 3px;
  --titlebar-h: 28px;
}
[data-theme="win-xp"] body {
  font-family: Tahoma, "Trebuchet MS", sans-serif;
  font-size: 11px;
  background:
    radial-gradient(ellipse at 50% 100%, #6cb13e, #5a8d2c 40%, #4f7a26 70%, #305114 100%) !important;
  background-attachment: fixed !important;
}
[data-theme="win-xp"] .menubar {
  background: linear-gradient(180deg, #245edc 0%, #2c70cf 30%, #3d8af2 80%, #246adb 100%);
  border-bottom: 2px solid #103a82;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.30);
}
[data-theme="win-xp"] .menubar .brand, [data-theme="win-xp"] .menu-item { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,0.40); }
[data-theme="win-xp"] .menu-item:hover, [data-theme="win-xp"] .menu-item.open {
  background: linear-gradient(180deg, #4e9fff, #1457c8); color: #fff;
}
[data-theme="win-xp"] .menu-dropdown {
  background: #ece9d8; border: 1px solid #444; border-radius: 0; backdrop-filter: none;
  color: #000; box-shadow: 2px 2px 6px rgba(0,0,0,0.40);
}
[data-theme="win-xp"] .menu-dropdown-item { color: #000; border-radius: 0; padding: 4px 8px; }
[data-theme="win-xp"] .menu-dropdown-item:hover { background: #316ac5; color: #fff; }
[data-theme="win-xp"] .sidebar {
  background: linear-gradient(90deg, #7da2ce 0%, #b3c8e6 25%, #b3c8e6 75%, #7da2ce 100%);
  border-right: 2px solid #103a82; color: #000;
}
[data-theme="win-xp"] .sb-section { color: #103a82; font-weight: 700; }
[data-theme="win-xp"] .sb-btn { color: #000; }
[data-theme="win-xp"] .sb-btn:hover { background: rgba(255,255,255,0.25); }
[data-theme="win-xp"] .sb-btn.active {
  background: linear-gradient(180deg, #fae692, #f9b738);
  color: #000; border-left: 3px solid #cc7a00; padding-left: 7px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.50);
}
[data-theme="win-xp"] .workspace { background: transparent; background-image: none; }
[data-theme="win-xp"] .mdi-window {
  background: #ece9d8;
  border: 1px solid #0831d9; border-top: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.40);
}
[data-theme="win-xp"] .window-header {
  background: linear-gradient(180deg, #0997ff 0%, #0053ee 8%, #0050ee 40%, #06f 88%, #0e7bdc 100%);
  border-radius: 8px 8px 0 0; border-bottom: none;
  height: 28px; color: #fff; padding: 0 4px;
}
[data-theme="win-xp"] .mdi-window:not(.focused) .window-header {
  background: linear-gradient(180deg, #7baee4, #5b91d8);
}
[data-theme="win-xp"] .window-header .title {
  color: #fff; font-weight: 700; font-size: 11.5px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.50);
}
[data-theme="win-xp"] .window-header .title svg { color: #fff; }
[data-theme="win-xp"] .window-controls { order: 2; margin-left: auto; gap: 1px; padding-right: 3px; }
[data-theme="win-xp"] .win-btn {
  width: 22px; height: 22px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.40);
  background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0)) !important;
  color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
[data-theme="win-xp"] .win-btn span { opacity: 1; color: #fff; font-weight: 700; }
[data-theme="win-xp"] .win-close { background: linear-gradient(180deg, #ec5347, #c52015) !important; }
[data-theme="win-xp"] .win-min { background: linear-gradient(180deg, rgba(255,255,255,0.30), rgba(0,80,255,0.50)) !important; }
[data-theme="win-xp"] .win-max { background: linear-gradient(180deg, rgba(255,255,255,0.30), rgba(0,80,255,0.50)) !important; }
[data-theme="win-xp"] .win-btn:hover { filter: brightness(1.15); }

[data-theme="win-xp"] .window-body { background: #ece9d8; color: #000; }
[data-theme="win-xp"] .window-toolbar { background: #ece9d8; border-bottom: 1px solid #aca899; }
[data-theme="win-xp"] .fkey, [data-theme="win-xp"] .btn {
  background: linear-gradient(180deg, #fff 0%, #ece9d8 45%, #d4d0c8 55%, #ece9d8 100%) !important;
  border: 1px solid #003c74; color: #000; border-radius: 3px;
  font-family: Tahoma, sans-serif !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.50);
  padding: 3px 12px;
}
[data-theme="win-xp"] .fkey:hover:not(:disabled), [data-theme="win-xp"] .btn:hover {
  background: linear-gradient(180deg, #fff 0%, #e3eef9 45%, #c6dcf0 55%, #dcebfc 100%) !important;
  border-color: #316ac5;
}
[data-theme="win-xp"] .fkey:active, [data-theme="win-xp"] .btn:active {
  background: linear-gradient(180deg, #cdcdcd, #ece9d8) !important;
}
[data-theme="win-xp"] .fkey-primary, [data-theme="win-xp"] .btn-primary {
  background: linear-gradient(180deg, #79c34a, #4f9b1d 50%, #357007 50%, #4f9b1d 100%) !important;
  border-color: #1d5400; color: #fff !important;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
}
[data-theme="win-xp"] .fkey kbd { background: #ece9d8; border: 1px solid #888; color: #000; }
[data-theme="win-xp"] .fkey-primary kbd { background: rgba(255,255,255,0.30); border-color: rgba(255,255,255,0.40); color: #fff; }
[data-theme="win-xp"] input, [data-theme="win-xp"] select, [data-theme="win-xp"] textarea {
  background: #fff; color: #000; border: 1px solid #7f9db9; border-radius: 0;
  box-shadow: inset 0 1px 1px rgba(0,40,90,0.10);
  font-family: Tahoma, sans-serif !important; padding: 3px 6px;
}
[data-theme="win-xp"] input:focus, [data-theme="win-xp"] select:focus, [data-theme="win-xp"] textarea:focus {
  border-color: #316ac5; box-shadow: 0 0 4px rgba(49,106,197,0.55);
}
[data-theme="win-xp"] table.data-grid thead th {
  background: linear-gradient(180deg, #fff, #ece9d8); color: #000;
  border-bottom: 1px solid #aca899; border-right: 1px solid #d4d0c8; font-weight: 700;
}
[data-theme="win-xp"] .kpi-card {
  background: #fff; border: 1px solid #7f9db9; border-radius: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.50);
}
[data-theme="win-xp"] .groupbox { background: #fff; border: 1px solid #d4d0c8; border-radius: 0; }
[data-theme="win-xp"] .groupbox-title { background: #fff; color: #003c74; font-weight: 700; }
[data-theme="win-xp"] .window-statusbar {
  background: linear-gradient(180deg, #245edc, #2c70cf); color: #fff;
  border-top: 1px solid #103a82; text-shadow: 0 1px 0 rgba(0,0,0,0.30);
}
[data-theme="win-xp"] .modal-card, [data-theme="win-xp"] .lang-popup {
  background: #ece9d8; color: #000; border-radius: 8px 8px 0 0;
  border: 1px solid #0831d9; border-top: none;
}

/* ===========================================================
 * WINDOWS 98 / Classic - completed par 98.css via CDN
 * =========================================================== */
[data-theme="win98"] {
  --bg-app:      #008080;   /* legendary teal */
  --bg-desktop:  #008080;
  --bg-window:   #c0c0c0;
  --bg-titlebar: #000080;   /* navy active */
  --bg-sidebar:  #c0c0c0;
  --bg-input:    #ffffff;
  --bg-input-h:  #ffffff;
  --bg-row-hover: #d4d0c8;
  --bg-row-active:#000080;
  --bg-elev:     #c0c0c0;
  --bd-window:   #000000;
  --bd-strong:   #000000;
  --bd-inset:    #808080;
  --bd-divider:  #808080;
  --text:        #000000;
  --text-muted:  #404040;
  --text-faint:  #606060;
  --accent:      #000080;
  --accent-2:    #000060;
  --accent-soft: rgba(0,0,128,0.20);
  --r-window: 0;
  --r-input:  0;
  --r-button: 0;
  --titlebar-h: 22px;
  --menubar-h:  22px;
}
[data-theme="win98"] body {
  font-family: "MS Sans Serif", "Microsoft Sans Serif", Tahoma, sans-serif !important;
  font-size: 11px !important;
  background: #008080 !important;
  -webkit-font-smoothing: none;
}
[data-theme="win98"] .menubar {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  box-shadow: 0 -1px 0 #fff inset;
  color: #000;
}
[data-theme="win98"] .menubar .brand { color: #000; }
[data-theme="win98"] .menubar .brand svg { color: #000080; }
[data-theme="win98"] .menu-item { color: #000; border-radius: 0; }
[data-theme="win98"] .menu-item:hover, [data-theme="win98"] .menu-item.open { background: #000080; color: #fff; }
[data-theme="win98"] .menu-dropdown {
  background: #c0c0c0; border: 2px solid; border-color: #fff #808080 #808080 #fff;
  border-radius: 0; backdrop-filter: none; padding: 2px;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
[data-theme="win98"] .menu-dropdown-item { color: #000; border-radius: 0; padding: 3px 8px; }
[data-theme="win98"] .menu-dropdown-item:hover { background: #000080; color: #fff; }
[data-theme="win98"] .sidebar {
  background: #c0c0c0; color: #000;
  border-right: 2px solid; border-color: #fff #808080 #808080 #fff;
}
[data-theme="win98"] .sb-section { color: #404040; }
[data-theme="win98"] .sb-btn { color: #000; border-radius: 0; }
[data-theme="win98"] .sb-btn svg { color: #000080; }
[data-theme="win98"] .sb-btn:hover { background: #d4d0c8; }
[data-theme="win98"] .sb-btn.active { background: #000080; color: #fff; box-shadow: none; }
[data-theme="win98"] .sb-btn.active svg { color: #fff; }
[data-theme="win98"] .workspace { background: #008080; background-image: none; }
[data-theme="win98"] .workspace-bg-msg, [data-theme="win98"] .workspace-bg-msg .title { color: #d0d0d0; }
[data-theme="win98"] .mdi-window {
  background: #c0c0c0; border: 2px solid; border-color: #fff #808080 #808080 #fff;
  border-radius: 0; box-shadow: 1px 1px 0 #000;
}
[data-theme="win98"] .mdi-window.focused { box-shadow: 2px 2px 0 #000; }
[data-theme="win98"] .window-header {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  border-bottom: 1px solid #000; color: #fff; padding: 0 2px;
}
[data-theme="win98"] .mdi-window:not(.focused) .window-header {
  background: linear-gradient(90deg, #808080 0%, #b5b5b5 100%);
}
[data-theme="win98"] .window-header .title {
  position: static; transform: none; margin-left: 4px;
  color: #fff; font-weight: 700; font-size: 11px;
}
[data-theme="win98"] .window-header .title svg { color: #fff; }
[data-theme="win98"] .window-controls { order: 2; margin-left: auto; padding: 0; gap: 0; }
[data-theme="win98"] .win-btn {
  width: 18px; height: 16px; border-radius: 0;
  background: #c0c0c0 !important;
  border: 2px solid; border-color: #fff #808080 #808080 #fff;
  color: #000; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
[data-theme="win98"] .win-btn span { opacity: 1; color: #000; }
[data-theme="win98"] .win-close::after { content: "X"; }
[data-theme="win98"] .win-min::after { content: "_"; margin-top: -4px; }
[data-theme="win98"] .win-max::after { content: "[]"; font-size: 7px; }
[data-theme="win98"] .win-btn span { display: none; }
[data-theme="win98"] .window-body { background: #c0c0c0; color: #000; }
[data-theme="win98"] .window-toolbar { background: #c0c0c0; border-bottom: 1px solid #808080; padding: 4px; }
[data-theme="win98"] .fkey, [data-theme="win98"] .btn {
  background: #c0c0c0 !important;
  border: 2px solid; border-color: #fff #808080 #808080 #fff;
  color: #000; border-radius: 0; box-shadow: none;
  font-family: "MS Sans Serif", Tahoma, sans-serif !important;
}
[data-theme="win98"] .fkey:active, [data-theme="win98"] .btn:active {
  border-color: #808080 #fff #fff #808080;
}
[data-theme="win98"] .fkey-primary, [data-theme="win98"] .btn-primary {
  background: #c0c0c0 !important; color: #000 !important;
  border-color: #fff #808080 #808080 #fff !important;
}
[data-theme="win98"] .fkey kbd { background: transparent; border: none; }
[data-theme="win98"] input, [data-theme="win98"] select, [data-theme="win98"] textarea {
  background: #fff; color: #000;
  border: 2px solid; border-color: #808080 #fff #fff #808080;
  border-radius: 0; box-shadow: none;
  font-family: "MS Sans Serif", Tahoma, sans-serif !important;
}
[data-theme="win98"] table.data-grid thead th {
  background: #c0c0c0; color: #000;
  border-bottom: 1px solid #808080;
  border-right: 1px solid #808080;
}
[data-theme="win98"] table.data-grid tbody td { border-bottom: 1px solid #d4d0c8; }
[data-theme="win98"] table.data-grid tbody tr:hover { background: #d4d0c8; }
[data-theme="win98"] .badge { border-radius: 0; }
[data-theme="win98"] .kpi-card {
  background: #c0c0c0; border: 2px solid; border-color: #fff #808080 #808080 #fff;
  border-radius: 0; box-shadow: none;
}
[data-theme="win98"] .groupbox {
  border: 1px solid #808080; border-radius: 0; background: #c0c0c0;
}
[data-theme="win98"] .groupbox-title { background: #c0c0c0; color: #000; }
[data-theme="win98"] .window-statusbar { background: #c0c0c0; border-top: 1px solid #808080; color: #000; }
[data-theme="win98"] .modal-overlay { backdrop-filter: none; background: rgba(0,0,0,0.4); }
[data-theme="win98"] .modal-card, [data-theme="win98"] .lang-popup {
  background: #c0c0c0; border-radius: 0;
  border: 2px solid; border-color: #fff #808080 #808080 #fff;
  color: #000;
}

/* ===========================================================
 * WINDOWS 7 (Aero Glass) - inspired by 7.css
 * Aero look: glass title-bar, glow on focus, rounded gradient buttons,
 * sidebar with vertical gradient. Color reference from microsoft.com 7.
 * =========================================================== */
[data-theme="win7"] {
  --bg-app:      #245edb;
  --bg-desktop:  linear-gradient(180deg, #5d8aca 0%, #2b5da5 50%, #1c3d7c 100%);
  --bg-window:   #ffffff;
  --bg-titlebar: linear-gradient(180deg, rgba(184,214,247,0.85) 0%, rgba(120,170,225,0.92) 100%);
  --bg-sidebar:  linear-gradient(180deg, #f0f5fa 0%, #d9e5f1 100%);
  --bg-input:    #ffffff;
  --bg-input-h:  #f6faff;
  --bg-row-hover: linear-gradient(180deg, #d0e7fc, #b9d8f3);
  --bg-row-active:linear-gradient(180deg, #cfe5fb, #a9c8e8);
  --bg-elev:     #f4f8fd;
  --bd-window:   rgba(0,80,180,0.40);
  --bd-strong:   #6e94c5;
  --bd-inset:    #93afd0;
  --bd-divider:  #d8e1ed;
  --text:        #000;
  --text-muted:  #404040;
  --text-faint:  #6a6a6a;
  --accent:      #2178e7;
  --accent-2:    #155bb3;
  --accent-soft: rgba(33,120,231,0.15);
  --r-window: 7px;
  --r-input:  3px;
  --r-button: 3px;
  --titlebar-h: 30px;
}
[data-theme="win7"] body {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 12px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(160,210,255,0.35), transparent 70%),
    linear-gradient(180deg, #4a8cdc 0%, #2a5aa0 50%, #16386c 100%) fixed !important;
}
[data-theme="win7"] .menubar {
  background: linear-gradient(180deg, rgba(220,235,252,0.95) 0%, rgba(170,200,235,0.95) 100%);
  border-bottom: 1px solid #6e94c5;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
  color: #000;
}
[data-theme="win7"] .menubar .brand, [data-theme="win7"] .menu-item { color: #000; }
[data-theme="win7"] .menu-item { border-radius: 2px; }
[data-theme="win7"] .menu-item:hover, [data-theme="win7"] .menu-item.open {
  background: linear-gradient(180deg, #d2e8fc 0%, #afd0ee 50%, #88b5dc 100%);
  color: #000;
  box-shadow: inset 0 0 0 1px #7eafdf;
}
[data-theme="win7"] .menu-dropdown {
  background: rgba(248, 252, 255, 0.96);
  backdrop-filter: blur(8px); border: 1px solid #6e94c5;
  border-radius: 4px; color: #000;
  box-shadow: 0 6px 18px rgba(0,40,90,0.35), inset 0 1px 0 rgba(255,255,255,0.7);
}
[data-theme="win7"] .menu-dropdown-item { color: #000; }
[data-theme="win7"] .menu-dropdown-item:hover {
  background: linear-gradient(180deg, #d2e8fc, #afd0ee 50%, #88b5dc); color: #000;
  box-shadow: inset 0 0 0 1px #7eafdf;
}
/* Sidebar = volet de navigation « flat » facon Explorer Windows 7 :
   fond clair uni, survol/sélection plats avec barre d'accent a gauche. */
[data-theme="win7"] .sidebar {
  background: #f4f8fd;
  border-right: 1px solid #c8d6e6; color: #000;
}
[data-theme="win7"] .sb-section { color: #15428b; font-weight: 700; }
[data-theme="win7"] .sb-btn {
  color: #1a1a1a; border-radius: 0; border: 0;
  transition: background .08s;
}
[data-theme="win7"] .sb-btn:hover {
  background: #e3effb;
  box-shadow: inset 3px 0 0 #7da2c8;   /* barre d'accent gauche (flat) */
}
[data-theme="win7"] .sb-btn.active {
  background: #cbe2fa;
  color: #103a82; font-weight: 600;
  box-shadow: inset 3px 0 0 #2178e7;
}
[data-theme="win7"] .sb-btn.active svg { color: #15428b; }
[data-theme="win7"] .workspace { background: transparent; background-image: none; }

/* Aero glass MDI window with glow */
[data-theme="win7"] .mdi-window {
  background: rgba(240,245,250,0.95);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.50);
  border-radius: 7px 7px 4px 4px;
  box-shadow:
    0 0 0 1px rgba(0,40,90,0.25),
    0 0 20px 4px rgba(80,150,220,0.45),
    0 12px 28px rgba(0,0,0,0.40);
}
[data-theme="win7"] .mdi-window.focused {
  box-shadow:
    0 0 0 1px rgba(0,40,90,0.30),
    0 0 26px 6px rgba(120,180,240,0.60),
    0 14px 32px rgba(0,0,0,0.45);
}
[data-theme="win7"] .mdi-window:not(.focused) {
  filter: saturate(0.85);
  box-shadow:
    0 0 0 1px rgba(80,90,110,0.25),
    0 8px 20px rgba(0,0,0,0.30);
}
[data-theme="win7"] .window-header {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.40) 0%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, rgba(184,214,247,0.85) 0%, rgba(120,170,225,0.92) 100%);
  border-bottom: 1px solid rgba(0,80,180,0.25);
  border-radius: 6px 6px 0 0;
  color: #000;
  height: 30px;
  padding: 0 4px;
}
[data-theme="win7"] .mdi-window:not(.focused) .window-header {
  background: linear-gradient(180deg, rgba(220,225,235,0.85), rgba(180,190,205,0.85));
}
[data-theme="win7"] .window-header .title {
  color: #000;
  font-weight: 400;
  font-size: 12.5px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.55);
  letter-spacing: 0;
}
[data-theme="win7"] .window-header .title svg { color: #000; }

[data-theme="win7"] .window-controls { order: 2; margin-left: auto; gap: 0; padding: 0; align-self: stretch; }
[data-theme="win7"] .win-btn {
  width: 45px; height: 22px; border-radius: 0;
  border: 1px solid transparent;
  border-left: 1px solid rgba(0,40,90,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.35), rgba(255,255,255,0)) !important;
  color: #000; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
[data-theme="win7"] .win-btn span {
  opacity: 1; color: #000; text-shadow: 0 1px 0 rgba(255,255,255,0.55);
  font-weight: 400; font-family: "Segoe UI", sans-serif;
}
[data-theme="win7"] .win-btn::before { content: ""; }
[data-theme="win7"] .win-min span::before { content: ""; }
[data-theme="win7"] .win-min { font-size: 16px; }
[data-theme="win7"] .win-max { font-size: 12px; }
[data-theme="win7"] .win-close {
  width: 56px;
  background: linear-gradient(180deg, rgba(255,200,200,0.70), rgba(220,90,90,0.70)) !important;
  color: #fff;
}
[data-theme="win7"] .win-close span { color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,0.25); font-weight: 700; }
[data-theme="win7"] .win-btn:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(180,210,240,0.65)) !important;
  box-shadow: inset 0 0 0 1px rgba(126,175,223,0.70);
}
[data-theme="win7"] .win-close:hover {
  background: linear-gradient(180deg, #f6a4a4, #d22f2f) !important;
  box-shadow: inset 0 0 0 1px rgba(120,0,0,0.50);
}

[data-theme="win7"] .window-body { background: #fff; color: #000; }
[data-theme="win7"] .window-toolbar {
  background: linear-gradient(180deg, #f3f6fa 0%, #e0e7f0 100%);
  border-bottom: 1px solid #b8c8dc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}

/* Aero buttons */
[data-theme="win7"] .fkey, [data-theme="win7"] .btn {
  background: linear-gradient(180deg, #fff 0%, #ddebf8 47%, #c7defa 49%, #d4e8fc 100%) !important;
  border: 1px solid #6d92c4; color: #000; border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
  padding: 4px 12px;
  font-family: "Segoe UI", Tahoma, sans-serif !important;
}
[data-theme="win7"] .fkey:hover:not(:disabled), [data-theme="win7"] .btn:hover {
  background: linear-gradient(180deg, #fafdff 0%, #c8e3fc 47%, #b1d4f4 49%, #c8e2fc 100%) !important;
  border-color: #3c7fb1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 0 4px rgba(98,179,235,0.55);
}
[data-theme="win7"] .fkey-primary, [data-theme="win7"] .btn-primary {
  background: linear-gradient(180deg, #569de5 0%, #3a7ec9 47%, #2767b2 49%, #4292d6 100%) !important;
  border-color: #1a589f; color: #fff !important;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
}
[data-theme="win7"] .fkey kbd {
  background: rgba(255,255,255,0.55); border: 1px solid rgba(0,40,90,0.15);
  color: #000; padding: 0 3px;
}
[data-theme="win7"] .fkey-primary kbd { background: rgba(255,255,255,0.25); border-color: rgba(255,255,255,0.4); color: #fff; }

[data-theme="win7"] input, [data-theme="win7"] select, [data-theme="win7"] textarea {
  background: #fff; color: #000; border: 1px solid #7da2c8; border-radius: 0;
  box-shadow: inset 0 1px 1px rgba(0,40,90,0.10);
  font-family: "Segoe UI", Tahoma, sans-serif !important;
}
[data-theme="win7"] input:focus, [data-theme="win7"] select:focus, [data-theme="win7"] textarea:focus {
  border-color: #3c7fb1;
  box-shadow: inset 0 1px 1px rgba(0,40,90,0.10), 0 0 5px rgba(98,179,235,0.65);
}

[data-theme="win7"] table.data-grid thead th {
  background: linear-gradient(180deg, #e3ecf6, #c2d2e6); color: #000;
  border-bottom: 1px solid #93afd0;
  text-shadow: 0 1px 0 rgba(255,255,255,0.55);
}
[data-theme="win7"] table.data-grid tbody tr:hover {
  background: linear-gradient(180deg, rgba(220,235,252,0.75), rgba(180,210,240,0.75));
}

[data-theme="win7"] .kpi-card {
  background: linear-gradient(180deg, #fff 0%, #eef4fb 100%);
  border: 1px solid #b8c8dc;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 1px 3px rgba(0,40,90,0.10);
  color: #000;
}
[data-theme="win7"] .kpi-card.accent {
  background: linear-gradient(180deg, #d8eaff, #b3d2f0);
  border-color: #3c7fb1;
}
[data-theme="win7"] .kpi-card.accent .value { color: #15428b; }

[data-theme="win7"] .groupbox {
  background: #fff; border: 1px solid #b8c8dc; border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
[data-theme="win7"] .groupbox-title { background: #fff; color: #15428b; font-weight: 700; }
[data-theme="win7"] .window-statusbar {
  background: linear-gradient(180deg, #ebf1f8, #cdd9e8); color: #000;
  border-top: 1px solid #b8c8dc;
  text-shadow: 0 1px 0 rgba(255,255,255,0.45);
}
[data-theme="win7"] .modal-card, [data-theme="win7"] .lang-popup {
  background: rgba(245,250,255,0.97);
  border: 1px solid rgba(0,40,90,0.30); border-radius: 7px;
  box-shadow: 0 0 26px 4px rgba(120,180,240,0.60), 0 12px 28px rgba(0,0,0,0.40);
  color: #000;
}

/* ===========================================================
 * WINDOWS 10 - Light. Accent #0078d4. Flat, square corners.
 * Titlebar has accent strip on left when focused.
 * =========================================================== */
[data-theme="win10-light"] {
  --bg-app:      #f0f0f0;
  --bg-desktop:  #0078d4;
  --bg-window:   #ffffff;
  --bg-titlebar: #ffffff;
  --bg-sidebar:  #f3f3f3;
  --bg-input:    #ffffff;
  --bg-input-h:  #f5f5f5;
  --bg-row-hover: #f0f0f0;
  --bg-row-active:#cce8ff;
  --bg-elev:     #fafafa;
  --bd-window:   #b6b6b6;
  --bd-strong:   #767676;
  --bd-inset:    #767676;
  --bd-divider:  #e5e5e5;
  --text:        #000000;
  --text-muted:  #5e5e5e;
  --text-faint:  #888;
  --accent:      #0078d4;
  --accent-2:    #005a9e;
  --accent-soft: rgba(0,120,212,0.10);
  --r-window: 0;
  --r-input:  0;
  --r-button: 0;
  --titlebar-h: 32px;
}
[data-theme="win10-light"] body {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  background:
    radial-gradient(ellipse 30% 40% at 0% 0%, rgba(255,255,255,0.20), transparent),
    radial-gradient(ellipse 30% 40% at 100% 100%, rgba(255,255,255,0.10), transparent),
    #0078d4 !important;
}
[data-theme="win10-light"] .menubar {
  background: #fff; color: #000;
  border-bottom: 1px solid #e5e5e5; box-shadow: none;
}
[data-theme="win10-light"] .menubar .brand, [data-theme="win10-light"] .menu-item { color: #000; }
[data-theme="win10-light"] .menu-item { border-radius: 0; padding: 4px 12px; }
[data-theme="win10-light"] .menu-item:hover, [data-theme="win10-light"] .menu-item.open { background: #e5e5e5; color: #000; }
[data-theme="win10-light"] .menu-dropdown {
  background: #fff; border: 1px solid #b6b6b6; border-radius: 0;
  backdrop-filter: none; color: #000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.20);
}
[data-theme="win10-light"] .menu-dropdown-item { color: #000; border-radius: 0; padding: 7px 12px; }
[data-theme="win10-light"] .menu-dropdown-item:hover { background: #e5e5e5; color: #000; }
[data-theme="win10-light"] .sidebar { background: #f3f3f3; color: #000; border-right: 1px solid #e5e5e5; padding: 0; }
[data-theme="win10-light"] .sb-section { color: #757575; padding: 14px 12px 6px; }
[data-theme="win10-light"] .sb-btn {
  color: #000; border-radius: 0; padding: 9px 12px;
  border-left: 4px solid transparent;
}
[data-theme="win10-light"] .sb-btn svg { color: #5e5e5e; }
[data-theme="win10-light"] .sb-btn:hover { background: #e5e5e5; }
[data-theme="win10-light"] .sb-btn.active {
  background: #cce8ff; color: #000;
  border-left-color: #0078d4;
  box-shadow: none;
}
[data-theme="win10-light"] .sb-btn.active svg { color: #0078d4; }
[data-theme="win10-light"] .workspace { background: transparent; background-image: none; }
[data-theme="win10-light"] .mdi-window {
  background: #fff; border: 1px solid #767676; border-radius: 0;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}
[data-theme="win10-light"] .mdi-window.focused {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4, 0 12px 32px rgba(0,0,0,0.30);
}
[data-theme="win10-light"] .window-header {
  background: #fff; color: #000;
  border-bottom: none;
  height: 32px; padding: 0;
}
[data-theme="win10-light"] .window-header .title {
  position: static; transform: none; margin-left: 12px;
  color: #000; font-weight: 400; font-size: 12px;
  display: flex; align-items: center; gap: 8px;
}
[data-theme="win10-light"] .window-header .title svg { color: #0078d4; }
[data-theme="win10-light"] .mdi-window:not(.focused) .window-header .title { color: #767676; }

[data-theme="win10-light"] .window-controls { order: 2; margin-left: auto; gap: 0; padding: 0; align-self: stretch; }
[data-theme="win10-light"] .win-btn {
  width: 46px; height: 32px; border-radius: 0;
  background: transparent !important; border: none;
  color: #000; font-size: 12px; line-height: 1;
}
[data-theme="win10-light"] .win-btn span { opacity: 1; color: #000; font-family: "Segoe MDL2 Assets", "Segoe UI", monospace; }
[data-theme="win10-light"] .win-btn:hover { background: #e5e5e5 !important; }
[data-theme="win10-light"] .win-close:hover { background: #e81123 !important; }
[data-theme="win10-light"] .win-close:hover span { color: #fff; }

[data-theme="win10-light"] .window-body { background: #fff; color: #000; }
[data-theme="win10-light"] .window-toolbar { background: #f3f3f3; border-bottom: 1px solid #d0d0d0; }
[data-theme="win10-light"] .fkey {
  background: #fff !important; border: 1px solid #c8c8c8; color: #000;
  border-radius: 0; box-shadow: none; padding: 4px 12px;
  font-family: "Segoe UI", sans-serif !important;
}
[data-theme="win10-light"] .fkey:hover:not(:disabled) {
  background: #e5e5e5 !important; border-color: #767676;
}
[data-theme="win10-light"] .fkey-primary {
  background: #0078d4 !important; color: #fff !important;
  border-color: #0078d4;
}
[data-theme="win10-light"] .fkey-primary:hover { background: #005a9e !important; border-color: #005a9e; }
[data-theme="win10-light"] .fkey kbd { background: #e5e5e5; border: 1px solid #d0d0d0; color: #000; }
[data-theme="win10-light"] .fkey-primary kbd { background: rgba(255,255,255,0.20); border-color: rgba(255,255,255,0.30); color: #fff; }
[data-theme="win10-light"] .btn { background: #fff !important; border: 1px solid #c8c8c8; color: #000; border-radius: 0; }
[data-theme="win10-light"] .btn:hover { background: #e5e5e5 !important; border-color: #767676; }
[data-theme="win10-light"] .btn-primary { background: #0078d4 !important; color: #fff; border-color: #0078d4; }
[data-theme="win10-light"] .btn-primary:hover { background: #005a9e !important; }

[data-theme="win10-light"] input, [data-theme="win10-light"] select, [data-theme="win10-light"] textarea {
  background: #fff; color: #000; border: 1px solid #767676;
  border-radius: 0; box-shadow: none;
  font-family: "Segoe UI", sans-serif !important;
}
[data-theme="win10-light"] input:focus, [data-theme="win10-light"] select:focus, [data-theme="win10-light"] textarea:focus {
  border-color: #0078d4;
  box-shadow: 0 0 0 1px #0078d4;
}
[data-theme="win10-light"] table.data-grid thead th {
  background: #f3f3f3; color: #000;
  border-bottom: 1px solid #d0d0d0;
  font-weight: 600;
}
[data-theme="win10-light"] table.data-grid tbody tr:hover { background: #f0f0f0; }
[data-theme="win10-light"] .kpi-card { background: #fff; border: 1px solid #e5e5e5; color: #000; border-radius: 0; }
[data-theme="win10-light"] .kpi-card.accent {
  border-color: #0078d4; border-left: 4px solid #0078d4;
  background: linear-gradient(180deg, #f0f8ff, #fff);
}
[data-theme="win10-light"] .kpi-card.accent .value { color: #0078d4; }
[data-theme="win10-light"] .groupbox { background: #fafafa; border: 1px solid #e5e5e5; border-radius: 0; }
[data-theme="win10-light"] .groupbox-title { background: #fff; color: #000; font-weight: 600; }
[data-theme="win10-light"] .window-statusbar {
  background: #0078d4; color: #fff; border-top: none;
}
[data-theme="win10-light"] .window-statusbar kbd { background: rgba(255,255,255,0.20); color: #fff; }
[data-theme="win10-light"] .modal-card, [data-theme="win10-light"] .lang-popup {
  background: #fff; color: #000; border-radius: 0;
  border: 1px solid #767676;
  box-shadow: 0 0 0 1px #0078d4, 0 12px 32px rgba(0,0,0,0.30);
}

/* ===========================================================
 * WINDOWS 10 - Dark. Accent #4cc2ff.
 * =========================================================== */
[data-theme="win10-dark"] {
  --bg-app:      #1f1f1f;
  --bg-desktop:  #003f6e;
  --bg-window:   #1f1f1f;
  --bg-titlebar: #1f1f1f;
  --bg-sidebar:  #191919;
  --bg-input:    #2d2d2d;
  --bg-input-h:  #3a3a3a;
  --bg-row-hover: #2a2a2a;
  --bg-row-active:#264f78;
  --bg-elev:     #2d2d2d;
  --bd-window:   #767676;
  --bd-strong:   #4a4a4a;
  --bd-inset:    #4a4a4a;
  --bd-divider:  #2a2a2a;
  --text:        #fff;
  --text-muted:  #cccccc;
  --text-faint:  #969696;
  --accent:      #4cc2ff;
  --accent-2:    #0078d4;
  --accent-soft: rgba(76,194,255,0.12);
  --r-window: 0;
  --r-input:  0;
  --r-button: 0;
  --titlebar-h: 32px;
}
[data-theme="win10-dark"] body {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  background:
    radial-gradient(ellipse 40% 40% at 0% 0%, rgba(76,194,255,0.10), transparent),
    radial-gradient(ellipse 40% 40% at 100% 100%, rgba(0,120,212,0.15), transparent),
    #1a1a1a !important;
}
[data-theme="win10-dark"] .menubar { background: #1f1f1f; color: #fff; border-bottom: 1px solid #333; box-shadow: none; }
[data-theme="win10-dark"] .menubar .brand, [data-theme="win10-dark"] .menu-item { color: #fff; }
[data-theme="win10-dark"] .menu-item { border-radius: 0; padding: 4px 12px; }
[data-theme="win10-dark"] .menu-item:hover, [data-theme="win10-dark"] .menu-item.open { background: #2a2a2a; color: #fff; }
[data-theme="win10-dark"] .menu-dropdown {
  background: #2b2b2b; border: 1px solid #4a4a4a; border-radius: 0;
  backdrop-filter: none; color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.50);
}
[data-theme="win10-dark"] .menu-dropdown-item { color: #fff; border-radius: 0; padding: 7px 12px; }
[data-theme="win10-dark"] .menu-dropdown-item:hover { background: #3a3a3a; color: #fff; }
[data-theme="win10-dark"] .sidebar { background: #191919; color: #fff; border-right: 1px solid #2a2a2a; padding: 0; }
[data-theme="win10-dark"] .sb-section { color: #969696; padding: 14px 12px 6px; }
[data-theme="win10-dark"] .sb-btn {
  color: #fff; border-radius: 0; padding: 9px 12px;
  border-left: 4px solid transparent;
}
[data-theme="win10-dark"] .sb-btn svg { color: #cccccc; }
[data-theme="win10-dark"] .sb-btn:hover { background: #2a2a2a; }
[data-theme="win10-dark"] .sb-btn.active {
  background: #264f78; color: #fff;
  border-left-color: #4cc2ff; box-shadow: none;
}
[data-theme="win10-dark"] .sb-btn.active svg { color: #4cc2ff; }
[data-theme="win10-dark"] .workspace { background: transparent; background-image: none; }
[data-theme="win10-dark"] .mdi-window {
  background: #1f1f1f; border: 1px solid #4a4a4a; border-radius: 0;
  box-shadow: 0 8px 28px rgba(0,0,0,0.50);
}
[data-theme="win10-dark"] .mdi-window.focused {
  border-color: #4cc2ff;
  box-shadow: 0 0 0 1px #4cc2ff, 0 12px 32px rgba(0,0,0,0.55);
}
[data-theme="win10-dark"] .window-header {
  background: #1f1f1f; color: #fff; border-bottom: none; height: 32px; padding: 0;
}
[data-theme="win10-dark"] .window-header .title {
  position: static; transform: none; margin-left: 12px;
  color: #fff; font-weight: 400; font-size: 12px;
  display: flex; align-items: center; gap: 8px;
}
[data-theme="win10-dark"] .window-header .title svg { color: #4cc2ff; }
[data-theme="win10-dark"] .mdi-window:not(.focused) .window-header .title { color: #969696; }

[data-theme="win10-dark"] .window-controls { order: 2; margin-left: auto; gap: 0; padding: 0; align-self: stretch; }
[data-theme="win10-dark"] .win-btn {
  width: 46px; height: 32px; border-radius: 0;
  background: transparent !important; border: none; color: #fff; font-size: 12px;
}
[data-theme="win10-dark"] .win-btn span { opacity: 1; color: #fff; }
[data-theme="win10-dark"] .win-btn:hover { background: #3a3a3a !important; }
[data-theme="win10-dark"] .win-close:hover { background: #e81123 !important; }

[data-theme="win10-dark"] .window-body { background: #1f1f1f; color: #fff; }
[data-theme="win10-dark"] .window-toolbar { background: #252525; border-bottom: 1px solid #2a2a2a; }
[data-theme="win10-dark"] .fkey {
  background: #2d2d2d !important; border: 1px solid #4a4a4a; color: #fff;
  border-radius: 0; box-shadow: none; padding: 4px 12px;
  font-family: "Segoe UI", sans-serif !important;
}
[data-theme="win10-dark"] .fkey:hover:not(:disabled) { background: #3a3a3a !important; border-color: #767676; }
[data-theme="win10-dark"] .fkey-primary {
  background: #0078d4 !important; border-color: #0078d4; color: #fff !important;
}
[data-theme="win10-dark"] .fkey-primary:hover { background: #4cc2ff !important; border-color: #4cc2ff; }
[data-theme="win10-dark"] .fkey kbd { background: #444; border: 1px solid #555; color: #fff; }
[data-theme="win10-dark"] .btn { background: #2d2d2d !important; border: 1px solid #4a4a4a; color: #fff; border-radius: 0; }
[data-theme="win10-dark"] .btn-primary { background: #0078d4 !important; color: #fff; border-color: #0078d4; }
[data-theme="win10-dark"] input, [data-theme="win10-dark"] select, [data-theme="win10-dark"] textarea {
  background: #2d2d2d; color: #fff; border: 1px solid #4a4a4a;
  border-radius: 0; box-shadow: none;
}
[data-theme="win10-dark"] input:focus, [data-theme="win10-dark"] select:focus, [data-theme="win10-dark"] textarea:focus {
  border-color: #4cc2ff;
  box-shadow: 0 0 0 1px #4cc2ff;
}
[data-theme="win10-dark"] table.data-grid thead th { background: #2a2a2a; color: #cccccc; }
[data-theme="win10-dark"] .kpi-card { background: #252525; border: 1px solid #333; color: #fff; border-radius: 0; }
[data-theme="win10-dark"] .kpi-card.accent {
  border-color: #4cc2ff; border-left: 4px solid #4cc2ff;
  background: linear-gradient(180deg, rgba(76,194,255,0.10), #252525);
}
[data-theme="win10-dark"] .kpi-card.accent .value { color: #4cc2ff; }
[data-theme="win10-dark"] .groupbox { background: #1a1a1a; border: 1px solid #333; border-radius: 0; }
[data-theme="win10-dark"] .groupbox-title { background: #1f1f1f; color: #fff; font-weight: 600; }
[data-theme="win10-dark"] .window-statusbar {
  background: #0078d4; color: #fff; border-top: none;
}
[data-theme="win10-dark"] .modal-card, [data-theme="win10-dark"] .lang-popup {
  background: #2b2b2b; color: #fff; border-radius: 0;
  border: 1px solid #4a4a4a;
  box-shadow: 0 0 0 1px #4cc2ff, 0 12px 32px rgba(0,0,0,0.50);
}

/* ===========================================================
 * WINDOWS 11 - Light (Mica/rounded)
 * =========================================================== */
[data-theme="win11-light"] {
  --bg-app:      #f3f3f3;
  --bg-desktop:  #f3f3f3;
  --bg-window:   #f9f9f9;
  --bg-titlebar: #f9f9f9;
  --bg-sidebar:  #f3f3f3;
  --bg-input:    #ffffff;
  --bg-input-h:  #f5f5f5;
  --bg-row-hover: #ececec;
  --bg-row-active:#e6f1fb;
  --bg-elev:     #ffffff;
  --bd-window:   rgba(0,0,0,0.08);
  --bd-strong:   rgba(0,0,0,0.12);
  --bd-inset:    rgba(0,0,0,0.15);
  --bd-divider:  rgba(0,0,0,0.06);
  --text:        #1b1b1b;
  --text-muted:  #5e5e5e;
  --text-faint:  #888;
  --accent:      #0067c0;
  --accent-2:    #005495;
  --accent-soft: rgba(0,103,192,0.10);
  --r-window: 8px;
  --r-input:  4px;
  --r-button: 4px;
}
[data-theme="win11-light"] body {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(160,200,250,0.30), transparent),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(200,170,250,0.20), transparent),
    #d8e1ed !important;
}
[data-theme="win11-light"] .menubar { background: rgba(249,249,249,0.85); backdrop-filter: blur(20px) saturate(140%); border-bottom: 1px solid rgba(0,0,0,0.06); color: #1b1b1b; }
[data-theme="win11-light"] .menubar .brand, [data-theme="win11-light"] .menu-item { color: #1b1b1b; }
[data-theme="win11-light"] .menu-item { border-radius: 5px; }
[data-theme="win11-light"] .menu-item:hover, [data-theme="win11-light"] .menu-item.open { background: rgba(0,0,0,0.05); color: #1b1b1b; }
[data-theme="win11-light"] .menu-dropdown { background: rgba(249,249,249,0.95); backdrop-filter: blur(30px) saturate(140%); border: 1px solid rgba(0,0,0,0.08); border-radius: 7px; box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
[data-theme="win11-light"] .menu-dropdown-item { color: #1b1b1b; border-radius: 4px; }
[data-theme="win11-light"] .menu-dropdown-item:hover { background: rgba(0,0,0,0.05); color: #1b1b1b; }
[data-theme="win11-light"] .sidebar { background: #f3f3f3; color: #1b1b1b; border-right: 1px solid rgba(0,0,0,0.06); }
[data-theme="win11-light"] .sb-section { color: #666; }
[data-theme="win11-light"] .sb-btn { color: #1b1b1b; border-radius: 5px; }
[data-theme="win11-light"] .sb-btn svg { color: #5e5e5e; }
[data-theme="win11-light"] .sb-btn:hover { background: rgba(0,0,0,0.04); }
[data-theme="win11-light"] .sb-btn.active { background: #fff; color: #1b1b1b; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 3px solid #0067c0; padding-left: 7px; }
[data-theme="win11-light"] .sb-btn.active svg { color: #0067c0; }
[data-theme="win11-light"] .workspace { background: transparent; background-image: none; }
[data-theme="win11-light"] .mdi-window {
  background: rgba(249,249,249,0.96);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}
[data-theme="win11-light"] .window-header { background: transparent; border-bottom: 1px solid rgba(0,0,0,0.05); height: 36px; }
[data-theme="win11-light"] .window-header .title { position: static; transform: none; margin-left: 14px; color: #1b1b1b; font-size: 12.5px; font-weight: 500; }
[data-theme="win11-light"] .window-header .title svg { color: #0067c0; }
[data-theme="win11-light"] .window-controls { order: 2; margin-left: auto; gap: 0; padding: 0; }
[data-theme="win11-light"] .win-btn { width: 46px; height: 36px; border-radius: 0; background: transparent !important; border: none; color: #1b1b1b; font-size: 12px; }
[data-theme="win11-light"] .win-btn span { opacity: 1; color: #1b1b1b; }
[data-theme="win11-light"] .win-btn:hover { background: rgba(0,0,0,0.06) !important; }
[data-theme="win11-light"] .mdi-window > .window-header > .window-controls > .win-close:hover { background: #e81123 !important; color: #fff; }
[data-theme="win11-light"] .win-close:hover span { color: #fff; }
[data-theme="win11-light"] .window-body { background: #fff; color: #1b1b1b; }
[data-theme="win11-light"] .window-toolbar { background: #fafafa; border-bottom: 1px solid rgba(0,0,0,0.06); }
[data-theme="win11-light"] .fkey { background: #fff !important; border: 1px solid rgba(0,0,0,0.10); color: #1b1b1b; border-radius: 4px; box-shadow: none; }
[data-theme="win11-light"] .fkey:hover { background: #f5f5f5 !important; }
[data-theme="win11-light"] .fkey-primary { background: #0067c0 !important; color: #fff !important; border-color: #0067c0; }
[data-theme="win11-light"] .btn { background: #fff !important; border: 1px solid rgba(0,0,0,0.10); color: #1b1b1b; border-radius: 4px; }
[data-theme="win11-light"] .btn-primary { background: #0067c0 !important; color: #fff; border-color: #0067c0; }
[data-theme="win11-light"] input, [data-theme="win11-light"] select, [data-theme="win11-light"] textarea {
  background: #fff; color: #1b1b1b; border: 1px solid rgba(0,0,0,0.15); border-radius: 4px;
}
[data-theme="win11-light"] table.data-grid thead th { background: #f3f3f3; color: #1b1b1b; }
[data-theme="win11-light"] .kpi-card { background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 8px; color: #1b1b1b; }
[data-theme="win11-light"] .groupbox { background: #fff; border: 1px solid rgba(0,0,0,0.06); border-radius: 8px; }
[data-theme="win11-light"] .groupbox-title { background: #fff; color: #1b1b1b; }
[data-theme="win11-light"] .window-statusbar { background: #f3f3f3; color: #1b1b1b; border-top: 1px solid rgba(0,0,0,0.06); }
[data-theme="win11-light"] .modal-card, [data-theme="win11-light"] .lang-popup { background: #fff; color: #1b1b1b; border-radius: 8px; border: 1px solid rgba(0,0,0,0.08); }

/* ===========================================================
 * WINDOWS 11 - Dark
 * =========================================================== */
[data-theme="win11-dark"] {
  --bg-app:      #202020;
  --bg-desktop:  #202020;
  --bg-window:   #2b2b2b;
  --bg-titlebar: #2b2b2b;
  --bg-sidebar:  #1f1f1f;
  --bg-input:    #383838;
  --bg-input-h:  #424242;
  --bg-row-hover: #333;
  --bg-row-active:#1d3550;
  --bg-elev:     #383838;
  --bd-window:   rgba(255,255,255,0.07);
  --bd-strong:   rgba(255,255,255,0.12);
  --bd-inset:    rgba(255,255,255,0.10);
  --bd-divider:  rgba(255,255,255,0.06);
  --text:        #fff;
  --text-muted:  #c0c0c0;
  --text-faint:  #8a8a8a;
  --accent:      #60cdff;
  --accent-2:    #0098e8;
  --accent-soft: rgba(96,205,255,0.10);
  --r-window: 8px;
  --r-input:  4px;
  --r-button: 4px;
}
[data-theme="win11-dark"] body {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(80,120,180,0.18), transparent),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(130,90,180,0.15), transparent),
    #202020 !important;
}
[data-theme="win11-dark"] .menubar { background: rgba(43,43,43,0.85); backdrop-filter: blur(20px) saturate(140%); border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-theme="win11-dark"] .menu-item { border-radius: 5px; }
[data-theme="win11-dark"] .menu-item:hover, [data-theme="win11-dark"] .menu-item.open { background: rgba(255,255,255,0.06); }
[data-theme="win11-dark"] .menu-dropdown { background: rgba(43,43,43,0.95); backdrop-filter: blur(30px) saturate(140%); border: 1px solid rgba(255,255,255,0.08); border-radius: 7px; }
[data-theme="win11-dark"] .menu-dropdown-item { border-radius: 4px; }
[data-theme="win11-dark"] .menu-dropdown-item:hover { background: rgba(255,255,255,0.08); }
[data-theme="win11-dark"] .sidebar { background: #1f1f1f; border-right: 1px solid rgba(255,255,255,0.05); }
[data-theme="win11-dark"] .sb-btn { border-radius: 5px; }
[data-theme="win11-dark"] .sb-btn:hover { background: rgba(255,255,255,0.04); }
[data-theme="win11-dark"] .sb-btn.active { background: #383838; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.30); border-left: 3px solid #60cdff; padding-left: 7px; }
[data-theme="win11-dark"] .sb-btn.active svg { color: #60cdff; }
[data-theme="win11-dark"] .workspace { background: transparent; background-image: none; }
[data-theme="win11-dark"] .mdi-window {
  background: rgba(43,43,43,0.94); backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.40);
}
[data-theme="win11-dark"] .window-header { background: transparent; border-bottom: 1px solid rgba(255,255,255,0.06); height: 36px; }
[data-theme="win11-dark"] .window-header .title { position: static; transform: none; margin-left: 14px; color: #fff; font-size: 12.5px; font-weight: 500; }
[data-theme="win11-dark"] .window-header .title svg { color: #60cdff; }
[data-theme="win11-dark"] .window-controls { order: 2; margin-left: auto; gap: 0; padding: 0; }
[data-theme="win11-dark"] .win-btn { width: 46px; height: 36px; border-radius: 0; background: transparent !important; border: none; color: #fff; font-size: 12px; }
[data-theme="win11-dark"] .win-btn span { opacity: 1; color: #fff; }
[data-theme="win11-dark"] .win-btn:hover { background: rgba(255,255,255,0.08) !important; }
[data-theme="win11-dark"] .win-close:hover { background: #e81123 !important; }
[data-theme="win11-dark"] .window-body { background: #1f1f1f; }
[data-theme="win11-dark"] .window-toolbar { background: #2b2b2b; border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-theme="win11-dark"] .fkey { background: #383838 !important; border: 1px solid rgba(255,255,255,0.10); border-radius: 4px; box-shadow: none; }
[data-theme="win11-dark"] .fkey-primary { background: #0098e8 !important; border-color: #0098e8; color: #fff !important; }
[data-theme="win11-dark"] .btn-primary { background: #0078d4 !important; border-color: #0078d4; color: #fff; }
[data-theme="win11-dark"] .kpi-card { background: #383838; border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; }
[data-theme="win11-dark"] .groupbox { background: #2b2b2b; border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; }
[data-theme="win11-dark"] .groupbox-title { background: #2b2b2b; }

/* ===========================================================
 * macOS Aqua (Jaguar 10.2 / Panther 10.3 / Tiger 10.4)
 * ----------------------------------------------------------
 * Veri elementi Aqua riprodotti:
 *   - Pinstripe pattern orizzontale (sidebar + title bar + toolbar)
 *   - Jelly buttons pill-shaped con highlight gloss (lozenge)
 *   - Traffic lights con specular highlight (rosso/giallo/verde
 *     #ff5f57 / #febc2e / #28c840 colori "lozenge" iconici)
 *   - Title bar a gradient grigio "metal" con pinstripe sovrapposto
 *   - Window body bianco puro (non grigio chiaro come prima)
 *   - Selezione blu Aqua gradient (#56a3f7 → #2461c0)
 *   - Search field a pillola (border-radius infinito)
 *   - Sidebar con pinstripe + glow azzurro su active
 *   - Scrollbar Aqua a pillola lucida
 * =========================================================== */
[data-theme="mac-aqua-light"] {
  --bg-app:      #ddd;
  --bg-desktop:  #6d97b8;
  --bg-window:   #ffffff;
  --bg-titlebar: linear-gradient(180deg, #f0f0f0 0%, #cdcdcd 50%, #b6b6b6 51%, #c4c4c4 100%);
  --bg-sidebar:  #d4dde8;
  --bg-input:    #fff;
  --bg-input-h:  #fafafa;
  --bg-row-hover: #d6e4f8;
  --bg-row-active:#3a73d2;
  --bg-elev:     #f4f4f4;
  --bd-window:   #4a4a4a;
  --bd-strong:   #888;
  --bd-inset:    #aaa;
  --bd-divider:  #c4c4c4;
  --text:        #000;
  --text-muted:  #555;
  --text-faint:  #888;
  --accent:      #2461c0;
  --accent-2:    #1b4e9e;
  --accent-soft: rgba(60,131,240,0.18);
  --r-window: 7px;
  --r-input:  4px;
  --r-button: 100px;       /* pill-shaped jelly buttons */
  --titlebar-h: 22px;
}

/* Aqua pinstripe — sottili righe orizzontali firma visiva dell'Aqua.
 * Implementato con repeating-linear-gradient (no SVG = più affidabile
 * cross-browser, niente URL-encoding hassle). */
[data-theme="mac-aqua-light"] {
  --aqua-pinstripe: repeating-linear-gradient(to bottom, rgba(255,255,255,0.45) 0 1px, transparent 1px 2px);
  --aqua-pinstripe-dark: repeating-linear-gradient(to bottom, rgba(0,0,0,0.06) 0 1px, transparent 1px 2px);
}

[data-theme="mac-aqua-light"] body {
  font-family: "Lucida Grande", "Helvetica Neue", -apple-system, sans-serif;
  font-size: 11.5px;
  background: linear-gradient(180deg, #8aa9c4 0%, #5d748a 100%) fixed !important;
  color: #000;
}

/* ─── Menubar (top, "Apple menu" + titoli App) ─────────────── */
[data-theme="mac-aqua-light"] .menubar {
  background:
    var(--aqua-pinstripe-dark),
    linear-gradient(180deg, #fdfdfd 0%, #d8d8d8 60%, #c0c0c0 100%);
  border-bottom: 1px solid #888;
  color: #000;
  height: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.80), 0 1px 0 rgba(0,0,0,0.10);
}
[data-theme="mac-aqua-light"] .menubar .brand,
[data-theme="mac-aqua-light"] .menu-item { color: #000; text-shadow: 0 1px 0 rgba(255,255,255,0.5); }
[data-theme="mac-aqua-light"] .menu-item:hover,
[data-theme="mac-aqua-light"] .menu-item.open {
  background: linear-gradient(180deg, #56a3f7 0%, #2461c0 100%);
  color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
}
[data-theme="mac-aqua-light"] .menu-dropdown {
  background: linear-gradient(180deg, #fafafa 0%, #ececec 100%);
  border: 1px solid #888;
  border-radius: 4px;
  backdrop-filter: none;
  color: #000;
  box-shadow: 0 6px 20px rgba(0,0,0,0.30), 0 0 0 1px rgba(0,0,0,0.05);
}
[data-theme="mac-aqua-light"] .menu-dropdown-item { color: #000; }
[data-theme="mac-aqua-light"] .menu-dropdown-item:hover {
  background: linear-gradient(180deg, #56a3f7 0%, #2461c0 100%);
  color: #fff;
}

/* ─── Sidebar (panneau gauche con pinstripe Aqua) ────────────── */
[data-theme="mac-aqua-light"] .sidebar {
  background:
    var(--aqua-pinstripe),
    linear-gradient(180deg, #dce5ef 0%, #b5c5d8 100%);
  color: #000;
  border-right: 1px solid #7a8aa0;
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.30);
}
[data-theme="mac-aqua-light"] .sb-section { color: #4a5870; text-shadow: 0 1px 0 rgba(255,255,255,0.60); }
[data-theme="mac-aqua-light"] .sb-btn {
  color: #000;
  text-shadow: 0 1px 0 rgba(255,255,255,0.50);
  border-radius: 5px;
}
[data-theme="mac-aqua-light"] .sb-btn:hover { background: rgba(255,255,255,0.30); }
[data-theme="mac-aqua-light"] .sb-btn.active {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #6ab1ff 0%, #2461c0 100%);
  color: #fff;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.30);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -2px 3px rgba(0,0,0,0.12),
    0 1px 2px rgba(0,0,0,0.10);
}

/* ─── Workspace (sfondo "desktop") ───────────────────────────── */
[data-theme="mac-aqua-light"] .workspace {
  background: linear-gradient(180deg, #8aa9c4 0%, #5d748a 100%);
  background-image: none;
}

/* ─── Windows (MDI) ──────────────────────────────────────────── */
[data-theme="mac-aqua-light"] .mdi-window {
  background: #ffffff;
  border: 1px solid #4a4a4a;
  border-radius: 7px;
  box-shadow:
    0 22px 50px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.10) inset;
}
[data-theme="mac-aqua-light"] .mdi-window:not(.focused) { filter: brightness(0.96) saturate(0.7); }

/* Title bar Aqua: gradient metal + pinstripe orizzontale */
[data-theme="mac-aqua-light"] .window-header {
  background:
    var(--aqua-pinstripe-dark),
    linear-gradient(180deg, #f0f0f0 0%, #cdcdcd 50%, #b6b6b6 51%, #c4c4c4 100%);
  border-bottom: 1px solid #6e6e6e;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    inset 0 -1px 0 rgba(0,0,0,0.15);
  height: 22px; padding: 0 8px;
}
[data-theme="mac-aqua-light"] .mdi-window:not(.focused) .window-header {
  background: linear-gradient(180deg, #efefef 0%, #dcdcdc 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
[data-theme="mac-aqua-light"] .window-header .title {
  color: #1a1a1a; text-shadow: 0 1px 0 rgba(255,255,255,0.75);
  font-size: 12px; font-weight: 700; letter-spacing: 0.01em;
}
[data-theme="mac-aqua-light"] .window-header .title svg { color: #555; }
[data-theme="mac-aqua-light"] .mdi-window:not(.focused) .window-header .title { color: #7a7a7a; text-shadow: none; }

/* ─── Traffic lights (lozenges glossy autentici) ─────────────── */
[data-theme="mac-aqua-light"] .window-controls { gap: 8px; padding-left: 2px; }
[data-theme="mac-aqua-light"] .win-btn {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.50),
    inset 0 -1.5px 1px rgba(0,0,0,0.25),
    0 1px 0 rgba(255,255,255,0.50);
  padding: 0;
  font-size: 9px; color: rgba(0,0,0,0.55); font-weight: 700;
  position: relative;
  transition: filter .1s, transform .1s;
}
/* Highlight glossy ovale top-left — la firma del jelly */
[data-theme="mac-aqua-light"] .win-btn::before {
  content: ""; position: absolute;
  top: 1.5px; left: 2px; right: 2px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0));
  pointer-events: none;
}
[data-theme="mac-aqua-light"] .win-close {
  background: linear-gradient(180deg, #ff8a82 0%, #d83a2f 100%);
  background-color: #ff5f57;
}
[data-theme="mac-aqua-light"] .win-min  {
  background: linear-gradient(180deg, #ffd76b 0%, #d39800 100%);
  background-color: #febc2e;
}
[data-theme="mac-aqua-light"] .win-max  {
  background: linear-gradient(180deg, #76d97c 0%, #1ca42a 100%);
  background-color: #28c840;
}
[data-theme="mac-aqua-light"] .mdi-window:not(.focused) .win-btn {
  background: linear-gradient(180deg, #d8d8d8 0%, #b0b0b0 100%);
  background-color: #c4c4c4;
}
[data-theme="mac-aqua-light"] .win-btn:hover { filter: brightness(1.08); }
[data-theme="mac-aqua-light"] .win-btn:active { transform: translateY(0.5px); filter: brightness(0.92); }

/* ─── Window body (bianco puro = vero Aqua, non grigio) ──────── */
[data-theme="mac-aqua-light"] .window-body { background: #ffffff; color: #000; }

/* Toolbar interno: striscia chiara con pinstripe */
[data-theme="mac-aqua-light"] .window-toolbar {
  background:
    var(--aqua-pinstripe-dark),
    linear-gradient(180deg, #ededed 0%, #d2d2d2 100%);
  border-bottom: 1px solid #888;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  padding: 6px 10px;
}

/* ─── JELLY BUTTONS (la firma visiva Aqua) ───────────────────── */
/* Default = pill bianca perlata */
[data-theme="mac-aqua-light"] .fkey,
[data-theme="mac-aqua-light"] .btn {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0) 48%),
    linear-gradient(180deg, #fcfcfc 0%, #d8d8d8 100%) !important;
  border: 1px solid #6f6f6f;
  color: #000;
  border-radius: 100px;
  padding: 3px 14px;
  font-weight: 500;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    inset 0 -2px 3px rgba(0,0,0,0.08),
    0 1px 0 rgba(255,255,255,0.60);
  text-shadow: 0 1px 0 rgba(255,255,255,0.50);
  transition: filter .08s;
}
[data-theme="mac-aqua-light"] .fkey:hover:not(:disabled),
[data-theme="mac-aqua-light"] .btn:hover:not(:disabled) { filter: brightness(1.04); }
[data-theme="mac-aqua-light"] .fkey:active,
[data-theme="mac-aqua-light"] .btn:active { filter: brightness(0.92); transform: translateY(0.5px); }

/* Primary = jelly blu Aqua iconico (lozenge confirm button) */
[data-theme="mac-aqua-light"] .fkey-primary,
[data-theme="mac-aqua-light"] .btn-primary {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.65) 0%, rgba(255,255,255,0) 45%),
    linear-gradient(180deg, #6ab1ff 0%, #2461c0 100%) !important;
  border: 1px solid #1a4d96;
  color: #fff !important;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.35);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.65),
    inset 0 -2px 4px rgba(0,0,0,0.20),
    0 1px 0 rgba(255,255,255,0.65),
    0 0 8px rgba(60,131,240,0.30);
}

/* Inputs: bianco con inset shadow (sunken look) */
[data-theme="mac-aqua-light"] input[type="text"],
[data-theme="mac-aqua-light"] input[type="email"],
[data-theme="mac-aqua-light"] input[type="password"],
[data-theme="mac-aqua-light"] input[type="number"],
[data-theme="mac-aqua-light"] input[type="search"],
[data-theme="mac-aqua-light"] select,
[data-theme="mac-aqua-light"] textarea {
  background: #fff; color: #000;
  border: 1px solid #888;
  border-radius: 4px;
  padding: 3px 8px;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.12),
    0 1px 0 rgba(255,255,255,0.80);
}
[data-theme="mac-aqua-light"] input[type="search"] { border-radius: 100px; padding: 3px 12px; }
[data-theme="mac-aqua-light"] input:focus, [data-theme="mac-aqua-light"] textarea:focus, [data-theme="mac-aqua-light"] select:focus {
  outline: none;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.10),
    0 0 0 3px rgba(95,160,255,0.45);
  border-color: #2461c0;
}

/* Tables: header con stripe gradient */
[data-theme="mac-aqua-light"] table.data-grid {
  background: #fff;
  border: 1px solid #c0c0c0;
  border-radius: 4px;
}
[data-theme="mac-aqua-light"] table.data-grid thead th {
  background:
    var(--aqua-pinstripe-dark),
    linear-gradient(180deg, #f8f8f8 0%, #d8d8d8 100%);
  color: #1a1a1a;
  text-shadow: 0 1px 0 rgba(255,255,255,0.70);
  border-bottom: 1px solid #888;
  font-weight: 700;
}
[data-theme="mac-aqua-light"] table.data-grid tbody tr:nth-child(even) { background: #f0f5fb; }
[data-theme="mac-aqua-light"] table.data-grid tbody tr:hover { background: #d6e4f8; }
[data-theme="mac-aqua-light"] table.data-grid tbody tr.selected td {
  background: linear-gradient(180deg, #5a9eff 0%, #2461c0 100%);
  color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
}

/* KPI/group: white card con shadow soffuso */
[data-theme="mac-aqua-light"] .kpi-card {
  background: linear-gradient(180deg, #ffffff 0%, #f4f4f4 100%);
  border: 1px solid #b0b0b0;
  border-radius: 7px;
  color: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
[data-theme="mac-aqua-light"] .groupbox {
  background: #fff;
  border: 1px solid #b0b0b0;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.80);
}
[data-theme="mac-aqua-light"] .groupbox-title {
  background:
    var(--aqua-pinstripe-dark),
    linear-gradient(180deg, #f0f0f0 0%, #d8d8d8 100%);
  color: #000; text-shadow: 0 1px 0 rgba(255,255,255,0.6);
  border-bottom: 1px solid #b0b0b0;
}

/* Status bar = striscia chiara con pinstripe */
[data-theme="mac-aqua-light"] .window-statusbar {
  background:
    var(--aqua-pinstripe-dark),
    linear-gradient(180deg, #e0e0e0 0%, #c8c8c8 100%);
  border-top: 1px solid #888;
  color: #1a1a1a;
  text-shadow: 0 1px 0 rgba(255,255,255,0.60);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.70);
}

/* ─── Aqua scrollbars (pill blu lucido) ──────────────────────── */
[data-theme="mac-aqua-light"] ::-webkit-scrollbar { width: 15px; height: 15px; }
[data-theme="mac-aqua-light"] ::-webkit-scrollbar-track {
  background: linear-gradient(90deg, #d8d8d8 0%, #c8c8c8 100%);
  border-left: 1px solid #aaa;
}
[data-theme="mac-aqua-light"] ::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 50%),
    linear-gradient(90deg, #afc8e6 0%, #80a8d8 100%);
  border: 1px solid #5e87b8;
  border-radius: 100px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.50);
}
[data-theme="mac-aqua-light"] ::-webkit-scrollbar-thumb:hover { filter: brightness(1.05); }
[data-theme="mac-aqua-light"] ::-webkit-scrollbar-corner { background: #c8c8c8; }

/* Selection text */
[data-theme="mac-aqua-light"] ::selection {
  background: #5a9eff; color: #fff;
}

/* ===========================================================
 * macOS Aqua Graphite (dark variant — non era una vera modalità
 * dark in Tiger ma era la "Graphite Appearance" che desaturava i
 * jellies in argento metallico)
 * =========================================================== */
[data-theme="mac-aqua-dark"] {
  --bg-app:      #2b2b2b;
  --bg-desktop:  #1c1c1c;
  --bg-window:   #2a2a2a;
  --bg-titlebar: linear-gradient(180deg, #4a4a4a, #2b2b2b);
  --bg-sidebar:  #353c46;
  --bg-input:    #1c1c1c;
  --bg-input-h:  #252525;
  --bg-row-hover: rgba(60,131,240,0.20);
  --bg-row-active:#3a73d2;
  --bg-elev:     #3a3a3a;
  --bd-window:   #000;
  --bd-strong:   #555;
  --bd-inset:    #555;
  --bd-divider:  #444;
  --text:        #f0f0f0;
  --text-muted:  #c0c0c0;
  --text-faint:  #888;
  --accent:      #5a9eff;
  --accent-2:    #2461c0;
  --accent-soft: rgba(60,131,240,0.20);
  --r-window: 7px;
  --r-input:  4px;
  --r-button: 100px;
  --titlebar-h: 22px;
  --aqua-pinstripe-d: repeating-linear-gradient(to bottom, rgba(255,255,255,0.04) 0 1px, transparent 1px 2px);
}

[data-theme="mac-aqua-dark"] body {
  font-family: "Lucida Grande", "Helvetica Neue", -apple-system, sans-serif;
  font-size: 11.5px;
  background: linear-gradient(180deg, #1c1c1c 0%, #000 100%) fixed !important;
  color: #f0f0f0;
}

[data-theme="mac-aqua-dark"] .menubar {
  background:
    var(--aqua-pinstripe-d),
    linear-gradient(180deg, #4d4d4d 0%, #303030 100%);
  border-bottom: 1px solid #000;
  color: #f0f0f0;
  height: 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 1px 0 rgba(0,0,0,0.40);
}
[data-theme="mac-aqua-dark"] .menubar .brand,
[data-theme="mac-aqua-dark"] .menu-item { color: #f0f0f0; }
[data-theme="mac-aqua-dark"] .menu-item:hover,
[data-theme="mac-aqua-dark"] .menu-item.open {
  background: linear-gradient(180deg, #5a9eff 0%, #2461c0 100%);
  color: #fff;
}
[data-theme="mac-aqua-dark"] .menu-dropdown {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border: 1px solid #000;
  color: #f0f0f0;
}

[data-theme="mac-aqua-dark"] .sidebar {
  background:
    var(--aqua-pinstripe-d),
    linear-gradient(180deg, #3d4654 0%, #2a323d 100%);
  color: #f0f0f0;
  border-right: 1px solid #000;
}
[data-theme="mac-aqua-dark"] .sb-btn { color: #f0f0f0; }
[data-theme="mac-aqua-dark"] .sb-btn:hover { background: rgba(255,255,255,0.08); }
[data-theme="mac-aqua-dark"] .sb-btn.active {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #5a9eff 0%, #2461c0 100%);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.40), inset 0 -2px 3px rgba(0,0,0,0.20);
}

[data-theme="mac-aqua-dark"] .workspace { background: #1c1c1c; background-image: none; }
[data-theme="mac-aqua-dark"] .mdi-window {
  background: #2a2a2a;
  border: 1px solid #000;
  border-radius: 7px;
  box-shadow: 0 22px 50px rgba(0,0,0,0.55);
}
[data-theme="mac-aqua-dark"] .window-header {
  background:
    var(--aqua-pinstripe-d),
    linear-gradient(180deg, #555555 0%, #2e2e2e 50%, #262626 51%, #2e2e2e 100%);
  border-bottom: 1px solid #000;
  height: 22px; padding: 0 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
[data-theme="mac-aqua-dark"] .window-header .title {
  color: #f0f0f0; text-shadow: 0 -1px 0 rgba(0,0,0,0.50);
  font-size: 12px; font-weight: 700;
}
[data-theme="mac-aqua-dark"] .mdi-window:not(.focused) .window-header {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
}

/* Traffic lights — versione Graphite (tutti argentati) */
[data-theme="mac-aqua-dark"] .window-controls { gap: 8px; }
[data-theme="mac-aqua-dark"] .win-btn {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.60);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #b0b0b0 0%, #707070 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.40),
    inset 0 -1px 1px rgba(0,0,0,0.30),
    0 1px 0 rgba(255,255,255,0.10);
  position: relative;
}
[data-theme="mac-aqua-dark"] .win-btn::before {
  content: ""; position: absolute;
  top: 1.5px; left: 2px; right: 2px; height: 6px; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.70), rgba(255,255,255,0));
  pointer-events: none;
}
[data-theme="mac-aqua-dark"] .win-close:hover { background: linear-gradient(180deg, #ff8a82 0%, #d83a2f 100%); }
[data-theme="mac-aqua-dark"] .win-min:hover   { background: linear-gradient(180deg, #ffd76b 0%, #d39800 100%); }
[data-theme="mac-aqua-dark"] .win-max:hover   { background: linear-gradient(180deg, #76d97c 0%, #1ca42a 100%); }

[data-theme="mac-aqua-dark"] .window-body { background: #2a2a2a; color: #f0f0f0; }
[data-theme="mac-aqua-dark"] .window-toolbar {
  background:
    var(--aqua-pinstripe-d),
    linear-gradient(180deg, #404040 0%, #303030 100%);
  border-bottom: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Jelly buttons argento (Graphite) */
[data-theme="mac-aqua-dark"] .fkey,
[data-theme="mac-aqua-dark"] .btn {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.40) 0%, rgba(255,255,255,0) 48%),
    linear-gradient(180deg, #6c6c6c 0%, #393939 100%) !important;
  border: 1px solid #000;
  color: #f0f0f0;
  border-radius: 100px;
  padding: 3px 14px;
  font-weight: 500;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.40),
    inset 0 -2px 3px rgba(0,0,0,0.30),
    0 1px 0 rgba(255,255,255,0.10);
  text-shadow: 0 -1px 0 rgba(0,0,0,0.50);
}
[data-theme="mac-aqua-dark"] .fkey:hover:not(:disabled),
[data-theme="mac-aqua-dark"] .btn:hover:not(:disabled) { filter: brightness(1.15); }
[data-theme="mac-aqua-dark"] .fkey:active,
[data-theme="mac-aqua-dark"] .btn:active { filter: brightness(0.85); transform: translateY(0.5px); }

[data-theme="mac-aqua-dark"] .fkey-primary,
[data-theme="mac-aqua-dark"] .btn-primary {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 45%),
    linear-gradient(180deg, #6ab1ff 0%, #2461c0 100%) !important;
  border-color: #0e3b78;
  color: #fff !important;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.45);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -2px 4px rgba(0,0,0,0.25),
    0 1px 0 rgba(255,255,255,0.15),
    0 0 10px rgba(60,131,240,0.40);
}

[data-theme="mac-aqua-dark"] input[type="text"],
[data-theme="mac-aqua-dark"] input[type="email"],
[data-theme="mac-aqua-dark"] input[type="password"],
[data-theme="mac-aqua-dark"] input[type="number"],
[data-theme="mac-aqua-dark"] input[type="search"],
[data-theme="mac-aqua-dark"] select,
[data-theme="mac-aqua-dark"] textarea {
  background: #1c1c1c; color: #f0f0f0;
  border: 1px solid #000;
  border-radius: 4px;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.50),
    0 1px 0 rgba(255,255,255,0.05);
}
[data-theme="mac-aqua-dark"] input[type="search"] { border-radius: 100px; }

[data-theme="mac-aqua-dark"] table.data-grid thead th {
  background:
    var(--aqua-pinstripe-d),
    linear-gradient(180deg, #4a4a4a 0%, #2e2e2e 100%);
  color: #f0f0f0;
  border-bottom: 1px solid #000;
}
[data-theme="mac-aqua-dark"] .kpi-card {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border: 1px solid #000;
  color: #f0f0f0;
  border-radius: 7px;
}
[data-theme="mac-aqua-dark"] .groupbox { background: #2a2a2a; border: 1px solid #000; border-radius: 6px; }
[data-theme="mac-aqua-dark"] .groupbox-title {
  background: linear-gradient(180deg, #404040 0%, #303030 100%);
  color: #f0f0f0; border-bottom: 1px solid #000;
}
[data-theme="mac-aqua-dark"] .window-statusbar {
  background:
    var(--aqua-pinstripe-d),
    linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border-top: 1px solid #000;
  color: #f0f0f0;
}

[data-theme="mac-aqua-dark"] ::-webkit-scrollbar { width: 15px; height: 15px; }
[data-theme="mac-aqua-dark"] ::-webkit-scrollbar-track { background: #1c1c1c; border-left: 1px solid #000; }
[data-theme="mac-aqua-dark"] ::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.30) 0%, rgba(255,255,255,0) 50%),
    linear-gradient(90deg, #5a5a5a 0%, #3a3a3a 100%);
  border: 1px solid #000;
  border-radius: 100px;
}

[data-theme="mac-aqua-dark"] ::selection { background: #2461c0; color: #fff; }

/* ===========================================================
 * macOS Sierra (10.12) - flat-ish
 * =========================================================== */
[data-theme="mac-sierra-light"] {
  --bg-app:      #ececec;
  --bg-desktop:  #4a90b8;
  --bg-window:   #f6f6f6;
  --bg-titlebar: #e6e6e6;
  --bg-sidebar:  #e8e8e8;
  --bg-input:    #fff;
  --bg-input-h:  #f0f0f0;
  --bg-row-hover: #f0f0f0;
  --bg-row-active:#3c83f0;
  --bg-elev:     #fff;
  --bd-window:   #c0c0c0;
  --bd-strong:   #b0b0b0;
  --bd-inset:    #c8c8c8;
  --bd-divider:  #e0e0e0;
  --text:        #1a1a1a;
  --text-muted:  #6e6e6e;
  --text-faint:  #999;
  --accent:      #007aff;
  --accent-2:    #0062cc;
  --accent-soft: rgba(0,122,255,0.10);
  --r-window: 6px;
  --r-input:  4px;
  --r-button: 4px;
}
[data-theme="mac-sierra-light"] body { font-family: -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif; background: #4a90b8 !important; }
[data-theme="mac-sierra-light"] .menubar { background: rgba(246,246,246,0.95); backdrop-filter: blur(10px); border-bottom: 1px solid #d0d0d0; color: #1a1a1a; }
[data-theme="mac-sierra-light"] .menubar .brand, [data-theme="mac-sierra-light"] .menu-item { color: #1a1a1a; }
[data-theme="mac-sierra-light"] .menu-dropdown { background: rgba(246,246,246,0.96); color: #1a1a1a; border: 1px solid #c0c0c0; border-radius: 5px; }
[data-theme="mac-sierra-light"] .menu-dropdown-item { color: #1a1a1a; }
[data-theme="mac-sierra-light"] .menu-dropdown-item:hover { background: #007aff; color: #fff; }
[data-theme="mac-sierra-light"] .sidebar { background: #e8e8e8; color: #1a1a1a; border-right: 1px solid #c0c0c0; }
[data-theme="mac-sierra-light"] .sb-section { color: #888; }
[data-theme="mac-sierra-light"] .sb-btn { color: #1a1a1a; }
[data-theme="mac-sierra-light"] .sb-btn:hover { background: rgba(0,0,0,0.06); }
[data-theme="mac-sierra-light"] .sb-btn.active { background: #007aff; color: #fff; }
[data-theme="mac-sierra-light"] .workspace { background: #4a90b8; background-image: none; }
[data-theme="mac-sierra-light"] .mdi-window { background: #f6f6f6; border: 1px solid #b0b0b0; border-radius: 6px; box-shadow: 0 12px 30px rgba(0,0,0,0.25); }
[data-theme="mac-sierra-light"] .window-header { background: #e6e6e6; border-bottom: 1px solid #c8c8c8; }
[data-theme="mac-sierra-light"] .window-header .title { color: #1a1a1a; }
[data-theme="mac-sierra-light"] .window-header .title svg { color: #007aff; }
[data-theme="mac-sierra-light"] .window-body { background: #f6f6f6; color: #1a1a1a; }
[data-theme="mac-sierra-light"] .window-toolbar { background: #ececec; border-bottom: 1px solid #d8d8d8; }
[data-theme="mac-sierra-light"] .fkey { background: #fff !important; border: 1px solid #c0c0c0; color: #1a1a1a; border-radius: 4px; box-shadow: 0 1px 0 rgba(0,0,0,0.04); }
[data-theme="mac-sierra-light"] .fkey-primary { background: #007aff !important; color: #fff !important; border-color: #007aff; }
[data-theme="mac-sierra-light"] .btn { background: #fff !important; border: 1px solid #c0c0c0; color: #1a1a1a; border-radius: 4px; }
[data-theme="mac-sierra-light"] .btn-primary { background: #007aff !important; color: #fff; border-color: #007aff; }
[data-theme="mac-sierra-light"] input, [data-theme="mac-sierra-light"] select, [data-theme="mac-sierra-light"] textarea { background: #fff; color: #1a1a1a; border: 1px solid #c8c8c8; border-radius: 4px; }
[data-theme="mac-sierra-light"] table.data-grid thead th { background: #ececec; color: #1a1a1a; }
[data-theme="mac-sierra-light"] .kpi-card { background: #fff; border: 1px solid #d8d8d8; border-radius: 6px; color: #1a1a1a; }
[data-theme="mac-sierra-light"] .groupbox { background: #fff; border: 1px solid #d8d8d8; border-radius: 6px; }
[data-theme="mac-sierra-light"] .groupbox-title { background: #f6f6f6; color: #1a1a1a; }

[data-theme="mac-sierra-dark"] {
  --bg-app:      #292929;
  --bg-desktop:  #2a2a2a;
  --bg-window:   #2e2e2e;
  --bg-titlebar: #3a3a3a;
  --bg-sidebar:  #292929;
  --bg-input:    #1a1a1a;
  --bg-input-h:  #222;
  --bg-row-hover: rgba(255,255,255,0.05);
  --bg-row-active:#0a84ff;
  --bg-elev:     #353535;
  --bd-window:   #000;
  --bd-strong:   #444;
  --bd-inset:    #555;
  --bd-divider:  #404040;
  --text:        #fff;
  --text-muted:  #b0b0b0;
  --text-faint:  #888;
  --accent:      #0a84ff;
  --accent-2:    #0060c0;
  --accent-soft: rgba(10,132,255,0.15);
  --r-window: 6px;
  --r-input:  4px;
  --r-button: 4px;
}
[data-theme="mac-sierra-dark"] body { font-family: -apple-system, "SF Pro Text", sans-serif; background: #2a2a2a !important; }
[data-theme="mac-sierra-dark"] .menubar { background: rgba(46,46,46,0.95); border-bottom: 1px solid #000; }
[data-theme="mac-sierra-dark"] .menu-dropdown { background: rgba(58,58,58,0.96); border: 1px solid #000; }
[data-theme="mac-sierra-dark"] .sidebar { background: #252525; border-right: 1px solid #000; }
[data-theme="mac-sierra-dark"] .workspace { background: #2a2a2a; background-image: none; }
[data-theme="mac-sierra-dark"] .mdi-window { background: #2e2e2e; border: 1px solid #000; border-radius: 6px; }
[data-theme="mac-sierra-dark"] .window-header { background: #3a3a3a; border-bottom: 1px solid #000; }

/* ===========================================================
 * macOS Big Sur (11)
 * =========================================================== */
[data-theme="mac-bigsur-light"] {
  --bg-app:      #ececec;
  --bg-desktop:  linear-gradient(135deg, #ffd6a5, #ffadb0, #c8a3ff, #88c5ff);
  --bg-window:   #f6f6f6;
  --bg-titlebar: rgba(246,246,246,0.85);
  --bg-sidebar:  rgba(220,220,220,0.50);
  --bg-input:    #fff;
  --bg-input-h:  #f5f5f5;
  --bg-row-hover: rgba(0,122,255,0.10);
  --bg-row-active:rgba(0,122,255,0.25);
  --bg-elev:     #fff;
  --bd-window:   rgba(0,0,0,0.10);
  --bd-strong:   rgba(0,0,0,0.16);
  --bd-inset:    rgba(0,0,0,0.10);
  --bd-divider:  rgba(0,0,0,0.06);
  --text:        #000;
  --text-muted:  #555;
  --text-faint:  #888;
  --accent:      #007aff;
  --accent-2:    #0062cc;
  --accent-soft: rgba(0,122,255,0.12);
  --r-window: 12px;
  --r-input:  6px;
  --r-button: 6px;
}
[data-theme="mac-bigsur-light"] body { font-family: -apple-system, "SF Pro Text", sans-serif; background: linear-gradient(135deg, #ffd6a5, #ffadb0 30%, #c8a3ff 60%, #88c5ff) fixed !important; }
[data-theme="mac-bigsur-light"] .menubar { background: rgba(255,255,255,0.65); backdrop-filter: blur(40px) saturate(180%); border-bottom: 1px solid rgba(0,0,0,0.05); color: #000; }
[data-theme="mac-bigsur-light"] .menubar .brand, [data-theme="mac-bigsur-light"] .menu-item { color: #000; }
[data-theme="mac-bigsur-light"] .menu-dropdown { background: rgba(255,255,255,0.85); backdrop-filter: blur(40px) saturate(180%); border: 1px solid rgba(0,0,0,0.06); border-radius: 10px; color: #000; }
[data-theme="mac-bigsur-light"] .menu-dropdown-item { color: #000; border-radius: 5px; }
[data-theme="mac-bigsur-light"] .menu-dropdown-item:hover { background: #007aff; color: #fff; }
[data-theme="mac-bigsur-light"] .sidebar { background: rgba(232,232,232,0.6); backdrop-filter: blur(20px); color: #000; border-right: 1px solid rgba(0,0,0,0.05); }
[data-theme="mac-bigsur-light"] .sb-btn { color: #000; border-radius: 6px; }
[data-theme="mac-bigsur-light"] .sb-btn:hover { background: rgba(0,0,0,0.06); }
[data-theme="mac-bigsur-light"] .sb-btn.active { background: rgba(0,122,255,0.15); color: #007aff; }
[data-theme="mac-bigsur-light"] .sb-btn.active svg { color: #007aff; }
[data-theme="mac-bigsur-light"] .workspace { background: transparent; background-image: none; }
[data-theme="mac-bigsur-light"] .mdi-window { background: rgba(246,246,246,0.92); backdrop-filter: blur(20px) saturate(180%); border: 1px solid rgba(0,0,0,0.10); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.30); }
[data-theme="mac-bigsur-light"] .window-header { background: transparent; border-bottom: 1px solid rgba(0,0,0,0.05); }
[data-theme="mac-bigsur-light"] .window-header .title { color: #000; }
[data-theme="mac-bigsur-light"] .window-header .title svg { color: #007aff; }
[data-theme="mac-bigsur-light"] .window-body { background: #fff; color: #000; }
[data-theme="mac-bigsur-light"] .window-toolbar { background: rgba(240,240,240,0.85); border-bottom: 1px solid rgba(0,0,0,0.05); }
[data-theme="mac-bigsur-light"] .fkey { background: #fff !important; border: 1px solid rgba(0,0,0,0.10); color: #000; border-radius: 6px; box-shadow: none; }
[data-theme="mac-bigsur-light"] .fkey-primary { background: #007aff !important; color: #fff !important; border-color: #007aff; }
[data-theme="mac-bigsur-light"] .btn { background: #fff !important; border: 1px solid rgba(0,0,0,0.10); color: #000; border-radius: 6px; }
[data-theme="mac-bigsur-light"] .btn-primary { background: #007aff !important; color: #fff; border-color: #007aff; }
[data-theme="mac-bigsur-light"] input, [data-theme="mac-bigsur-light"] select, [data-theme="mac-bigsur-light"] textarea { background: #fff; color: #000; border: 1px solid rgba(0,0,0,0.10); border-radius: 6px; }
[data-theme="mac-bigsur-light"] table.data-grid thead th { background: rgba(240,240,240,0.6); color: #000; }
[data-theme="mac-bigsur-light"] .kpi-card { background: #fff; border: 1px solid rgba(0,0,0,0.05); border-radius: 12px; color: #000; }
[data-theme="mac-bigsur-light"] .groupbox { background: #fff; border: 1px solid rgba(0,0,0,0.05); border-radius: 10px; }
[data-theme="mac-bigsur-light"] .groupbox-title { background: #fff; color: #000; }
[data-theme="mac-bigsur-light"] .modal-card, [data-theme="mac-bigsur-light"] .lang-popup { background: rgba(255,255,255,0.95); backdrop-filter: blur(30px); border-radius: 14px; color: #000; }

[data-theme="mac-bigsur-dark"] {
  --bg-app:      #2c2c2e;
  --bg-desktop:  linear-gradient(135deg, #2c1c4d, #3a1f5c, #4c2168, #1a1a3f);
  --bg-window:   #2c2c2e;
  --bg-titlebar: rgba(44,44,46,0.85);
  --bg-sidebar:  rgba(44,44,46,0.6);
  --bg-input:    #1c1c1e;
  --bg-input-h:  #2c2c2e;
  --bg-row-hover: rgba(255,255,255,0.04);
  --bg-row-active:rgba(10,132,255,0.30);
  --bg-elev:     #3a3a3c;
  --bd-window:   rgba(255,255,255,0.10);
  --bd-strong:   rgba(255,255,255,0.16);
  --bd-inset:    rgba(255,255,255,0.10);
  --bd-divider:  rgba(255,255,255,0.06);
  --text:        #fff;
  --text-muted:  #b0b0b5;
  --text-faint:  #8a8a8e;
  --accent:      #0a84ff;
  --accent-2:    #0060c0;
  --accent-soft: rgba(10,132,255,0.20);
  --r-window: 12px;
  --r-input:  6px;
  --r-button: 6px;
}
[data-theme="mac-bigsur-dark"] body { font-family: -apple-system, "SF Pro Text", sans-serif; background: linear-gradient(135deg, #2c1c4d, #3a1f5c 40%, #4c2168 70%, #1a1a3f) fixed !important; }
[data-theme="mac-bigsur-dark"] .menubar { background: rgba(28,28,30,0.65); backdrop-filter: blur(40px) saturate(180%); border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-theme="mac-bigsur-dark"] .menu-dropdown { background: rgba(44,44,46,0.85); backdrop-filter: blur(40px) saturate(180%); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; }
[data-theme="mac-bigsur-dark"] .menu-dropdown-item { border-radius: 5px; }
[data-theme="mac-bigsur-dark"] .sidebar { background: rgba(44,44,46,0.5); backdrop-filter: blur(20px); border-right: 1px solid rgba(255,255,255,0.05); }
[data-theme="mac-bigsur-dark"] .sb-btn { border-radius: 6px; }
[data-theme="mac-bigsur-dark"] .sb-btn:hover { background: rgba(255,255,255,0.06); }
[data-theme="mac-bigsur-dark"] .sb-btn.active { background: rgba(10,132,255,0.25); color: #0a84ff; }
[data-theme="mac-bigsur-dark"] .sb-btn.active svg { color: #0a84ff; }
[data-theme="mac-bigsur-dark"] .workspace { background: transparent; background-image: none; }
[data-theme="mac-bigsur-dark"] .mdi-window { background: rgba(44,44,46,0.85); backdrop-filter: blur(30px) saturate(180%); border: 1px solid rgba(255,255,255,0.10); border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.50); }
[data-theme="mac-bigsur-dark"] .window-header { background: transparent; border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-theme="mac-bigsur-dark"] .window-body { background: rgba(28,28,30,0.4); }
[data-theme="mac-bigsur-dark"] .window-toolbar { background: rgba(44,44,46,0.5); border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-theme="mac-bigsur-dark"] .fkey { background: rgba(58,58,60,0.8) !important; border: 1px solid rgba(255,255,255,0.10); border-radius: 6px; box-shadow: none; }
[data-theme="mac-bigsur-dark"] .fkey-primary { background: #0a84ff !important; border-color: #0a84ff; }

/* ===========================================================
 * macOS Liquid Glass - Apple Liquid Glass effect
 * Uses real SVG displacement filter for refraction (defined in app.php).
 * Inspired by github.com/nikdelvin/liquid-glass.
 * =========================================================== */
[data-theme="mac-liquid"] {
  --bg-app:      #0a0e1a;
  --bg-desktop:  transparent;
  --bg-window:   rgba(255,255,255,0.08);
  --bg-titlebar: transparent;
  --bg-sidebar:  rgba(255,255,255,0.05);
  --bg-input:    rgba(255,255,255,0.06);
  --bg-input-h:  rgba(255,255,255,0.12);
  --bg-row-hover: rgba(255,255,255,0.06);
  --bg-row-active:rgba(120,140,255,0.30);
  --bg-elev:     rgba(255,255,255,0.10);
  --bd-window:   rgba(255,255,255,0.22);
  --bd-strong:   rgba(255,255,255,0.30);
  --bd-inset:    rgba(255,255,255,0.12);
  --bd-divider:  rgba(255,255,255,0.08);
  --text:        #fff;
  --text-muted:  rgba(255,255,255,0.75);
  --text-faint:  rgba(255,255,255,0.50);
  --accent:      #a18cff;
  --accent-2:    #7c6df7;
  --accent-soft: rgba(161,140,255,0.20);
  --r-window: 20px;
  --r-input:  12px;
  --r-button: 12px;
}

/* Live colorful background that the glass refracts */
[data-theme="mac-liquid"] body {
  font-family: -apple-system, "SF Pro Text", -apple-system-headline, sans-serif;
  background:
    radial-gradient(circle at 15% 25%, rgba(255,110,199,0.45) 0%, transparent 38%),
    radial-gradient(circle at 85% 30%, rgba(110,199,255,0.45) 0%, transparent 42%),
    radial-gradient(circle at 50% 90%, rgba(182,108,255,0.42) 0%, transparent 46%),
    radial-gradient(circle at 75% 70%, rgba(108,255,209,0.38) 0%, transparent 38%),
    linear-gradient(135deg, #070912 0%, #140c1f 50%, #070912 100%) !important;
  background-attachment: fixed !important;
  animation: liquidShift 30s ease-in-out infinite alternate;
}
@keyframes liquidShift {
  0%   { background-position: 0% 0%, 100% 0%, 50% 100%, 75% 50%, 0 0; }
  50%  { background-position: 20% 10%, 80% 15%, 60% 90%, 65% 60%, 0 0; }
  100% { background-position: 5% 5%, 95% 5%, 55% 95%, 80% 55%, 0 0; }
}

/* Menubar: glass strip on top */
[data-theme="mac-liquid"] .menubar {
  background: rgba(14,16,32,0.78);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  color: #fff;
}
[data-theme="mac-liquid"] .menubar .brand, [data-theme="mac-liquid"] .menu-item { color: #fff; }
[data-theme="mac-liquid"] .menu-item { border-radius: 8px; }
[data-theme="mac-liquid"] .menu-item:hover, [data-theme="mac-liquid"] .menu-item.open {
  background: rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
[data-theme="mac-liquid"] .menu-dropdown {
  background: rgba(20,22,42,0.92);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(255,255,255,0.06),
    0 24px 60px rgba(0,0,0,0.55);
  padding: 6px;
}
[data-theme="mac-liquid"] .menu-dropdown-item { border-radius: 10px; color: #fff; }
[data-theme="mac-liquid"] .menu-dropdown-item:hover {
  background: linear-gradient(135deg, rgba(161,140,255,0.35), rgba(124,109,247,0.20));
}

/* Sidebar */
[data-theme="mac-liquid"] .sidebar {
  /* Verre TEINTÉ sombre opaque : lisible (boutons + section Paramètres) au lieu
     du quasi-transparent d'avant. min/max-height = scroll interne fiable. */
  background: rgba(16,18,34,0.80);
  backdrop-filter: blur(30px) saturate(150%);
  -webkit-backdrop-filter: blur(30px) saturate(150%);
  border-right: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 1px 0 0 rgba(255,255,255,0.06);
  min-height: 0;
  max-height: 100%;
}
[data-theme="mac-liquid"] .sb-section { color: rgba(255,255,255,0.62); }
[data-theme="mac-liquid"] .sb-btn {
  color: #fff; border-radius: 12px;
}
[data-theme="mac-liquid"] .sb-btn:hover {
  background: rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}
[data-theme="mac-liquid"] .sb-btn.active {
  background: linear-gradient(135deg, rgba(161,140,255,0.45), rgba(124,109,247,0.30));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(255,255,255,0.08),
    0 0 24px rgba(161,140,255,0.30);
}
[data-theme="mac-liquid"] .workspace { background: transparent; background-image: none; }

/* MDI window: the real Liquid Glass. Uses ::before for refraction layer. */
[data-theme="mac-liquid"] .mdi-window {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 20px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.40),
    inset 0 0 0 1px rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(255,255,255,0.08),
    0 0 0 1px rgba(255,255,255,0.18),
    0 24px 60px rgba(0,0,0,0.55),
    0 8px 20px rgba(0,0,0,0.30);
  isolation: isolate;
}
/* The glass layer: backdrop blur + refraction via SVG filter */
[data-theme="mac-liquid"] .mdi-window::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  /* Panneau verre SOMBRE opaque : le contenu (texte blanc, tableaux) reste
     lisible au lieu de flotter sur le fond arc-en-ciel. On garde le flou +
     un léger dégradé pour l'effet verre, mais avec un fond teinté ~0.82. */
  background:
    linear-gradient(135deg,
      rgba(28,30,52,0.86) 0%,
      rgba(18,20,38,0.82) 45%,
      rgba(14,16,32,0.84) 100%);
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  pointer-events: none;
  z-index: -1;
}
/* Specular highlight (top-left rim of liquid drop) */
[data-theme="mac-liquid"] .mdi-window::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 50%;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.12) 0%,
    rgba(255,255,255,0.03) 35%,
    transparent 100%);
  pointer-events: none;
  mix-blend-mode: overlay;
  z-index: -1;
}
[data-theme="mac-liquid"] .mdi-window.focused {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.50),
    inset 0 0 0 1px rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(255,255,255,0.10),
    0 0 0 1px rgba(255,255,255,0.30),
    0 0 30px rgba(161,140,255,0.30),
    0 24px 60px rgba(0,0,0,0.55);
}

[data-theme="mac-liquid"] .window-header {
  background: transparent;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  height: 40px;
  position: relative;
}
[data-theme="mac-liquid"] .window-header .title {
  color: #fff; font-weight: 500; letter-spacing: -0.01em;
  text-shadow: 0 1px 1px rgba(0,0,0,0.20);
}
[data-theme="mac-liquid"] .window-header .title svg { color: #c4b4ff; }

[data-theme="mac-liquid"] .window-body { background: transparent; color: #fff; }
[data-theme="mac-liquid"] .window-toolbar {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Glass buttons */
[data-theme="mac-liquid"] .fkey, [data-theme="mac-liquid"] .btn {
  background: rgba(255,255,255,0.10) !important;
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(255,255,255,0.08),
    0 2px 8px rgba(0,0,0,0.15);
  text-shadow: 0 1px 1px rgba(0,0,0,0.20);
}
[data-theme="mac-liquid"] .fkey:hover:not(:disabled), [data-theme="mac-liquid"] .btn:hover {
  background: rgba(255,255,255,0.18) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(255,255,255,0.08),
    0 4px 12px rgba(0,0,0,0.20),
    0 0 20px rgba(161,140,255,0.25);
}
[data-theme="mac-liquid"] .fkey-primary, [data-theme="mac-liquid"] .btn-primary {
  background: linear-gradient(135deg, rgba(161,140,255,0.65), rgba(124,109,247,0.50)) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.40);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.10),
    0 6px 16px rgba(161,140,255,0.35),
    0 0 24px rgba(161,140,255,0.40);
}
[data-theme="mac-liquid"] .fkey kbd {
  background: rgba(0,0,0,0.20); border-color: rgba(255,255,255,0.10);
  color: #fff;
}

[data-theme="mac-liquid"] input:not([type="checkbox"]):not([type="radio"]), [data-theme="mac-liquid"] select, [data-theme="mac-liquid"] textarea {
  background: rgba(0,0,0,0.28); color: #fff;
  border: 1px solid rgba(255,255,255,0.22); border-radius: 12px;
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 1px 4px rgba(0,0,0,0.20);
}
[data-theme="mac-liquid"] input:focus, [data-theme="mac-liquid"] select:focus, [data-theme="mac-liquid"] textarea:focus {
  background: rgba(255,255,255,0.10);
  border-color: rgba(161,140,255,0.60);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 0 0 3px rgba(161,140,255,0.20),
    0 0 24px rgba(161,140,255,0.30);
}

[data-theme="mac-liquid"] table.data-grid {
  background: transparent;
}
[data-theme="mac-liquid"] table.data-grid thead th {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  color: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
[data-theme="mac-liquid"] table.data-grid tbody td { border-bottom: 1px solid rgba(255,255,255,0.06); }
[data-theme="mac-liquid"] table.data-grid tbody tr:hover { background: rgba(255,255,255,0.06); }

/* KPI cards: each is a small glass droplet */
[data-theme="mac-liquid"] .kpi-card {
  position: relative;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(24px) saturate(180%) brightness(110%);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(255,255,255,0.06),
    0 8px 24px rgba(0,0,0,0.20);
  overflow: hidden;
}
[data-theme="mac-liquid"] .kpi-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}
[data-theme="mac-liquid"] .kpi-card.accent {
  background: linear-gradient(135deg, rgba(161,140,255,0.35), rgba(124,109,247,0.15));
  border-color: rgba(161,140,255,0.45);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.40),
    inset 0 -1px 0 rgba(255,255,255,0.05),
    0 8px 24px rgba(0,0,0,0.20),
    0 0 30px rgba(161,140,255,0.30);
}
[data-theme="mac-liquid"] .kpi-card.accent .value { color: #fff; text-shadow: 0 0 18px rgba(161,140,255,0.50); }

[data-theme="mac-liquid"] .groupbox {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 rgba(255,255,255,0.04);
}
[data-theme="mac-liquid"] .groupbox-title {
  background: rgba(20,20,35,0.85);
  backdrop-filter: blur(20px);
  color: #fff;
  border-radius: 6px;
}
[data-theme="mac-liquid"] .groupbox-title svg { color: #c4b4ff; }

[data-theme="mac-liquid"] .window-statusbar {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
}

[data-theme="mac-liquid"] .modal-overlay {
  backdrop-filter: blur(20px) saturate(140%);
  background: rgba(0,0,0,0.45);
}
[data-theme="mac-liquid"] .modal-card, [data-theme="mac-liquid"] .lang-popup {
  /* Dialogue verre SOMBRE opaque : lisible (l'ancien 0.08 blanc flottait). */
  background: rgba(22,24,44,0.94);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 22px;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    0 30px 80px rgba(0,0,0,0.60);
}

[data-theme="mac-liquid"] .toast {
  background: rgba(22,24,44,0.94);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 16px;
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 16px 40px rgba(0,0,0,0.45);
}

/* Sidebar workspace bg message: ghost */
[data-theme="mac-liquid"] .workspace-bg-msg, [data-theme="mac-liquid"] .workspace-bg-msg .title {
  color: rgba(255,255,255,0.55);
}
[data-theme="mac-liquid"] .workspace-bg-msg svg { color: rgba(161,140,255,0.50); }

/* Win-style chrome traffic light replaced by glass dots on liquid */
[data-theme="mac-liquid"] .win-btn {
  width: 14px; height: 14px;
  border: 1px solid rgba(0,0,0,0.20);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.50),
    inset 0 -1px 0 rgba(0,0,0,0.20);
}

/* ===========================================================
 * Theme preview cards (used in theme picker UI)
 * =========================================================== */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.theme-card {
  border: 2px solid var(--bd-divider);
  border-radius: 8px;
  padding: 0;
  background: var(--bg-elev);
  cursor: pointer;
  transition: transform .15s var(--ease-out), border-color .15s;
  overflow: hidden;
  position: relative;
  text-align: left;
  color: var(--text);
  font: inherit;
}
.theme-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-card .preview {
  height: 96px;
  position: relative;
  overflow: hidden;
}
.theme-card .preview-titlebar { height: 18px; }
.theme-card .preview-content { height: 78px; padding: 8px; font-size: 9px; }
.theme-card .info {
  padding: 8px 10px;
  border-top: 1px solid var(--bd-divider);
  background: var(--bg-window);
}
.theme-card .info .name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.theme-card .info .desc { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.theme-card .lr-switch { display: flex; gap: 4px; margin-top: 6px; }
.theme-card .lr-switch button {
  flex: 1; padding: 3px 6px; font-size: 10px; border-radius: 4px;
  border: 1px solid var(--bd-divider); background: var(--bg-input);
  color: var(--text-muted); cursor: pointer;
}
.theme-card .lr-switch button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.theme-card .badge-current {
  position: absolute; top: 8px; right: 8px;
  background: var(--accent); color: #fff;
  font-size: 9px; padding: 2px 6px; border-radius: 4px;
  font-weight: 700; letter-spacing: 0.04em;
}

/* ===========================================================
 * « RiLoPOS Windows » — habillage authentique 7.css
 * -----------------------------------------------------------
 * 7.css (khang-nd.github.io/7.css) est chargé dynamiquement pour ce thème.
 * • Fenêtres MDI : portent les VRAIES classes 7.css (.window, .title-bar,
 *   .title-bar-controls, button[aria-label], .window-body) → cadre Aero verre,
 *   dégradés, glyphes des boutons min/max/close = 100% 7.css.
 * • Boutons de la sidebar : habillés avec les TOKENS 7.css (--w7-el-*) →
 *   vrais boutons 7.css.
 * • Éléments absents de 7.css (menu bar, volet gauche, bureau MDI gris,
 *   palette de couleurs lisible) : réglés ici en style Windows 7 clair.
 * Les variables ci-dessous rendent le contenu lisible (texte noir sur clair)
 * — sinon le texte des fenêtres reste en palette sombre = illisible.
 * =========================================================== */
[data-theme="rilopos-win"] {
  --bg-app:       #f0f0f0;
  --bg-desktop:   #808080;                 /* zone MDI parente grise (Windows) */
  --bg-window:    #ffffff;
  --bg-titlebar:  var(--w7-w-bg, #4580c4);
  --bg-sidebar:   #f0f0f0;
  --bg-input:     #ffffff;
  --bg-input-h:   #f6faff;
  --bg-row-hover: #e8f3fd;
  --bg-row-active:#cbe2fa;
  --bg-elev:      #f4f4f4;
  --bd-window:    #8e8f8f;
  --bd-strong:    #7f9db9;
  --bd-inset:     #b6b6b6;
  --bd-divider:   #dcdcdc;
  --border:       #c8d0da;
  --text:         #000000;
  --text-muted:   #303030;
  --text-faint:   #6a6a6a;
  --accent:       #2978d4;
  --accent-2:     #1c5aa8;
  --accent-soft:  rgba(41,120,212,0.14);
  --r-window: 6px; --r-input: 3px; --r-button: 3px;
  --titlebar-h: 30px;
}
[data-theme="rilopos-win"] body { font-family: "Segoe UI", Tahoma, sans-serif; }
/* Bureau MDI parent = gris Windows */
[data-theme="rilopos-win"] .workspace { background: #808080; background-image: none; }

/* --- Fenêtres MDI : tout le chrome vient de 7.css ; ici uniquement la
   neutralisation du chrome par défaut de l'app + adaptation de structure --- */
/* Rendre le fond transparent pour laisser voir le cadre verre 7.css (.window:before) ;
   7.css gagne déjà pour bordure/ombre/rayon (chargé après app.css). On garde
   l'ombre 7.css au focus (token) et on retire l'assombrissement app hors focus. */
/* fond transparent → laisse voir le cadre verre 7.css (.window:before) ;
   position:absolute réaffirmée (7.css .window met position:relative). */
[data-theme="rilopos-win"] .mdi-window { background: transparent; position: absolute; }
[data-theme="rilopos-win"] .mdi-window.focused { box-shadow: 2px 2px 10px 1px var(--w7-w-bd, #000000b3), inset 0 0 0 1px #fffa; filter: none; }
[data-theme="rilopos-win"] .mdi-window:not(.focused) { filter: none; }
[data-theme="rilopos-win"] .window-controls { order: 2; margin-left: auto; gap: 0; padding: 0; }
/* Titre à gauche (notre base le centre en position:absolute) + noir lisible.
   Halo blanc 7.css adouci (l'original empile 8 ombres → rendu « beugé »). */
[data-theme="rilopos-win"] .window-header .title {
  position: static; transform: none; left: auto; max-width: none;
  order: 1; color: #000;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 4px #fff;
}
[data-theme="rilopos-win"] .window-header .title svg { color: #1c5aa8; }
[data-theme="rilopos-win"] .win-min   { order: 1; }
[data-theme="rilopos-win"] .win-max   { order: 2; }
[data-theme="rilopos-win"] .win-close { order: 3; }
/* Laisse 7.css dessiner les boutons (fond/bordure/glyphe gérés par 7.css via
   .title-bar-controls button, plus spécifique) ; on annule juste la taille
   fixe 12px de la pastille « traffic-light » et on masque notre glyphe <span>. */
[data-theme="rilopos-win"] .win-btn { width: auto; height: auto; }
[data-theme="rilopos-win"] .win-btn span { display: none; }   /* 7.css dessine le glyphe */
[data-theme="rilopos-win"] .win-resize { display: none; }     /* 7.css n'a pas de poignée */

/* --- Boutons de la sidebar = vrais boutons 7.css (tokens --w7-el-*) --- */
[data-theme="rilopos-win"] .sidebar { background: #f0f0f0; border-right: 1px solid #c8c8c8; }
[data-theme="rilopos-win"] .sb-section { color: #15428b; }
[data-theme="rilopos-win"] .sb-btn {
  background: var(--w7-el-grad, linear-gradient(#f2f2f2 45%, #ebebeb 45%, #cfcfcf));
  border: 1px solid var(--w7-el-bd, #8e8f8f);
  border-radius: var(--w7-el-bdr, 3px);
  box-shadow: var(--w7-el-sd, inset 0 0 0 1px #fffc);
  color: #000; margin: 1px 2px; min-height: 23px;
}
[data-theme="rilopos-win"] .sb-btn:hover {
  background: var(--w7-el-grad-h, linear-gradient(#eaf6fd 45%, #bee6fd, #a7d9f5));
  border-color: var(--w7-el-bd-h, #3c7fb1);
}
[data-theme="rilopos-win"] .sb-btn:active { transform: none; }
[data-theme="rilopos-win"] .sb-btn.active {
  background: var(--w7-el-grad-a, linear-gradient(#e5f4fc,#c4e5f6 30% 50%,#98d1ef 50%,#68b3db));
  border-color: var(--w7-el-bd-a, #6d91ab); color: #000;
  box-shadow: var(--w7-el-sd-a, inset 1px 1px 0 #0003, inset -1px 1px 0 #0001);
}
[data-theme="rilopos-win"] .sb-btn svg,
[data-theme="rilopos-win"] .sb-btn:hover svg,
[data-theme="rilopos-win"] .sb-btn.active svg { color: #1c5aa8; }

/* --- Menu bar (absent de 7.css) : barre Windows 7 claire --- */
[data-theme="rilopos-win"] .menubar {
  background: linear-gradient(180deg, #fdfdfd 0%, #eef1f5 100%);
  border-bottom: 1px solid #c8c8c8; color: #000; box-shadow: none;
}
[data-theme="rilopos-win"] .menubar .brand,
[data-theme="rilopos-win"] .menu-item { color: #000; }
[data-theme="rilopos-win"] .menu-item { border-radius: 3px; }
[data-theme="rilopos-win"] .menu-item:hover,
[data-theme="rilopos-win"] .menu-item.open {
  background: #cbe2fa; color: #000; box-shadow: inset 0 0 0 1px #7da2c8;
}
[data-theme="rilopos-win"] .menu-dropdown {
  background: #f7f9fb; border: 1px solid #8e8f8f; border-radius: 0 0 3px 3px;
  color: #000; backdrop-filter: none; -webkit-backdrop-filter: none;
}
[data-theme="rilopos-win"] .menu-dropdown-item { color: #000; }
[data-theme="rilopos-win"] .menu-dropdown-item:hover { background: #cbe2fa; color: #000; }
[data-theme="rilopos-win"] .menu-dropdown-item svg { color: #44546a; }
[data-theme="rilopos-win"] .menu-dropdown-item:hover svg { color: #1c5aa8; }

/* --- Status bar 7.css authentique --- */
/* Barre d'état de l'app (bas) : fond surface + champs enfoncés (border-right). */
[data-theme="rilopos-win"] .bo-statusbar {
  background: var(--w7-surface, #f0f0f0);
  border-top: 1px solid var(--w7-w-bd, #808080);
  box-shadow: inset 0 1px 0 #fff9;
  color: #000; gap: 0; padding: 0;
}
[data-theme="rilopos-win"] .bo-statusbar .sb-stat {
  padding: 3px 10px; margin: 0;
  border-right: 1px solid #cfcfcf; box-shadow: inset -1px 0 0 #fff;
}
[data-theme="rilopos-win"] .bo-statusbar .sb-right { margin-left: auto; }
[data-theme="rilopos-win"] .bo-statusbar .sb-node b { color: #1c5aa8; }
/* Barre d'état de fenêtre (dialogues) = composant .status-bar de 7.css. */
[data-theme="rilopos-win"] .window-statusbar {
  background: var(--w7-surface, #f0f0f0);
  border: 1px solid var(--w7-w-bd, #808080); border-top: 0;
  box-shadow: 0 1px 0 #fff9, 1px 0 0 #fff9, -1px 0 0 #fff9;
  color: #000; margin: 6px; margin-top: -6px;
}

/* --- Composants MDI (dashboard/stats/produits…) : plusieurs fonds sont codés
   en dur en sombre dans app.css → on les repasse en clair Windows. Boutons =
   tokens 7.css authentiques. --- */
[data-theme="rilopos-win"] .btn,
[data-theme="rilopos-win"] .fkey {
  background: var(--w7-el-grad, linear-gradient(#f2f2f2 45%, #ebebeb 45%, #cfcfcf));
  border: 1px solid var(--w7-el-bd, #8e8f8f);
  border-radius: var(--w7-el-bdr, 3px);
  box-shadow: var(--w7-el-sd, inset 0 0 0 1px #fffc);
  color: #000;
}
[data-theme="rilopos-win"] .btn:hover,
[data-theme="rilopos-win"] .fkey:hover:not(:disabled) {
  background: var(--w7-el-grad-h, linear-gradient(#eaf6fd 45%, #bee6fd, #a7d9f5));
  border-color: var(--w7-el-bd-h, #3c7fb1); filter: none;
}
[data-theme="rilopos-win"] .btn-primary,
[data-theme="rilopos-win"] .fkey-primary {
  background: linear-gradient(180deg, #569de5 0%, #3a7ec9 47%, #2767b2 49%, #4292d6 100%);
  border-color: #1a589f; color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
}
[data-theme="rilopos-win"] .btn-danger {
  background: linear-gradient(180deg, #f6a4a4, #d22f2f); border-color: #a01818; color: #fff;
}
[data-theme="rilopos-win"] .btn-ghost { background: transparent; color: #000; border-color: #8e8f8f; box-shadow: none; }

[data-theme="rilopos-win"] .kpi-card {
  background: #fff; border: 1px solid #c8d0da;
  box-shadow: 0 1px 2px rgba(0,40,90,0.08); color: #000;
}
[data-theme="rilopos-win"] .kpi-card .value { color: #111; }
[data-theme="rilopos-win"] .kpi-card.accent { background: linear-gradient(180deg, #eef6ff, #dcecfb); border-color: #7fb0da; }
[data-theme="rilopos-win"] .kpi-card.accent .value { color: #15428b; }

[data-theme="rilopos-win"] .groupbox { background: #fff; border: 1px solid #c8d0da; }
[data-theme="rilopos-win"] .groupbox-title { background: #fff; color: #15428b; }

[data-theme="rilopos-win"] .window-toolbar {
  background: linear-gradient(180deg, #f6f8fb 0%, #e6ecf3 100%);
  border-bottom: 1px solid #c3ccd8; color: #000;
}

[data-theme="rilopos-win"] input,
[data-theme="rilopos-win"] select,
[data-theme="rilopos-win"] textarea {
  background: #fff; color: #000; border: 1px solid #7da2c8; border-radius: 2px;
}
[data-theme="rilopos-win"] input[readonly] { background: #eef1f4; color: #555; }

[data-theme="rilopos-win"] .data-grid thead th {
  background: linear-gradient(180deg, #eef3f9, #d9e3ef); color: #000; border-bottom: 1px solid #b7c6d8;
}
[data-theme="rilopos-win"] .data-grid tbody tr:hover { background: #e8f2fd; }

[data-theme="rilopos-win"] .modal-card,
[data-theme="rilopos-win"] .lang-popup {
  background: #f7f9fb; border: 1px solid #8e8f8f; color: #000; backdrop-filter: none; -webkit-backdrop-filter: none;
}
[data-theme="rilopos-win"] .seg { background: #fff; border: 1px solid #b7c6d8; }
[data-theme="rilopos-win"] .rep-bar { background: #e3ecf6; }
[data-theme="rilopos-win"] .kpi-card.accent::before { display: none; }

/* Répartition des paiements : progressbar 7.css authentique, mais en BLEU. */
[data-theme="rilopos-win"] .bar-row .bar-track {
  height: 15px; overflow: hidden;
  border: 1px solid var(--w7-el-bd, #8e8f8f);
  border-radius: var(--w7-el-bdr, 3px);
  box-shadow: inset 0 0 0 1px #f3f3f388, 0 0 0 1px #eaeaea88;
  background:
    radial-gradient(circle at 0 50%, #0000001f 10px, transparent 30px),
    radial-gradient(circle at 100% 50%, #0000001f 10px, transparent 30px),
    linear-gradient(180deg, #f3f3f3af, #fcfcfcaf 3px, #dbdbdbaf 6px, #cacacaaf 0, #d5d5d5af), #ddd;
}
[data-theme="rilopos-win"] .bar-row .bar-fill {
  border-radius: 0;
  background-color: #1a9be0;   /* progress 7.css en bleu (vs vert par défaut) */
  background-image:
    linear-gradient(180deg, #f3f3f3af, #fcfcfcaf 3px, #dbdbdbaf 6px, transparent 0),
    radial-gradient(circle at 0 50%, #0000002f 10px, transparent 30px),
    radial-gradient(circle at 100% 50%, #0000002f 10px, transparent 30px),
    linear-gradient(180deg, transparent 65%, #ffffff55),
    linear-gradient(180deg, transparent 6px, #cacaca33 0, #d5d5d533);
  box-shadow: inset 0 0 0 1px #ffffff1f;
}
