﻿:root {
      --bg: #06111d;
      --panel: #0b1a2a;
      --panel-2: #0d2135;
      --line: rgba(148, 163, 184, .18);
      --text: #f4f7fb;
      --muted: #9aa7b8;
      --green: #29e85d;
      --red: #ff4f5e;
      --cyan: #28e8f2;
      --purple: #9a55ff;
      --yellow: #ffd24a;
      --blue: #5c8fe8;
      --shadow: 0 22px 50px rgba(0, 0, 0, .25);
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      background:
        radial-gradient(circle at top right, rgba(154, 85, 255, .13), transparent 32rem),
        radial-gradient(circle at top left, rgba(40, 232, 242, .08), transparent 26rem),
        var(--bg);
      color: var(--text);
      font-family: Inter, Segoe UI, Arial, sans-serif;
      font-size: 14px;
      letter-spacing: 0;
    }

    button,
    input,
    select {
      font: inherit;
    }

    button {
      cursor: pointer;
    }

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 260px 1fr;
    }

    .sidebar {
      border-right: 1px solid var(--line);
      background: rgba(5, 15, 27, .88);
      padding: 22px 16px;
      display: flex;
      flex-direction: column;
      gap: 24px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-height: 52px;
    }

    .logo {
      width: 48px;
      height: 48px;
      display: grid;
      place-items: center;
      border-radius: 14px;
      background: linear-gradient(135deg, #34e4ff, #a34cff 55%, #ff65d8);
      color: white;
      font-size: 27px;
      font-weight: 900;
      box-shadow: 0 12px 28px rgba(154, 85, 255, .35);
    }

    .brand strong {
      display: block;
      font-size: 20px;
      letter-spacing: 1px;
    }

    .brand span {
      color: #b965ff;
      font-size: 13px;
      font-weight: 800;
      letter-spacing: 4px;
    }

    .nav {
      display: grid;
      gap: 8px;
    }

    .nav button {
      min-height: 46px;
      border: 1px solid transparent;
      border-radius: 8px;
      color: #dfe8f5;
      background: transparent;
      display: grid;
      grid-template-columns: 28px 1fr;
      align-items: center;
      gap: 8px;
      padding: 9px 12px;
      text-align: left;
    }

    .nav button.active,
    .nav button:hover {
      color: white;
      background: linear-gradient(135deg, #7f44ff, #a44fff);
      box-shadow: 0 12px 24px rgba(127, 68, 255, .24);
    }

    .sidebar-section {
      border-top: 1px solid var(--line);
      padding-top: 18px;
    }

    .sidebar-label {
      color: var(--muted);
      font-size: 12px;
      text-transform: uppercase;
      margin: 0 0 10px;
    }

    .pill-list {
      display: grid;
      gap: 8px;
      max-height: 320px;
      overflow: auto;
      padding-right: 3px;
    }

    .pill-list button {
      min-height: 34px;
      border: 1px solid rgba(148, 163, 184, .14);
      border-radius: 8px;
      background: rgba(255, 255, 255, .03);
      color: #dce6f4;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 7px 9px;
      text-align: left;
    }

    .pill-list button.active {
      border-color: rgba(154, 85, 255, .7);
      background: rgba(154, 85, 255, .18);
    }

    .sidebar-foot {
      margin-top: auto;
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 13px;
      background: rgba(255, 255, 255, .03);
      color: var(--muted);
      line-height: 1.4;
      font-size: 12px;
    }

    main {
      min-width: 0;
    }

    .topbar {
      min-height: 76px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 18px;
      padding: 0 24px;
      background: rgba(6, 17, 29, .72);
      backdrop-filter: blur(16px);
    }

    h1,
    h2,
    h3,
    p {
      margin-top: 0;
    }

    h1 {
      margin-bottom: 3px;
      font-size: 24px;
    }

    .subtitle {
      margin: 0;
      color: var(--muted);
    }

    .top-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .button {
      min-height: 38px;
      border: 1px solid rgba(148, 163, 184, .24);
      border-radius: 8px;
      background: rgba(255, 255, 255, .05);
      color: var(--text);
      padding: 8px 12px;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .button:hover {
      border-color: rgba(154, 85, 255, .78);
    }

    .button.primary {
      border-color: transparent;
      background: linear-gradient(135deg, #7b47ff, #a64fff);
      box-shadow: 0 12px 28px rgba(127, 68, 255, .22);
    }

    .button.green {
      border-color: rgba(41, 232, 93, .3);
      background: rgba(41, 232, 93, .12);
      color: #a8ffbd;
    }

    .button.red {
      border-color: rgba(255, 79, 94, .32);
      background: rgba(255, 79, 94, .11);
      color: #ffb2b9;
    }

    .content {
      padding: 18px 22px;
      display: grid;
      gap: 18px;
    }

    .metrics {
      display: grid;
      grid-template-columns: repeat(5, minmax(155px, 1fr));
      gap: 14px;
    }

    .metric {
      min-height: 112px;
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 12px;
      background: linear-gradient(145deg, rgba(17, 37, 58, .94), rgba(9, 23, 38, .94));
      box-shadow: var(--shadow);
      padding: 16px;
      display: grid;
      grid-template-columns: 58px 1fr;
      align-items: center;
      gap: 14px;
      color: var(--text);
      text-align: left;
    }

    .metric:hover {
      border-color: rgba(154, 85, 255, .62);
      transform: translateY(-1px);
    }

    .metric-icon {
      width: 58px;
      height: 58px;
      border-radius: 14px;
      display: grid;
      place-items: center;
      font-size: 28px;
      font-weight: 900;
    }

    .metric small {
      display: block;
      color: #d5dde9;
      text-transform: uppercase;
      font-size: 12px;
      margin-bottom: 5px;
    }

    .metric strong {
      display: block;
      font-size: 28px;
      line-height: 1;
    }

    .metric span {
      display: block;
      color: var(--muted);
      margin-top: 7px;
      font-size: 12px;
    }

    .green-bg {
      color: #9ffdb4;
      background: linear-gradient(135deg, rgba(41, 232, 93, .15), rgba(41, 232, 93, .34));
      border: 1px solid rgba(41, 232, 93, .35);
    }

    .red-bg {
      color: #ff9aa5;
      background: linear-gradient(135deg, rgba(255, 79, 94, .15), rgba(255, 79, 94, .32));
      border: 1px solid rgba(255, 79, 94, .35);
    }

    .cyan-bg {
      color: #95faff;
      background: linear-gradient(135deg, rgba(40, 232, 242, .15), rgba(40, 232, 242, .32));
      border: 1px solid rgba(40, 232, 242, .35);
    }

    .purple-bg {
      color: #d7bdff;
      background: linear-gradient(135deg, rgba(154, 85, 255, .18), rgba(154, 85, 255, .35));
      border: 1px solid rgba(154, 85, 255, .35);
    }

    .yellow-bg {
      color: #ffe898;
      background: linear-gradient(135deg, rgba(255, 210, 74, .15), rgba(255, 210, 74, .32));
      border: 1px solid rgba(255, 210, 74, .34);
    }

    .dashboard-grid {
      display: grid;
      grid-template-columns: minmax(520px, 1.35fr) minmax(320px, .65fr);
      gap: 14px;
      align-items: start;
    }

    .panel {
      border: 1px solid var(--line);
      border-radius: 12px;
      background: linear-gradient(145deg, rgba(12, 30, 49, .94), rgba(8, 22, 36, .94));
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .panel-head {
      min-height: 58px;
      padding: 13px 16px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .panel-head h2 {
      margin: 0;
      font-size: 15px;
      text-transform: uppercase;
    }

    .tools {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    input,
    select {
      min-height: 38px;
      border: 1px solid rgba(148, 163, 184, .24);
      border-radius: 8px;
      color: var(--text);
      background: rgba(4, 14, 25, .8);
      padding: 8px 10px;
      outline: none;
    }

    input:focus,
    select:focus {
      border-color: rgba(154, 85, 255, .8);
      box-shadow: 0 0 0 3px rgba(154, 85, 255, .12);
    }

    .table-wrap {
      width: 100%;
      overflow: auto;
    }

    table {
      width: 100%;
      border-collapse: collapse;
    }

    th,
    td {
      border-bottom: 1px solid rgba(148, 163, 184, .12);
      padding: 11px 14px;
      text-align: left;
      white-space: nowrap;
    }

    th {
      color: #c9d4e4;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      background: rgba(6, 17, 29, .35);
    }

    td {
      color: #e8eef7;
    }

    tr:hover td {
      background: rgba(255, 255, 255, .025);
    }

    .product-cell {
      display: flex;
      align-items: center;
      gap: 11px;
      font-weight: 700;
    }

    .product-logo {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      color: white;
      font-weight: 900;
      background: linear-gradient(135deg, #2563eb, #9333ea);
    }

    .count {
      min-width: 30px;
      display: inline-grid;
      place-items: center;
      border-radius: 6px;
      padding: 4px 7px;
      font-weight: 800;
    }

    .count.green {
      color: #a8ffbd;
      background: rgba(41, 232, 93, .18);
    }

    .count.red {
      color: #ffabb4;
      background: rgba(255, 79, 94, .2);
    }

    .count.cyan {
      color: #9afaff;
      background: rgba(40, 232, 242, .18);
    }

    .count.purple {
      color: #d5b8ff;
      background: rgba(154, 85, 255, .2);
    }

    .inventory-board {
      padding: 14px;
    }

    .product-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 12px;
    }

    .inventory-card {
      border: 1px solid rgba(148, 163, 184, .15);
      border-radius: 12px;
      background: rgba(255, 255, 255, .035);
      color: var(--text);
      padding: 13px;
      text-align: left;
      display: grid;
      gap: 12px;
      min-height: 154px;
    }

    .inventory-card:hover {
      border-color: rgba(154, 85, 255, .58);
      background: rgba(154, 85, 255, .08);
    }

    .inventory-card-top {
      display: grid;
      grid-template-columns: 42px 1fr auto;
      align-items: center;
      gap: 10px;
    }

    .inventory-card .product-logo {
      width: 42px;
      height: 42px;
      border-radius: 12px;
      font-size: 17px;
    }

    .product-name {
      display: block;
      font-weight: 800;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .product-meta {
      display: block;
      color: var(--muted);
      font-size: 12px;
      margin-top: 3px;
    }

    .license-total {
      min-width: 48px;
      border: 1px solid rgba(255, 210, 74, .28);
      border-radius: 10px;
      color: var(--yellow);
      background: rgba(255, 210, 74, .09);
      text-align: center;
      padding: 7px 8px;
      font-weight: 900;
    }

    .license-total span {
      display: block;
      color: var(--muted);
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      margin-bottom: 2px;
    }

    .inventory-stats {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 7px;
    }

    .inventory-stat {
      min-width: 0;
      border: 1px solid rgba(148, 163, 184, .12);
      border-radius: 9px;
      background: rgba(4, 14, 25, .44);
      padding: 8px 6px;
      text-align: center;
    }

    .inventory-stat span {
      display: block;
      color: var(--muted);
      font-size: 10px;
      text-transform: uppercase;
      margin-bottom: 5px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .inventory-stat strong {
      font-size: 18px;
      line-height: 1;
    }

    .stock-bar {
      display: grid;
      grid-template-columns: var(--sold, 1fr) var(--expired, 1fr) var(--available, 1fr) var(--store, 1fr);
      height: 7px;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(255, 255, 255, .07);
    }

    .stock-bar i:nth-child(1) {
      background: var(--green);
    }

    .stock-bar i:nth-child(2) {
      background: var(--red);
    }

    .stock-bar i:nth-child(3) {
      background: var(--cyan);
    }

    .stock-bar i:nth-child(4) {
      background: var(--purple);
    }

    .mini-summary {
      display: grid;
      gap: 12px;
      padding: 14px;
    }

    .mini-card {
      border: 1px solid var(--line);
      border-radius: 10px;
      padding: 13px;
      background: rgba(255, 255, 255, .035);
      color: var(--text);
      text-align: left;
      width: 100%;
    }

    .mini-card:hover {
      border-color: rgba(154, 85, 255, .62);
      background: rgba(154, 85, 255, .08);
    }

    .mini-card span {
      display: block;
      color: var(--muted);
      text-transform: uppercase;
      font-size: 12px;
      margin-bottom: 8px;
    }

    .mini-card strong {
      font-size: 28px;
    }

    .chart-card {
      border: 1px solid rgba(148, 163, 184, .15);
      border-radius: 12px;
      background: rgba(255, 255, 255, .035);
      padding: 14px;
    }

    .donut-wrap {
      display: grid;
      grid-template-columns: 148px 1fr;
      align-items: center;
      gap: 14px;
    }

    .donut {
      width: 138px;
      aspect-ratio: 1;
      border-radius: 50%;
      background: conic-gradient(
        var(--green) 0 var(--soldDeg),
        var(--red) var(--soldDeg) var(--expiredDeg),
        var(--cyan) var(--expiredDeg) var(--availableDeg),
        var(--purple) var(--availableDeg) 360deg
      );
      display: grid;
      place-items: center;
      box-shadow: inset 0 0 28px rgba(0, 0, 0, .28), 0 16px 35px rgba(0, 0, 0, .2);
    }

    .donut-center {
      width: 82px;
      aspect-ratio: 1;
      border-radius: 50%;
      background: #0b1a2a;
      display: grid;
      place-items: center;
      text-align: center;
      border: 1px solid rgba(148, 163, 184, .16);
    }

    .donut-center strong {
      display: block;
      font-size: 22px;
      line-height: 1;
    }

    .donut-center span {
      display: block;
      color: var(--muted);
      font-size: 11px;
      margin-top: 4px;
    }

    .chart-legend {
      display: grid;
      gap: 9px;
    }

    .legend-item {
      width: 100%;
      min-height: 32px;
      border: 0;
      background: transparent;
      color: var(--text);
      display: grid;
      grid-template-columns: 10px 1fr auto;
      align-items: center;
      gap: 8px;
      padding: 4px;
      text-align: left;
      border-radius: 7px;
    }

    .legend-item:hover {
      background: rgba(255, 255, 255, .045);
    }

    .legend-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--dot);
    }

    .legend-item span {
      color: #d9e2ef;
      font-size: 12px;
    }

    .legend-item strong {
      font-size: 12px;
      color: var(--muted);
    }

    .side-block {
      display: grid;
      gap: 10px;
    }

    .side-block h3 {
      margin: 0;
      font-size: 13px;
      text-transform: uppercase;
      color: #e8eef7;
    }

    .category-row,
    .alert-row {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      align-items: center;
      color: #d8e1ef;
      font-size: 12px;
    }

    .category-bar {
      grid-column: 1 / -1;
      height: 5px;
      border-radius: 999px;
      background: rgba(255, 255, 255, .07);
      overflow: hidden;
    }

    .category-bar i {
      display: block;
      width: var(--width);
      height: 100%;
      background: var(--bar);
    }

    .alert-row {
      border: 1px solid rgba(148, 163, 184, .12);
      border-radius: 9px;
      padding: 9px;
      background: rgba(4, 14, 25, .34);
    }

    .alert-row strong {
      color: var(--alert);
    }

    .accounts-layout {
      display: grid;
      grid-template-columns: 360px 1fr;
      gap: 14px;
      align-items: start;
    }

    .account-list {
      display: grid;
      gap: 10px;
      padding: 14px;
      max-height: calc(100vh - 240px);
      overflow: auto;
    }

    .account-card {
      width: 100%;
      border: 1px solid rgba(148, 163, 184, .16);
      border-radius: 10px;
      background: rgba(255, 255, 255, .035);
      color: var(--text);
      text-align: left;
      padding: 12px;
      display: grid;
      gap: 7px;
    }

    .account-card.active {
      border-color: rgba(154, 85, 255, .82);
      background: rgba(154, 85, 255, .12);
    }

    .account-card strong {
      overflow-wrap: anywhere;
    }

    .account-card span {
      color: var(--muted);
      font-size: 12px;
    }

    .form {
      padding: 16px;
      display: grid;
      gap: 14px;
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    label {
      display: grid;
      gap: 6px;
      color: #c9d4e4;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    label input,
    label select {
      width: 100%;
    }

    .profiles {
      display: grid;
      gap: 10px;
    }

    .profile-row {
      border: 1px solid rgba(148, 163, 184, .15);
      border-radius: 10px;
      background: rgba(255, 255, 255, .03);
      padding: 10px;
      display: grid;
      grid-template-columns: 64px minmax(180px, 1fr) 96px 130px 96px 130px 150px;
      gap: 8px;
      align-items: end;
    }

    .profile-row label {
      min-width: 0;
    }

    .profile-row input,
    .profile-row select {
      min-width: 0;
      padding-left: 8px;
      padding-right: 8px;
    }

    .hidden {
      display: none !important;
    }

    .login-screen {
      min-height: 100vh;
      display: grid;
      place-items: center;
      padding: 22px;
      background:
        radial-gradient(circle at 70% 20%, rgba(154, 85, 255, .22), transparent 28rem),
        radial-gradient(circle at 20% 10%, rgba(40, 232, 242, .12), transparent 24rem),
        var(--bg);
    }

    .login-box {
      width: min(430px, 100%);
      border: 1px solid var(--line);
      border-radius: 18px;
      background: linear-gradient(145deg, rgba(12, 30, 49, .96), rgba(8, 22, 36, .98));
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .login-brand {
      padding: 24px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .login-brand h1 {
      margin: 0;
      font-size: 22px;
    }

    .login-brand p {
      margin: 4px 0 0;
      color: var(--muted);
    }

    .login-form {
      padding: 20px 24px 24px;
      display: grid;
      gap: 14px;
    }

    .login-error {
      min-height: 20px;
      color: #ffb2b9;
      font-size: 13px;
    }

    .status-grid {
      padding: 14px;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 12px;
    }

    .status-card {
      border: 1px solid rgba(148, 163, 184, .15);
      border-radius: 12px;
      background: rgba(255, 255, 255, .035);
      padding: 13px;
      display: grid;
      gap: 10px;
    }

    .status-card-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .status-card strong {
      overflow-wrap: anywhere;
    }

    .status-card span,
    .status-card small {
      color: var(--muted);
    }

    .empty {
      padding: 18px;
      color: var(--muted);
      line-height: 1.5;
    }

    .modal {
      position: fixed;
      inset: 0;
      z-index: 10;
      display: none;
      place-items: center;
      padding: 20px;
      background: rgba(0, 0, 0, .58);
    }

    .modal.open {
      display: grid;
    }

    .modal-box {
      width: min(560px, 100%);
      border: 1px solid var(--line);
      border-radius: 14px;
      background: #0b1a2a;
      box-shadow: var(--shadow);
      overflow: hidden;
    }

    .modal-body {
      padding: 16px;
      display: grid;
      gap: 13px;
    }

    .modal-actions {
      border-top: 1px solid var(--line);
      padding: 12px 16px;
      display: flex;
      justify-content: flex-end;
      gap: 10px;
    }

    .file-input {
      display: none;
    }

    @media (max-width: 1180px) {
      .app {
        grid-template-columns: 1fr;
      }

      .sidebar {
        position: static;
      }

      .pill-list,
      .account-list {
        max-height: none;
      }

      .dashboard-grid,
      .accounts-layout {
        grid-template-columns: 1fr;
      }

      .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }

    @media (max-width: 760px) {
      .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
      }

      .content {
        padding: 14px;
      }

      .metrics,
      .mini-summary,
      .form-grid {
        grid-template-columns: 1fr;
      }

      .profile-row {
        grid-template-columns: 1fr;
      }
    }
