
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
    }

    :root {
      --dark: #1f2e2b;
      --sand: #d9cdc0;
      --clay: #b7a89a;
      --ivory: #f3efe9;
      --accent: #c17b5b;
      --muted: #8b7b6b;
      --line: rgba(0, 0, 0, 0.08);
      --shadow: 0 8px 24px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.02);
      --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.09), 0 4px 10px rgba(0, 0, 0, 0.04);
      --shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.15);
    }

    html,
    body {
      height: 100%;
    }

    body {
      background: #f7f5f2;
      color: #1e1e1e;
      min-height: 100vh;
      font-family: 'Inter', system-ui, sans-serif;
    }

    /* ============================================================
     LOGIN SCREEN
  ============================================================ */
    #loginScreen {
      position: fixed;
      inset: 0;
      z-index: 5000;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      overflow-y: auto;
      background: linear-gradient(135deg, #1f2e2b 0%, #2c3d39 50%, #1a2624 100%);
    }

    #loginScreen::before {
      content: '';
      position: absolute;
      inset: 0;
      background-image:
        radial-gradient(circle at 15% 20%, rgba(217, 205, 192, .08) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(193, 123, 91, .10) 0%, transparent 45%);
      pointer-events: none;
    }

    #loginScreen.hide {
      display: none;
    }

    .login-card {
      position: relative;
      z-index: 1;
      width: 100%;
      max-width: 460px;
      background: #fff;
      border-radius: 24px;
      padding: 44px 40px 38px;
      box-shadow: var(--shadow-lg);
      animation: cardIn .4s cubic-bezier(.2, .8, .2, 1);
    }

    @keyframes cardIn {
      from {
        opacity: 0;
        transform: translateY(24px)
      }

      to {
        opacity: 1;
        transform: translateY(0)
      }
    }

    .login-brand {
      text-align: center;
      margin-bottom: 30px;
    }

    .login-brand .logo {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      font-size: 1.35rem;
      font-weight: 600;
      color: var(--dark);
      letter-spacing: -0.02em;
      margin-bottom: 8px;
    }

    .login-brand .logo img {
     height: 60px;
    }

    .login-brand p {
      color: var(--muted);
      font-size: .9rem;
    }

    .role-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      background: var(--ivory);
      padding: 6px;
      border-radius: 14px;
      margin-bottom: 26px;
      position: relative;
    }

    .role-tabs .indicator {
      position: absolute;
      top: 6px;
      left: 6px;
      width: calc(50% - 6px);
      height: calc(100% - 12px);
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
      transition: transform .3s cubic-bezier(.2, .8, .2, 1);
    }

    .role-tabs.team .indicator {
      transform: translateX(100%);
    }

    .role-tab {
      position: relative;
      z-index: 1;
      padding: 12px 10px;
      border: none;
      background: transparent;
      font-family: inherit;
      font-size: .9rem;
      font-weight: 600;
      color: var(--muted);
      cursor: pointer;
      border-radius: 10px;
      transition: color .25s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .role-tab.active {
      color: var(--dark);
    }

    .role-tab i {
      font-size: .95rem;
    }

    .login-form .form-group {
      margin-bottom: 16px;
    }

    .login-form label {
      display: block;
      font-size: .78rem;
      font-weight: 600;
      color: var(--muted);
      margin-bottom: 7px;
      text-transform: uppercase;
      letter-spacing: .5px;
    }

    .input-wrap {
      position: relative;
      display: flex;
      align-items: center;
    }

    .input-wrap>i {
      position: absolute;
      left: 16px;
      color: var(--muted);
      font-size: .9rem;
      pointer-events: none;
      transition: color .2s;
      z-index: 1;
    }

    .input-wrap input {
      width: 100%;
      padding: 13px 16px 13px 44px;
      border: 1px solid var(--line);
      border-radius: 12px;
      font-size: .92rem;
      font-family: inherit;
      background: #faf8f5;
      transition: .2s;
      color: var(--dark);
    }

    .input-wrap input:focus {
      outline: none;
      border-color: var(--accent);
      background: #fff;
      box-shadow: 0 0 0 4px rgba(193, 123, 91, .12);
    }

    .input-wrap:focus-within>i {
      color: var(--accent);
    }

    .login-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin: 6px 0 22px;
      font-size: .82rem;
    }

    .login-row label {
      display: flex;
      align-items: center;
      gap: 7px;
      color: var(--muted);
      cursor: pointer;
      user-select: none;
      text-transform: none;
      letter-spacing: 0;
      font-weight: 500;
      margin: 0;
    }

    .login-row label input {
      accent-color: var(--accent);
      cursor: pointer;
    }

    .login-row a {
      color: var(--accent);
      text-decoration: none;
      font-weight: 500;
    }

    .login-row a:hover {
      text-decoration: underline;
    }

    .login-submit {
      width: 100%;
      padding: 14px;
      background: var(--dark);
      color: #fff;
      border: none;
      border-radius: 12px;
      font-family: inherit;
      font-size: .95rem;
      font-weight: 600;
      cursor: pointer;
      transition: .2s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }

    .login-submit:hover {
      background: #162220;
      transform: translateY(-1px);
      box-shadow: 0 8px 20px rgba(31, 46, 43, .25);
    }

    .login-submit:active {
      transform: translateY(0);
    }

    .login-submit:disabled {
      opacity: .7;
      cursor: not-allowed;
      transform: none;
    }

    .login-error {
      background: #fae3e3;
      color: #a53535;
      padding: 11px 14px;
      border-radius: 10px;
      font-size: .82rem;
      font-weight: 500;
      margin-bottom: 16px;
      display: none;
      align-items: center;
      gap: 8px;
    }

    .login-error.show {
      display: flex;
      animation: shake .35s;
    }

    @keyframes shake {

      0%,
      100% {
        transform: translateX(0)
      }

      25% {
        transform: translateX(-6px)
      }

      75% {
        transform: translateX(6px)
      }
    }

    .demo-hint {
      margin-top: 22px;
      padding-top: 20px;
      border-top: 1px solid var(--line);
      font-size: .78rem;
      color: var(--muted);
      text-align: center;
      line-height: 1.7;
    }

    .demo-hint strong {
      color: var(--dark);
      font-weight: 600;
      display: block;
      margin-bottom: 6px;
    }

    .demo-hint code {
      background: var(--ivory);
      padding: 2px 7px;
      border-radius: 6px;
      font-family: ui-monospace, monospace;
      font-size: .75rem;
      color: var(--accent);
      font-weight: 600;
    }

    /* ============================================================
     APP
  ============================================================ */
    #app {
      display: none;
      flex-direction: column;
      min-height: 100vh;
    }

    #app.show {
      display: flex;
    }

    .topbar {
      background: var(--dark);
      color: #fff;
      padding: 14px 0;
      position: sticky;
      top: 0;
      z-index: 50;
    }

    .topbar .inner {
      max-width: 1500px;
      margin: 0 auto;
      padding: 0 28px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 12px;
    }

    .brand {
      font-size: 1.25rem;
      font-weight: 600;
      letter-spacing: -0.02em;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .brand img {
      height: 60px;
    }

    .topbar-user {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    .who {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 6px 14px 6px 6px;
      border-radius: 40px;
      background: rgba(255, 255, 255, .08);
      font-size: .85rem;
    }

    .mini-av {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--clay), var(--sand));
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 700;
      font-size: .8rem;
    }

    .who span {
      color: #e8e2d8;
    }

    .who strong {
      color: #fff;
      font-weight: 600;
    }

    .logout-btn {
      background: transparent;
      border: 1px solid rgba(255, 255, 255, .25);
      color: #fff;
      padding: 8px 16px;
      border-radius: 40px;
      font-size: .82rem;
      font-weight: 500;
      cursor: pointer;
      transition: .2s;
      display: flex;
      align-items: center;
      gap: 7px;
      font-family: inherit;
    }

    .logout-btn:hover {
      background: rgba(220, 80, 80, .2);
      border-color: rgba(220, 80, 80, .5);
    }

    .wrapper {
      flex: 1;
      display: flex;
      max-width: 1500px;
      margin: 0 auto;
      width: 100%;
    }

    .sidebar {
      width: 270px;
      background: #fff;
      border-right: 1px solid var(--line);
      padding: 28px 18px;
      display: flex;
      flex-direction: column;
      position: sticky;
      top: 60px;
      height: calc(100vh - 60px);
      overflow-y: auto;
    }

    .sidebar h5 {
      font-size: .7rem;
      text-transform: uppercase;
      letter-spacing: 1.2px;
      color: var(--muted);
      margin: 0 0 14px 14px;
      font-weight: 700;
    }

    .menu {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .menu li {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 13px 18px;
      border-radius: 12px;
      font-weight: 500;
      font-size: .94rem;
      color: #2c2c2c;
      cursor: pointer;
      transition: .15s;
    }

    .menu li i {
      width: 20px;
      font-size: 1.05rem;
      color: #7f6e5f;
      text-align: center;
    }

    .menu li:hover {
      background: #faf7f4;
    }

    .menu li.active {
      background: var(--ivory);
      color: var(--dark);
      font-weight: 600;
    }

    .menu li.active i {
      color: var(--accent);
    }

    .menu li .badge {
      margin-left: auto;
      background: var(--accent);
      color: #fff;
      font-size: .7rem;
      padding: 2px 9px;
      border-radius: 20px;
      font-weight: 700;
    }

    .menu li .count {
      margin-left: auto;
      background: #efe9e3;
      color: #6b5d51;
      font-size: .7rem;
      padding: 2px 9px;
      border-radius: 20px;
      font-weight: 600;
    }

    .sidebar-user {
      margin-top: auto;
      padding-top: 20px;
      border-top: 1px solid var(--line);
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .avatar {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      flex-shrink: 0;
      background: linear-gradient(135deg, var(--clay), var(--sand));
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-weight: 700;
      font-size: 1rem;
    }

    .sidebar-user .info p {
      font-weight: 600;
      font-size: .88rem;
    }

    .sidebar-user .info span {
      font-size: .74rem;
      color: var(--muted);
    }

    .content {
      flex: 1;
      padding: 34px 38px;
      overflow-y: auto;
      min-width: 0;
    }

    .page-title {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 20px;
      flex-wrap: wrap;
      margin-bottom: 28px;
    }

    .page-title h1 {
      font-size: 1.7rem;
      font-weight: 600;
      letter-spacing: -0.02em;
      color: var(--dark);
    }

    .page-title p {
      color: var(--muted);
      font-size: .92rem;
      margin-top: 6px;
    }

    .card {
      background: #fff;
      border-radius: 18px;
      padding: 24px 26px;
      box-shadow: var(--shadow);
      border: 1px solid var(--line);
      margin-bottom: 22px;
    }

    .card-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 18px;
      gap: 14px;
      flex-wrap: wrap;
    }

    .card-head h3 {
      font-size: 1.1rem;
      font-weight: 600;
      color: var(--dark);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .card-head h3 i {
      color: var(--accent);
      font-size: 1rem;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 16px;
      margin-bottom: 26px;
    }

    .stat {
      background: #fff;
      border-radius: 16px;
      padding: 22px 24px;
      box-shadow: var(--shadow);
      border: 1px solid var(--line);
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: .25s;
    }

    .stat:hover {
      transform: translateY(-2px);
      box-shadow: var(--shadow-hover);
    }

    .stat .num {
      font-size: 1.9rem;
      font-weight: 700;
      color: var(--dark);
      letter-spacing: -0.03em;
    }

    .stat .lbl {
      font-size: .8rem;
      color: var(--muted);
      margin-top: 4px;
      font-weight: 500;
    }

    .stat .icon {
      width: 52px;
      height: 52px;
      border-radius: 14px;
      background: var(--ivory);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--accent);
      font-size: 1.3rem;
    }

    .btn {
      background: var(--dark);
      color: #fff;
      border: none;
      padding: 10px 20px;
      border-radius: 40px;
      font-size: .85rem;
      font-weight: 500;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: .2s;
      font-family: inherit;
    }

    .btn:hover {
      background: #162220;
      transform: translateY(-1px);
    }

    .btn:active {
      transform: translateY(0);
    }

    .btn.accent {
      background: var(--accent);
    }

    .btn.accent:hover {
      background: #a86548;
    }

    .btn.ghost {
      background: transparent;
      border: 1px solid var(--line);
      color: var(--dark);
    }

    .btn.ghost:hover {
      background: var(--ivory);
      border-color: var(--clay);
    }

    .btn.sm {
      padding: 7px 15px;
      font-size: .78rem;
    }

    .btn.danger {
      background: #c94a4a;
      color: #fff;
    }

    .btn.danger:hover {
      background: #b03a3a;
    }

    .btn.icon-only {
      padding: 8px;
      width: 36px;
      height: 36px;
      justify-content: center;
    }

    .table-wrap {
      overflow-x: auto;
      margin: 0 -8px;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: .92rem;
    }

    th {
      text-align: left;
      padding: 14px 12px;
      font-size: .72rem;
      font-weight: 700;
      letter-spacing: .8px;
      text-transform: uppercase;
      color: var(--muted);
      border-bottom: 1px solid var(--line);
    }

    td {
      padding: 16px 12px;
      border-bottom: 1px solid #f4f0eb;
      vertical-align: middle;
    }

    tr:last-child td {
      border-bottom: none;
    }

    tr:hover td {
      background: #faf8f5;
    }

    .progress {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .progress-track {
      background: #eee8e2;
      height: 7px;
      border-radius: 40px;
      width: 110px;
      overflow: hidden;
      flex-shrink: 0;
    }

    .progress-fill {
      height: 100%;
      border-radius: 40px;
      background: linear-gradient(90deg, var(--accent), #d99a78);
      transition: width .5s ease;
    }

    .progress span {
      font-size: .82rem;
      font-weight: 600;
      color: var(--dark);
    }

    .tag {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 13px;
      border-radius: 40px;
      font-size: .76rem;
      font-weight: 600;
      transition: .2s;
      user-select: none;
      white-space: nowrap;
    }

    .tag.green {
      background: #e3f0e6;
      color: #2b6b3c;
    }

    .tag.amber {
      background: #fbf0dd;
      color: #9a6a1e;
    }

    .tag.blue {
      background: #e4edf7;
      color: #2c5b8c;
    }

    .tag.grey {
      background: #efece8;
      color: #6b5d51;
    }

    .tag.red {
      background: #fae3e3;
      color: #a53535;
    }

    .tag.clickable {
      cursor: pointer;
    }

    .tag.clickable:hover {
      filter: brightness(0.94);
      transform: scale(1.05);
    }

    .tag i {
      font-size: .7rem;
    }

    [contenteditable="true"] {
      background: transparent;
      border: 1px dashed transparent;
      border-radius: 6px;
      padding: 3px 6px;
      transition: .15s;
      outline: none;
      min-width: 40px;
      display: inline-block;
      cursor: text;
    }

    [contenteditable="true"]:hover {
      border-color: var(--clay);
      background: #fffdfa;
    }

    [contenteditable="true"]:focus {
      border-color: var(--accent);
      background: #fff;
      box-shadow: 0 0 0 3px rgba(193, 123, 91, .12);
    }

    .gallery {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 14px;
      margin-top: 16px;
    }

    .gallery .item {
      aspect-ratio: 1/1;
      border-radius: 14px;
      overflow: hidden;
      background: linear-gradient(135deg, #efe9e2, #e2d8cd);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2rem;
      border: 1px solid var(--line);
      transition: .25s;
      position: relative;
      cursor: pointer;
    }

    .gallery .item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .gallery .item:hover {
      transform: translateY(-3px);
      box-shadow: var(--shadow-hover);
    }

    .gallery .item .overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, rgba(0, 0, 0, .5), transparent 60%);
      opacity: 0;
      transition: .25s;
      display: flex;
      align-items: flex-end;
      padding: 8px;
    }

    .gallery .item:hover .overlay {
      opacity: 1;
    }

    .gallery .item .del {
      position: absolute;
      top: 8px;
      right: 8px;
      background: rgba(200, 40, 40, .9);
      color: #fff;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: .7rem;
      cursor: pointer;
      opacity: 0;
      transition: .25s;
      border: none;
      font-family: inherit;
      z-index: 2;
    }

    .gallery .item .del:hover {
      background: #c94a4a;
      transform: scale(1.1);
    }

    .gallery .item:hover .del {
      opacity: 1;
    }

    .gallery .item.add {
      background: #faf7f3;
      border: 2px dashed var(--clay);
      color: var(--clay);
      font-size: 1.6rem;
      cursor: pointer;
      flex-direction: column;
      gap: 6px;
    }

    .gallery .item.add span {
      font-size: .7rem;
      font-weight: 600;
      letter-spacing: .5px;
      text-transform: uppercase;
    }

    .gallery .item.add:hover {
      background: var(--ivory);
      border-color: var(--accent);
      color: var(--accent);
    }

    /* ============================================================
     QUERIES SECTION
  ============================================================ */
    .query-filters {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 1px solid var(--line);
    }

    .filter-btn {
      background: #faf8f5;
      border: 1px solid var(--line);
      color: var(--muted);
      padding: 8px 16px;
      border-radius: 40px;
      font-family: inherit;
      font-size: .82rem;
      font-weight: 600;
      cursor: pointer;
      transition: .2s;
      display: inline-flex;
      align-items: center;
      gap: 8px;
    }

    .filter-btn:hover {
      background: var(--ivory);
      color: var(--dark);
    }

    .filter-btn.active {
      background: var(--dark);
      color: #fff;
      border-color: var(--dark);
    }

    .filter-btn .fcount {
      background: rgba(0, 0, 0, .08);
      padding: 1px 8px;
      border-radius: 20px;
      font-size: .72rem;
      font-weight: 700;
    }

    .filter-btn.active .fcount {
      background: rgba(255, 255, 255, .2);
      color: #fff;
    }

    .query-list {
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .query-card {
      display: grid;
      grid-template-columns: auto 1fr auto;
      gap: 18px;
      align-items: center;
      background: #fff;
      border: 1px solid var(--line);
      border-left: 4px solid var(--muted);
      border-radius: 16px;
      padding: 20px 22px;
      transition: .25s;
      position: relative;
    }

    .query-card:hover {
      box-shadow: var(--shadow-hover);
      transform: translateY(-2px);
    }

    .query-card.pending {
      border-left-color: #e6b17e;
      background: linear-gradient(to right, #fdfaf5 0%, #fff 30%);
    }

    .query-card.resolved {
      border-left-color: #7fa88b;
      background: linear-gradient(to right, #f6faf7 0%, #fff 30%);
    }

    .query-status-icon {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.1rem;
      flex-shrink: 0;
    }

    .query-card.pending .query-status-icon {
      background: #fbf0dd;
      color: #9a6a1e;
    }

    .query-card.resolved .query-status-icon {
      background: #e3f0e6;
      color: #2b6b3c;
    }

    .query-body {
      min-width: 0;
    }

    .query-body .query-text {
      font-weight: 500;
      color: var(--dark);
      font-size: .95rem;
      margin-bottom: 6px;
      word-wrap: break-word;
      line-height: 1.4;
    }

    .query-body .query-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 14px;
      font-size: .78rem;
      color: var(--muted);
    }

    .query-body .query-meta span {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .query-body .query-meta i {
      font-size: .72rem;
      opacity: .7;
    }

    .query-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }

    .query-actions .tag {
      padding: 6px 14px;
      font-size: .78rem;
    }

    .query-actions .delete-btn {
      background: #fae3e3;
      color: #a53535;
      border: none;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: .85rem;
      transition: .2s;
      font-family: inherit;
      flex-shrink: 0;
    }

    .query-actions .delete-btn:hover {
      background: #c94a4a;
      color: #fff;
      transform: scale(1.08);
    }

    @media (max-width: 768px) {
      .query-card {
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 14px;
        padding: 18px;
      }

      .query-status-icon {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
      }

      .query-body {
        grid-column: 2;
        grid-row: 1;
      }

      .query-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: space-between;
        padding-top: 12px;
        border-top: 1px solid var(--line);
      }
    }

    @media (max-width: 520px) {
      .query-filters {
        gap: 6px;
        padding-bottom: 12px;
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
      }

      .query-filters::-webkit-scrollbar {
        display: none;
      }

      .filter-btn {
        flex-shrink: 0;
        padding: 7px 14px;
        font-size: .76rem;
      }

      .query-card {
        padding: 16px;
        gap: 12px;
        border-radius: 14px;
      }

      .query-status-icon {
        width: 36px;
        height: 36px;
        font-size: .9rem;
      }

      .query-body .query-text {
        font-size: .9rem;
      }

      .query-body .query-meta {
        gap: 10px;
        font-size: .72rem;
      }

      .query-body .query-meta span {
        width: 100%;
      }

      .query-actions .tag {
        padding: 5px 12px;
        font-size: .72rem;
      }

      .query-actions .delete-btn {
        width: 34px;
        height: 34px;
        font-size: .8rem;
      }
    }

    .team-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 18px;
    }

    .team-card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 18px;
      padding: 26px 18px 20px;
      text-align: center;
      box-shadow: var(--shadow);
      transition: .25s;
      position: relative;
    }

    .team-card:hover {
      transform: translateY(-3px);
      box-shadow: var(--shadow-hover);
    }

    .team-card .emoji {
      font-size: 3rem;
      margin-bottom: 12px;
      display: block;
    }

    .team-card h4 {
      font-size: 1rem;
      font-weight: 600;
      margin-bottom: 4px;
    }

    .team-card p {
      font-size: .78rem;
      color: var(--muted);
      margin-bottom: 14px;
    }

    .team-card .del-btn {
      position: absolute;
      top: 12px;
      right: 12px;
      background: #fae3e3;
      color: #a53535;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      font-size: .72rem;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: .25s;
      font-family: inherit;
    }

    .team-card:hover .del-btn {
      opacity: 1;
    }

    .team-card .del-btn:hover {
      background: #c94a4a;
      color: #fff;
      transform: scale(1.1);
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 18px;
    }

    .form-group label {
      display: block;
      font-size: .78rem;
      font-weight: 600;
      color: var(--muted);
      margin-bottom: 7px;
      text-transform: uppercase;
      letter-spacing: .5px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
      width: 100%;
      /* padding: 11px 14px; */
      border: 1px solid var(--line);
      border-radius: 10px;
      font-size: .9rem;
      font-family: inherit;
      background: #faf8f5;
      transition: .2s;
      color: var(--dark);
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus {
      outline: none;
      border-color: var(--accent);
      background: #fff;
      box-shadow: 0 0 0 3px rgba(193, 123, 91, .1);
    }

    .form-group .hint {
      font-size: .72rem;
      color: var(--muted);
      margin-top: 5px;
      text-transform: none;
      letter-spacing: 0;
      font-weight: 400;
    }

    /* Password field with show/hide + generator */
    .pw-wrap {
      position: relative;
      display: flex;
      align-items: center;
    }

    .pw-wrap input {
      padding-right: 88px;
    }

    .pw-actions {
      position: absolute;
      right: 8px;
      display: flex;
      gap: 2px;
    }

    .pw-btn {
      background: transparent;
      border: none;
      color: var(--muted);
      width: 32px;
      height: 32px;
      border-radius: 8px;
      cursor: pointer;
      font-size: .8rem;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: .2s;
      font-family: inherit;
    }

    .pw-btn:hover {
      background: var(--ivory);
      color: var(--accent);
    }

    /* Credential reveal panel */
    .cred-reveal {
      background: linear-gradient(135deg, #1f2e2b, #2c3d39);
      color: #fff;
      padding: 22px;
      border-radius: 14px;
      margin-bottom: 18px;
      position: relative;
      overflow: hidden;
    }

    .cred-reveal::before {
      content: '';
      position: absolute;
      top: -40px;
      right: -40px;
      width: 140px;
      height: 140px;
      border-radius: 50%;
      background: radial-gradient(circle, rgba(193, 123, 91, .25), transparent 70%);
    }

    .cred-reveal h4 {
      font-size: .95rem;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
      position: relative;
    }

    .cred-reveal h4 i {
      color: var(--sand);
    }

    .cred-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      background: rgba(255, 255, 255, .08);
      border-radius: 10px;
      margin-bottom: 8px;
      position: relative;
    }

    .cred-row:last-child {
      margin-bottom: 0;
    }

    .cred-row .label {
      font-size: .72rem;
      color: #c9c0b4;
      text-transform: uppercase;
      letter-spacing: .5px;
    }

    .cred-row .val {
      font-family: ui-monospace, monospace;
      font-size: .85rem;
      font-weight: 600;
      color: #fff;
      word-break: break-all;
    }

    .cred-row .copy-btn {
      background: rgba(255, 255, 255, .12);
      border: none;
      color: #fff;
      padding: 5px 11px;
      border-radius: 20px;
      font-size: .72rem;
      font-weight: 600;
      cursor: pointer;
      transition: .2s;
      font-family: inherit;
      display: flex;
      align-items: center;
      gap: 5px;
      white-space: nowrap;
    }

    .cred-row .copy-btn:hover {
      background: var(--accent);
    }

    /* Password badge in client table */
    .pw-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: .72rem;
      font-weight: 600;
      font-family: ui-monospace, monospace;
      cursor: pointer;
      transition: .2s;
      user-select: none;
    }

    .pw-badge.masked {
      background: #efece8;
      color: #6b5d51;
    }

    .pw-badge.masked:hover {
      background: #e5dfd7;
    }

    .pw-badge.shown {
      background: #e3f0e6;
      color: #2b6b3c;
    }

    .pw-badge i {
      font-size: .68rem;
    }

    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: var(--dark);
      color: #fff;
      padding: 14px 22px;
      border-radius: 12px;
      font-size: .88rem;
      font-weight: 500;
      box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
      opacity: 0;
      transform: translateY(20px);
      transition: .3s;
      pointer-events: none;
      z-index: 9999;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .toast.show {
      opacity: 1;
      transform: translateY(0);
    }

    .toast i {
      color: #7fd18f;
    }

    .toast.error i {
      color: #ff8f8f;
    }

    .empty {
      text-align: center;
      padding: 40px 20px;
      color: var(--muted);
      font-size: .9rem;
    }

    .empty i {
      font-size: 2rem;
      margin-bottom: 12px;
      display: block;
      opacity: .4;
    }

    .modal-bg {
      position: fixed;
      inset: 0;
      background: rgba(20, 20, 20, .45);
      backdrop-filter: blur(4px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 6000;
      padding: 20px;
    }

    .modal-bg.show {
      display: flex;
      animation: fadeIn .2s ease;
    }

    @keyframes fadeIn {
      from {
        opacity: 0
      }

      to {
        opacity: 1
      }
    }

    .modal {
      background: #fff;
      border-radius: 20px;
      padding: 32px 30px;
      width: 100%;
      max-width: 480px;
      box-shadow: 0 30px 60px rgba(0, 0, 0, .25);
      max-height: 90vh;
      overflow-y: auto;
      animation: slideUp .25s ease;
    }

    @keyframes slideUp {
      from {
        transform: translateY(20px);
        opacity: 0
      }

      to {
        transform: translateY(0);
        opacity: 1
      }
    }

    .modal h3 {
      font-size: 1.2rem;
      font-weight: 600;
      margin-bottom: 22px;
      color: var(--dark);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .modal h3 i {
      color: var(--accent);
    }

    .modal .actions {
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      margin-top: 24px;
    }

    .modal.confirm {
      max-width: 400px;
      text-align: center;
    }

    .modal.confirm .warn-icon {
      width: 60px;
      height: 60px;
      border-radius: 50%;
      background: #fae3e3;
      color: #c94a4a;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.5rem;
      margin: 0 auto 18px;
    }

    .modal.confirm h3 {
      justify-content: center;
      margin-bottom: 10px;
    }

    .modal.confirm p {
      color: var(--muted);
      font-size: .9rem;
      margin-bottom: 4px;
    }

    .modal.confirm .actions {
      justify-content: center;
    }

    .modal.wide {
      max-width: 540px;
    }

    .upload-zone {
      border: 2px dashed var(--clay);
      border-radius: 14px;
      padding: 28px 20px;
      text-align: center;
      cursor: pointer;
      transition: .25s;
      background: #faf7f3;
      margin-bottom: 18px;
    }

    .upload-zone:hover,
    .upload-zone.dragover {
      border-color: var(--accent);
      background: var(--ivory);
    }

    .upload-zone i {
      font-size: 2rem;
      color: var(--clay);
      margin-bottom: 10px;
      display: block;
    }

    .upload-zone p {
      font-weight: 600;
      color: var(--dark);
      margin-bottom: 4px;
      font-size: .95rem;
    }

    .upload-zone span {
      font-size: .78rem;
      color: var(--muted);
    }

    .preview-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
      gap: 10px;
      margin-top: 14px;
    }

    .preview-item {
      aspect-ratio: 1/1;
      border-radius: 10px;
      overflow: hidden;
      position: relative;
      border: 1px solid var(--line);
    }

    .preview-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .preview-item button {
      position: absolute;
      top: 4px;
      right: 4px;
      background: rgba(200, 40, 40, .9);
      color: #fff;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      font-size: .6rem;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .lightbox {
      position: fixed;
      inset: 0;
      background: rgba(15, 15, 15, .92);
      z-index: 7000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 40px;
    }

    .lightbox.show {
      display: flex;
      animation: fadeIn .2s;
    }

    .lightbox img {
      max-width: 90vw;
      max-height: 85vh;
      border-radius: 12px;
      box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
    }

    .lightbox .close {
      position: absolute;
      top: 24px;
      right: 24px;
      background: rgba(255, 255, 255, .15);
      color: #fff;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      border: none;
      cursor: pointer;
      font-size: 1.2rem;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: .2s;
    }

    .lightbox .close:hover {
      background: rgba(255, 255, 255, .25);
    }

    @media(max-width:900px) {
      .sidebar {
        width: 78px;
        padding: 22px 10px;
      }

      .sidebar h5 {
        display: none;
      }

      .menu li {
        justify-content: center;
        padding: 14px 10px;
        position: relative;
      }

      .menu li span:not(.badge):not(.count) {
        display: none;
      }

      .menu li .badge,
      .menu li .count {
        position: absolute;
        margin-left: 0;
        transform: translate(14px, -12px);
        font-size: .6rem;
        padding: 1px 6px;
      }

      .menu li i {
        width: auto;
        margin: 0;
      }

      .sidebar-user .info {
        display: none;
      }

      .sidebar-user {
        justify-content: center;
      }

      .content {
        padding: 24px 18px;
      }
    }

    @media(max-width:600px) {
      .topbar .inner {
        flex-direction: column;
      }

      .page-title h1 {
        font-size: 1.35rem;
      }

      .stats-grid {
        grid-template-columns: 1fr 1fr;
      }

      .stat .num {
        font-size: 1.5rem;
      }

      .stat .icon {
        width: 42px;
        height: 42px;
        font-size: 1rem;
      }

      .login-card {
        padding: 32px 24px;
      }
    }
