:root {
      --maroon: #4A0E17;
      --maroon-light: #6B1724;
      --maroon-hover: #380A11;
      --gold: #D4AF37;
      --gold-light: #E5C158;
      --gold-bg: rgba(212, 175, 55, 0.12);
      --bg-main: #FAF8F5;
      /* Cream Ivory */
      --card-bg: #FFFFFF;
      --text-main: #2E2325;
      --text-muted: #6E6263;
      --border-color: #ECE5DA;
      --emerald: #1E7A56;
      --emerald-bg: #E8F5EE;
      --rose: #A3283B;
      --rose-bg: #FDF0F2;
      --amber: #D97706;
      --amber-bg: #FFFBEB;
      --blue: #2563EB;
      --blue-bg: #EFF6FF;
      --shadow-sm: 0 1px 3px rgba(74, 14, 23, 0.05);
      --shadow-md: 0 4px 16px rgba(74, 14, 23, 0.08);
      --shadow-lg: 0 10px 25px rgba(74, 14, 23, 0.12);
      --radius: 12px;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      font-family: 'Inter', sans-serif;
    }

    body {
      background: var(--bg-main);
      color: var(--text-main);
      min-height: 100vh;
      overflow-x: hidden;
    }

    /* SVG Global Sizing - Kecilkan semua icon */
    svg {
      width: 13px;
      height: 13px;
      display: inline-block;
      vertical-align: middle;
      flex-shrink: 0;
    }

    /* Sidebar */
    .sb {
      position: fixed;
      left: 0;
      top: 0;
      bottom: 0;
      width: 260px;
      background: var(--maroon);
      color: #fff;
      display: flex;
      flex-direction: column;
      z-index: 100;
      box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
      transition: 0.25s ease;
    }

    .sb-header {
      padding: 22px 20px;
      border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    }

    .sb-brand {
      font-family: 'Cinzel', serif;
      font-size: 15px;
      font-weight: 700;
      color: var(--gold);
      letter-spacing: 0.5px;
      line-height: 1.3;
    }

    .sb-subbrand {
      font-size: 10.5px;
      color: rgba(255, 255, 255, 0.6);
      margin-top: 3px;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .sb-domain {
      font-size: 10px;
      background: rgba(212, 175, 55, 0.15);
      color: var(--gold);
      padding: 2px 6px;
      border-radius: 4px;
      display: inline-block;
      margin-top: 6px;
      font-weight: 600;
    }

    .sb-user {
      padding: 14px 20px;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      display: flex;
      align-items: center;
      gap: 10px;
      background: rgba(255, 255, 255, 0.03);
    }

    .sb-avatar {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      background: var(--maroon-light);
      border: 1.5px solid var(--gold);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--gold);
      font-weight: 700;
      font-size: 11px;
      flex-shrink: 0;
    }

    .sb-uname {
      font-size: 12.5px;
      font-weight: 600;
      color: #fff;
    }

    .sb-urole {
      font-size: 10px;
      color: var(--gold);
    }

    .sb-nav {
      flex: 1;
      overflow-y: auto;
      padding: 12px 0;
    }

    .nav-sec {
      padding: 8px 20px 4px;
      font-size: 9.5px;
      font-weight: 700;
      color: rgba(255, 255, 255, 0.4);
      letter-spacing: 1.2px;
      text-transform: uppercase;
    }

    .ni {
      display: flex;
      align-items: center;
      gap: 9px;
      padding: 9px 20px;
      cursor: pointer;
      color: rgba(255, 255, 255, 0.75);
      font-size: 12px;
      font-weight: 500;
      border-left: 3px solid transparent;
      transition: 0.15s ease;
      width: 100%;
      text-align: left;
      background: none;
      border-top: none;
      border-right: none;
      border-bottom: none;
    }

    .ni:hover {
      background: rgba(212, 175, 55, 0.1);
      color: #fff;
    }

    .ni.active {
      background: rgba(212, 175, 55, 0.18);
      color: var(--gold);
      border-left-color: var(--gold);
      font-weight: 600;
    }

    .ni svg {
      width: 13px;
      height: 13px;
    }

    .sb-footer {
      padding: 14px 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      font-size: 10px;
      color: rgba(255, 255, 255, 0.45);
      text-align: center;
    }

    /* Sidebar Collapsed State */
    .sb.sb-collapsed {
      transform: translateX(-260px);
    }

    .layout {
      margin-left: 260px;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      transition: margin-left 0.25s ease;
    }

    .layout.sb-collapsed {
      margin-left: 0 !important;
    }

    .btn-toggle-sidebar-maroon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 5px 8px;
      background: rgba(212, 175, 55, 0.15);
      border: 1px solid rgba(212, 175, 55, 0.4);
      border-radius: 6px;
      color: var(--gold);
      cursor: pointer;
      font-size: 11px;
      font-weight: 800;
      transition: all 0.2s ease;
    }

    .btn-toggle-sidebar-maroon:hover {
      background: var(--gold);
      color: var(--maroon);
    }

    .sb-collapsed-floating-toggle {
      position: fixed;
      left: 0;
      top: 14px;
      z-index: 1050;
      background: linear-gradient(135deg, #4A0E17 0%, #2B050B 100%);
      color: #D4AF37;
      border: 1px solid rgba(212, 175, 55, 0.5);
      border-left: none;
      border-radius: 0 8px 8px 0;
      padding: 7px 11px;
      display: flex;
      align-items: center;
      gap: 5px;
      cursor: pointer;
      box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.25);
      font-weight: 800;
      font-size: 12px;
      transition: all 0.2s ease;
    }

    .sb-collapsed-floating-toggle:hover {
      background: #6B1422;
      color: #FFFFFF;
      padding-left: 14px;
      box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.35);
    }

    .topbar {
      position: sticky;
      top: 0;
      background: rgba(251, 248, 245, 0.94);
      backdrop-filter: blur(10px);
      border-bottom: 1px solid var(--border-color);
      padding: 0 30px;
      height: 64px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      z-index: 90;
    }

    .tb-title {
      font-size: 17.5px;
      font-weight: 700;
      color: var(--maroon);
    }

    .tb-sub {
      font-size: 11.5px;
      color: var(--text-muted);
      margin-top: 1px;
    }

    .tb-actions {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .main-content {
      padding: 28px 30px;
      flex: 1;
    }

    /* Buttons & Badges */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 7.5px 14px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: 0.18s ease;
    }

    .btn svg {
      width: 12px;
      height: 12px;
    }

    .btn-maroon {
      background: var(--maroon);
      color: var(--gold);
    }

    .btn-maroon:hover {
      background: var(--maroon-light);
    }

    .btn-gold {
      background: var(--gold);
      color: var(--maroon);
      font-weight: 700;
    }

    .btn-gold:hover {
      background: var(--gold-light);
    }

    .btn-outline {
      background: #fff;
      border: 1.5px solid var(--border-color);
      color: var(--text-main);
    }

    .btn-outline:hover {
      border-color: var(--maroon);
      color: var(--maroon);
    }

    .btn-emerald {
      background: var(--emerald);
      color: #fff;
    }

    .btn-emerald:hover {
      background: #155e41;
    }

    .btn-rose {
      background: var(--rose);
      color: #fff;
    }

    .btn-rose:hover {
      background: #8b1d2e;
    }

    .interactive-cell {
      transition: background 0.15s ease, color 0.15s ease;
    }

    .interactive-cell:hover {
      background-color: rgba(230, 57, 70, 0.08) !important;
      color: var(--maroon) !important;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 9px;
      border-radius: 20px;
      font-size: 10px;
      font-weight: 700;
    }

    .b-emerald {
      background: var(--emerald-bg);
      color: var(--emerald);
    }

    .b-rose {
      background: var(--rose-bg);
      color: var(--rose);
    }

    .b-amber {
      background: var(--amber-bg);
      color: var(--amber);
    }

    .b-blue {
      background: var(--blue-bg);
      color: var(--blue);
    }

    .b-maroon {
      background: var(--maroon);
      color: var(--gold);
    }

    /* Grid Layouts */
    .grid-5 {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 14px;
      margin-bottom: 24px;
    }

    @media (max-width: 1350px) and (min-width: 900px) {
      .grid-5 {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
        gap: 12px;
      }
    }

    .grid-3 {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
      margin-bottom: 24px;
    }

    .grid-4 {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      margin-bottom: 24px;
    }

    .grid-2 {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
      margin-bottom: 24px;
    }

    .grid-3-1 {
      display: grid;
      grid-template-columns: 2.2fr 1fr;
      gap: 20px;
      margin-bottom: 24px;
    }

    /* Cards */
    .card {
      background: var(--card-bg);
      border-radius: var(--radius);
      padding: 22px;
      border: 1px solid var(--border-color);
      box-shadow: var(--shadow-sm);
      transition: 0.2s ease;
    }

    .card:hover {
      box-shadow: var(--shadow-md);
    }

    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border-color);
    }

    .card-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--maroon);
      display: flex;
      align-items: center;
      gap: 7px;
    }

    .card-title svg {
      width: 13px;
      height: 13px;
    }

    /* Stat Cards */
    .sc {
      background: var(--card-bg);
      border-radius: var(--radius);
      padding: 15px 14px 13px;
      border: 1px solid var(--border-color);
      position: relative;
      overflow: hidden;
      box-shadow: var(--shadow-sm);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      min-width: 0;
      box-sizing: border-box;
    }

    .sc-lbl {
      font-size: 10px;
      font-weight: 700;
      color: var(--text-muted);
      letter-spacing: 0.5px;
      text-transform: uppercase;
      padding-right: 32px;
      line-height: 1.35;
      min-height: 27px;
      display: flex;
      align-items: flex-start;
      word-break: break-word;
    }

    .sc-val {
      font-size: clamp(14px, 1.22vw, 22px);
      font-weight: 800;
      color: var(--maroon);
      margin: 5px 0 3px;
      line-height: 1.15;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      letter-spacing: -0.4px;
    }

    .sc-val .fmt-rupiah {
      display: inline-flex;
      align-items: baseline;
      gap: 3px;
      width: auto;
      white-space: nowrap;
    }

    .sc-val .fmt-rp {
      font-size: 0.72em;
      font-weight: 700;
      opacity: 0.85;
      padding-right: 1px;
    }

    .sc-val .fmt-val {
      font-weight: 800;
      font-feature-settings: "tnum";
      font-variant-numeric: tabular-nums;
    }

    .sc-sub {
      font-size: clamp(9.5px, 0.75vw, 11px);
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
      margin-top: 2px;
    }

    .sc-sub .fmt-rupiah {
      display: inline-flex;
      align-items: baseline;
      gap: 2px;
      width: auto;
      white-space: nowrap;
    }

    .sc-sub .fmt-rp {
      font-size: 0.8em;
      padding-right: 1px;
    }

    .sc-sub.up {
      color: var(--emerald);
    }

    .sc-sub.down {
      color: var(--rose);
    }

    .sc-icon {
      position: absolute;
      top: 12px;
      right: 12px;
      width: 26px;
      height: 26px;
      border-radius: 7px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-main);
      color: var(--maroon);
      pointer-events: none;
      flex-shrink: 0;
    }

    .sc-icon svg {
      width: 13px;
      height: 13px;
    }

    /* Tables */
    .tw {
      overflow-x: auto;
      border-radius: 10px;
      border: 1px solid var(--border-color);
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
      text-align: left;
    }

    thead {
      background: var(--maroon);
      color: #fff;
    }

    th {
      padding: 10px 13px;
      font-weight: 600;
      font-size: 10px;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      color: rgba(255, 255, 255, 0.9);
      white-space: nowrap;
    }

    tbody tr {
      border-bottom: 1px solid var(--border-color);
      transition: 0.12s ease;
    }

    tbody tr:last-child {
      border-bottom: none;
    }

    tbody tr:hover {
      background: rgba(250, 248, 245, 0.8);
    }

    td {
      padding: 11px 13px;
      vertical-align: middle;
    }

    /* Progress Meter */
    .meter-bg {
      width: 100%;
      height: 7px;
      background: var(--border-color);
      border-radius: 10px;
      overflow: hidden;
      margin-top: 6px;
    }

    .meter-fill {
      height: 100%;
      border-radius: 10px;
      transition: width 0.4s ease;
    }

    /* Modal */
    .mo {
      position: fixed;
      inset: 0;
      background: rgba(74, 14, 23, 0.65);
      backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 200;
      padding: 20px;
    }

    .md {
      background: #fff;
      border-radius: 16px;
      width: 100%;
      max-width: 600px;
      box-shadow: var(--shadow-lg);
      overflow: hidden;
      animation: popIn 0.2s ease;
    }

    .md-h {
      padding: 16px 22px;
      background: var(--maroon);
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .md-title {
      font-size: 14.5px;
      font-weight: 700;
      color: var(--gold);
    }

    .md-b {
      padding: 22px;
      max-height: 78vh;
      overflow-y: auto;
    }

    .md-f {
      padding: 14px 22px;
      background: var(--bg-main);
      border-top: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
    }

    .form-group {
      margin-bottom: 15px;
    }

    .form-label {
      display: block;
      font-size: 11px;
      font-weight: 700;
      color: var(--maroon);
      margin-bottom: 5px;
    }

    .form-control {
      width: 100%;
      padding: 8px 11px;
      border: 1.5px solid var(--border-color);
      border-radius: 8px;
      font-size: 12px;
      transition: 0.15s ease;
    }

    .form-control:focus {
      outline: none;
      border-color: var(--maroon);
      box-shadow: 0 0 0 3px rgba(74, 14, 23, 0.08);
    }

    @keyframes popIn {
      from {
        transform: scale(0.95);
        opacity: 0;
      }

      to {
        transform: scale(1);
        opacity: 1;
      }
    }

    .print-only {
      display: none;
    }

    @media print {
      @page {
        size: A4 landscape;
        margin: 8mm;
      }

      * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
      }

      body {
        background: #ffffff !important;
        color: #000000 !important;
      }

      .sb,
      .topbar,
      .btn,
      .no-print,
      button {
        display: none !important;
      }

      .print-only {
        display: block !important;
      }

      .layout {
        display: block !important;
        height: auto !important;
        min-height: auto !important;
        margin-left: 0 !important;
        width: 100% !important;
      }

      .main-content {
        display: block !important;
        height: auto !important;
        padding: 0 !important;
        width: 100% !important;
      }

      .card {
        box-shadow: none !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        margin-bottom: 15px !important;
        border: 1px solid #e2e8f0 !important;
      }

      /* Memaksa menu / kartu grid-4 TETAP BERJAJAR KE SAMPING (4 Kolom Horizontal) saat dicetak! */
      .grid-4 {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
      }

      .grid-2 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
      }

      .grid-3 {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
      }

      .grid-3-1 {
        display: grid !important;
        grid-template-columns: 3fr 1fr !important;
        gap: 12px !important;
        width: 100% !important;
        margin-bottom: 15px !important;
      }

      .sc,
      .grid-4>.card,
      .grid-2>.card {
        padding: 10px 12px !important;
        margin-bottom: 0 !important;
        box-sizing: border-box !important;
      }

      .sc-val {
        font-size: 17px !important;
      }

      input[type="number"],
      input[type="text"],
      input[type="date"] {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        font-weight: 700 !important;
      }
    }

    /* Rupiah Formatting */
    .fmt-rupiah {
      display: inline-flex;
      justify-content: space-between;
      align-items: center;
    }

    td .fmt-rupiah {
      width: 100%;
    }

    .fmt-rp {
      padding-right: 4px;
      font-weight: inherit;
    }

    /* Mobile Responsiveness */
    .mobile-menu-btn {
      display: none;
      background: none;
      border: none;
      color: var(--maroon);
      cursor: pointer;
      padding: 5px;
    }

    .mobile-menu-btn svg {
      width: 24px;
      height: 24px;
    }

    .sb-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.5);
      z-index: 95;
      opacity: 0;
      transition: 0.3s ease;
    }

    /* RESPONSIVE DESIGN BREAKPOINTS */
    @media (max-width: 1024px) {
      .topbar {
        padding: 0 20px;
      }
      .main-content {
        padding: 20px 16px;
      }
      .grid-5,
      .grid-4 {
        grid-template-columns: repeat(2, 1fr);
      }
      .grid-3-1 {
        grid-template-columns: 1fr;
      }
      .grid-3 {
        grid-template-columns: repeat(2, 1fr);
      }
    }

    @media (max-width: 768px) {
      .sb {
        transform: translateX(-100%);
      }

      .sb.sb-active {
        transform: translateX(0);
      }

      .layout {
        margin-left: 0;
      }

      .mobile-menu-btn {
        display: block;
      }

      .sb-overlay.sb-active {
        display: block;
        opacity: 1;
      }

      .topbar {
        padding: 8px 12px;
        min-height: 56px;
        gap: 10px;
        flex-wrap: wrap;
      }

      .tb-title {
        font-size: 13.5px;
      }

      .tb-sub {
        display: none;
      }

      .main-content {
        padding: 12px 10px 90px 10px;
      }

      .grid-4,
      .grid-3,
      .grid-3-1,
      .grid-5,
      .grid-2 {
        grid-template-columns: 1fr;
      }

      .tb-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 6px;
      }

      .sc-val {
        font-size: 20px;
      }

      .floating-tools-container {
        bottom: 16px;
        right: 14px;
      }

      .floating-sq-btn {
        width: 42px;
        height: 42px;
      }

      .floating-sq-btn svg {
        width: 18px !important;
        height: 18px !important;
      }

      .calc-window,
      .kimi-window {
        width: calc(100vw - 28px) !important;
        left: 14px !important;
        right: 14px !important;
        bottom: 70px !important;
        max-height: 80vh !important;
      }

      .table-responsive,
      .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
      }

      .modal-card,
      .modal-box {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: 10px auto;
        padding: 14px;
        max-height: 90vh;
        overflow-y: auto;
      }
    }

    @media (max-width: 480px) {
      .tb-title {
        font-size: 12.5px;
      }
      .sc-val {
        font-size: 18px;
      }
      .btn {
        padding: 6px 10px;
        font-size: 11px;
      }
    }

    @media screen {
      .pv-print-area {
        display: none !important;
      }
    }

    /* ============================================================ */
    /* FLOATING BOTTOM-RIGHT WIDGETS (CALCULATOR & AI ASSISTANT)   */
    /* ============================================================ */
    .floating-tools-container {
      position: fixed;
      bottom: 24px;
      right: 24px;
      z-index: 1500;
      display: flex;
      flex-direction: column;
      gap: 12px;
      align-items: flex-end;
      pointer-events: none;
    }

    .floating-tools-container>* {
      pointer-events: auto;
    }

    .floating-btn-group {
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: flex-end;
    }

    .floating-sq-btn {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      background: linear-gradient(135deg, #4A0E17 0%, #2A060C 100%);
      border: 1.5px solid var(--gold);
      color: var(--gold);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      box-shadow: 0 6px 18px rgba(74, 14, 23, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      position: relative;
      outline: none;
    }

    .floating-sq-btn:hover {
      transform: translateY(-3px) scale(1.06);
      background: linear-gradient(135deg, #6B1724 0%, #4A0E17 100%);
      border-color: #ffffff;
      color: #ffffff;
      box-shadow: 0 10px 25px rgba(74, 14, 23, 0.5), 0 0 15px rgba(212, 175, 55, 0.4);
    }

    .floating-sq-btn.active {
      background: linear-gradient(135deg, #D4AF37 0%, #B89025 100%);
      color: #4A0E17;
      border-color: #ffffff;
      box-shadow: 0 0 22px rgba(212, 175, 55, 0.7);
      transform: scale(1.04);
    }

    .floating-sq-btn svg {
      width: 22px !important;
      height: 22px !important;
    }

    .floating-tooltip {
      position: absolute;
      right: 58px;
      top: 50%;
      transform: translateY(-50%);
      background: #0F172A;
      color: #ffffff;
      font-size: 11.5px;
      font-weight: 600;
      padding: 6px 12px;
      border-radius: 8px;
      white-space: nowrap;
      pointer-events: none;
      opacity: 0;
      visibility: hidden;
      transition: all 0.2s ease;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
      border: 1px solid rgba(212, 175, 55, 0.4);
      z-index: 10;
    }

    .floating-sq-btn:hover .floating-tooltip {
      opacity: 1;
      visibility: visible;
      transform: translateY(-50%) translateX(-4px);
    }

    .floating-badge-dot {
      position: absolute;
      top: -3px;
      right: -3px;
      width: 11px;
      height: 11px;
      border-radius: 50%;
      background: #10B981;
      border: 2px solid #ffffff;
      box-shadow: 0 0 8px rgba(16, 185, 129, 0.9);
      animation: pulseDot 2s infinite;
    }

    @keyframes pulseDot {

      0%,
      100% {
        transform: scale(1);
        opacity: 1;
      }

      50% {
        transform: scale(1.2);
        opacity: 0.8;
      }
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(10px) scale(0.92);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes scaleIn {
      from {
        opacity: 0;
        transform: scale(0.85);
      }

      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    /* Calculator Window */
    .calc-window {
      width: 330px;
      background: #ffffff;
      border-radius: 16px;
      box-shadow: 0 18px 45px rgba(74, 14, 23, 0.3), 0 4px 12px rgba(0, 0, 0, 0.1);
      border: 1.5px solid rgba(212, 175, 55, 0.5);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      margin-bottom: 8px;
    }

    .calc-header {
      background: linear-gradient(135deg, #4A0E17 0%, #2E070D 100%);
      color: #ffffff;
      padding: 12px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    }

    .calc-title {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--gold);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .calc-screen {
      background: #0F172A;
      margin: 12px 14px 8px 14px;
      padding: 12px 14px;
      border-radius: 10px;
      box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
      display: flex;
      flex-direction: column;
      text-align: right;
    }

    .calc-history-txt {
      font-size: 11.5px;
      color: #94A3B8;
      min-height: 16px;
      word-break: break-all;
    }

    .calc-main-val {
      font-size: 24px;
      font-weight: 800;
      color: #38BDF8;
      line-height: 1.2;
      margin-top: 4px;
      word-break: break-all;
      font-variant-numeric: tabular-nums;
    }

    .calc-fmt-rp {
      font-size: 11px;
      color: #E2E8F0;
      margin-top: 4px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-top: 1px dashed rgba(255, 255, 255, 0.15);
      padding-top: 4px;
    }

    .calc-presets {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      padding: 0 14px 8px 14px;
    }

    .calc-preset-btn {
      background: #FEF3C7;
      border: 1px solid #FCD34D;
      color: #92400E;
      font-size: 10px;
      font-weight: 700;
      padding: 5px 2px;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.15s ease;
      text-align: center;
    }

    .calc-preset-btn:hover {
      background: #FDE68A;
      transform: translateY(-1px);
    }

    .calc-keypad {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      padding: 0 14px 14px 14px;
    }

    .calc-btn {
      height: 38px;
      border-radius: 8px;
      border: 1px solid #E2E8F0;
      background: #F8FAFC;
      color: #1E293B;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
      user-select: none;
    }

    .calc-btn:hover {
      background: #E2E8F0;
      transform: translateY(-1px);
    }

    .calc-btn:active {
      transform: translateY(1px);
    }

    .calc-btn.op {
      background: #FFF7ED;
      border-color: #FFEDD5;
      color: #C2410C;
      font-weight: 700;
    }

    .calc-btn.op:hover {
      background: #FFEDD5;
    }

    .calc-btn.action {
      background: #FEE2E2;
      border-color: #FECACA;
      color: #B91C1C;
      font-weight: 700;
    }

    .calc-btn.action:hover {
      background: #FECACA;
    }

    .calc-btn.eq {
      background: linear-gradient(135deg, #4A0E17 0%, #6B1724 100%);
      color: #ffffff;
      border-color: #4A0E17;
      font-weight: 800;
      font-size: 16px;
    }

    .calc-btn.eq:hover {
      background: linear-gradient(135deg, #6B1724 0%, #8B1E30 100%);
      box-shadow: 0 4px 12px rgba(74, 14, 23, 0.3);
    }

    /* AI Assistant Window */
    .ai-window {
      width: 440px;
      max-width: calc(100vw - 36px);
      height: 580px;
      max-height: calc(100vh - 110px);
      background: #ffffff;
      border-radius: 16px;
      box-shadow: 0 20px 50px rgba(74, 14, 23, 0.32), 0 4px 14px rgba(0, 0, 0, 0.12);
      border: 1.5px solid rgba(212, 175, 55, 0.5);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
      margin-bottom: 8px;
    }

    .ai-header {
      background: linear-gradient(135deg, #4A0E17 0%, #1A0408 100%);
      color: #ffffff;
      padding: 12px 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    }

    .ai-title-wrap {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .ai-avatar {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: linear-gradient(135deg, #D4AF37 0%, #996515 100%);
      color: #4A0E17;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 14px;
      box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
    }

    .ai-title-text {
      font-size: 13.5px;
      font-weight: 700;
      color: var(--gold);
      line-height: 1.2;
    }

    .ai-subtitle-text {
      font-size: 10.5px;
      color: #cbd5e1;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .ai-body {
      flex: 1;
      padding: 14px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 12px;
      background: #FDFBF7;
    }

    .ai-msg {
      display: flex;
      flex-direction: column;
      max-width: 88%;
      animation: popIn 0.15s ease;
    }

    .ai-msg.user {
      align-self: flex-end;
    }

    .ai-msg.assistant {
      align-self: flex-start;
    }

    .ai-msg-bubble {
      padding: 10px 14px;
      border-radius: 12px;
      font-size: 12.5px;
      line-height: 1.55;
      position: relative;
      word-break: break-word;
    }

    .ai-msg.user .ai-msg-bubble {
      background: linear-gradient(135deg, #4A0E17 0%, #6B1724 100%);
      color: #ffffff;
      border-bottom-right-radius: 2px;
      box-shadow: 0 2px 8px rgba(74, 14, 23, 0.2);
    }

    .ai-msg.assistant .ai-msg-bubble {
      background: #ffffff;
      color: #1E293B;
      border: 1px solid #E2E8F0;
      border-bottom-left-radius: 2px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }

    .ai-msg-time {
      font-size: 9.5px;
      color: #94A3B8;
      margin-top: 3px;
      padding: 0 4px;
    }

    .ai-msg.user .ai-msg-time {
      text-align: right;
    }

    .ai-suggestions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      padding: 4px 0;
    }

    .ai-chip {
      background: #ffffff;
      border: 1px solid #E5E7EB;
      color: #4A0E17;
      font-size: 11px;
      font-weight: 600;
      padding: 5px 10px;
      border-radius: 20px;
      cursor: pointer;
      transition: all 0.15s ease;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    }

    .ai-chip:hover {
      background: #FEF3C7;
      border-color: #F59E0B;
      color: #92400E;
      transform: translateY(-1px);
    }

    .ai-footer {
      padding: 10px 14px;
      background: #ffffff;
      border-top: 1px solid #E5E7EB;
      display: flex;
      gap: 8px;
      align-items: flex-end;
    }

    .ai-input {
      flex: 1;
      min-height: 38px;
      max-height: 100px;
      border: 1.5px solid #CBD5E1;
      border-radius: 10px;
      padding: 8px 12px;
      font-size: 12.5px;
      font-family: inherit;
      resize: none;
      outline: none;
      transition: border-color 0.2s ease;
    }

    .ai-input:focus {
      border-color: var(--maroon);
      box-shadow: 0 0 0 3px rgba(74, 14, 23, 0.08);
    }

    .ai-send-btn {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: linear-gradient(135deg, #D4AF37 0%, #B89025 100%);
      color: #4A0E17;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.18s ease;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(212, 175, 55, 0.35);
    }

    .ai-send-btn:hover:not(:disabled) {
      background: linear-gradient(135deg, #E5C158 0%, #D4AF37 100%);
      transform: scale(1.05);
    }

    .ai-send-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .ai-typing-indicator {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 8px 12px;
    }

    .ai-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--maroon);
      animation: bounce 1.4s infinite ease-in-out both;
    }

    .ai-dot:nth-child(1) {
      animation-delay: -0.32s;
    }

    .ai-dot:nth-child(2) {
      animation-delay: -0.16s;
    }

    @keyframes bounce {

      0%,
      80%,
      100% {
        transform: scale(0);
      }

      40% {
        transform: scale(1);
      }
    }

    /* Floating Vertical Zoom Flyout */
    .zoom-vertical-flyout {
      position: absolute;
      bottom: 56px;
      right: 0;
      width: 48px;
      background: rgba(255, 255, 255, 0.96);
      backdrop-filter: blur(12px);
      border: 1.5px solid var(--gold);
      border-radius: 14px;
      padding: 8px 4px;
      box-shadow: 0 10px 25px rgba(74, 14, 23, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      z-index: 1510;
      animation: flyoutSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes flyoutSlideUp {
      from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
      }

      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .zoom-vert-btn {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: 1.5px solid var(--maroon);
      background: #ffffff;
      color: var(--maroon);
      font-size: 14px;
      font-weight: 800;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.15s ease;
      outline: none;
      padding: 0;
      line-height: 1;
    }

    .zoom-vert-btn:hover {
      background: var(--maroon);
      color: #ffffff;
      transform: scale(1.08);
    }

    .zoom-vert-badge {
      font-size: 10px;
      font-weight: 800;
      color: var(--maroon);
      text-align: center;
    }

    .zoom-vert-slider-wrap {
      height: 100px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 4px 0;
    }

    .zoom-vert-slider {
      -webkit-appearance: slider-vertical;
      writing-mode: bt-lr;
      width: 8px;
      height: 95px;
      accent-color: var(--maroon);
      cursor: pointer;
    }

    .zoom-vert-reset-btn {
      background: rgba(74, 14, 23, 0.08);
      border: 1px solid rgba(74, 14, 23, 0.2);
      color: var(--maroon);
      font-size: 9px;
      font-weight: 700;
      padding: 2px 4px;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.15s ease;
      margin-top: 2px;
    }

    .zoom-vert-reset-btn:hover {
      background: var(--maroon);
      color: #ffffff;
    }
