    /* ───── LAYOUT ───── */
    #app {
      height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* ───── LOGIN ───── */
    #login-page {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      min-height: 100vh;
      overflow-y: auto;
      padding: 24px 16px 54px;
      background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, .15) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 85% 85%, rgba(139, 92, 246, .08) 0%, transparent 60%),
        var(--bg);
    }

    .login-card {
      background: var(--surface);
      border: 1px solid var(--border2);
      border-radius: 20px;
      padding: 30px 34px;
      width: 95%;
      max-width: 400px;
      max-height: calc(100vh - 72px);
      overflow-y: auto;
      box-shadow: 0 40px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .03);
    }

    .login-card .gap12 {
      gap: 8px;
    }

    .login-card .inp {
      padding: 8px 12px;
      font-size: 12px;
    }

    .login-card .btn-pad-12 {
      padding-top: 10px;
      padding-bottom: 10px;
    }

    .login-logo {
      margin-bottom: 10px;
      display: flex;
      justify-content: center;
      overflow: visible;
    }

    .login-logo img {
      width: 160px;
      height: auto;
      transform: scale(1.25);
      transform-origin: center bottom;
      filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));
    }

    .login-title {
      font-family: 'Playfair Display', serif;
      font-size: 22px;
      text-align: center;
      color: var(--text);
      margin-bottom: 4px;
    }

	    .login-sub {
	      text-align: center;
	      color: var(--muted);
	      font-size: 12px;
	      margin-bottom: 10px;
	    }

    .login-mode-tabs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
      padding: 4px;
      margin-bottom: 10px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 8px;
    }

    .login-mode-tab {
      height: 30px;
      border: 0;
      border-radius: 6px;
      background: transparent;
      color: var(--muted);
      font-family: 'Sora', sans-serif;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
    }

    .login-mode-tab.active {
      color: var(--text);
      background: var(--surface);
      box-shadow: 0 0 0 1px var(--border2);
    }

    .login-link-btn {
      border: 0;
      background: transparent;
      color: var(--accent2);
      font-family: 'Sora', sans-serif;
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      padding: 4px 0;
      text-align: center;
    }

    [data-theme="light"] .login-mode-tabs {
      background: #f1f5f9;
      border-color: #cbd5e1;
    }

    [data-theme="light"] .login-mode-tab.active {
      background: #ffffff;
    }

	    .login-remember {
	      display: flex;
	      align-items: center;
	      gap: 8px;
	      color: var(--muted);
	      font-size: 12px;
	      user-select: none;
	    }

    .login-demo {
      margin-top: 24px;
      padding-top: 20px;
      border-top: 1px solid var(--border);
    }

    .login-footer {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
    }

    .demo-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 10px;
      border-radius: 7px;
      cursor: pointer;
      transition: background .12s;
    }

    .demo-item:hover {
      background: rgba(255, 255, 255, .04);
    }

    .error-msg {
      color: #f87171;
      font-size: 12px;
      padding: 8px 12px;
      background: rgba(239, 68, 68, .08);
      border-radius: 7px;
      border: 1px solid rgba(239, 68, 68, .15);
    }

    /* ───── HEADER ───── */
    #header {
      background: rgba(13, 21, 32, .95);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid color-mix(in srgb, var(--tenant-primary, var(--accent)) 35%, var(--border));
      padding: 0 24px 0 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 58px;
      flex-shrink: 0;
      position: sticky;
      top: 0;
      z-index: 100;
      width: 100%;
      box-sizing: border-box;
    }

    [data-theme="light"] #header {
      background: rgba(255, 255, 255, 0.95);
      border-bottom: 1px solid color-mix(in srgb, var(--tenant-primary, var(--accent)) 28%, rgba(0, 0, 0, 0.08));
    }

    .header-brand {
      font-family: 'Playfair Display', serif;
      font-size: 16px;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 12px;
      font-weight: 700;
    }

	    .header-brand img {
	      height: 40px;
	      width: auto;
      max-width: 150px;
      object-fit: contain;
      border-radius: 4px;
      transform: scale(1.875);
      transform-origin: left center;
      margin-right: 54px;
	    }

    .tenant-name {
      max-width: 180px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: var(--accent2);
      font-family: 'Sora', sans-serif;
      font-size: 13px;
      font-weight: 700;
    }

	    .ui-scale-btn {
	      width: 34px;
	      height: 34px;
	      justify-content: center;
	      font-weight: 800;
	      line-height: 1;
	    }

    .nav-tabs {
      display: flex;
      gap: 2px;
    }

    .nav-tab {
      padding: 8px 16px;
      background: none;
      border: none;
      color: var(--muted);
      font-family: 'Sora', sans-serif;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      border-radius: 8px;
      transition: all .15s;
      border-bottom: 2px solid transparent;
    }

    .nav-tab:hover {
      color: var(--text);
      background: rgba(255, 255, 255, .04);
    }

    .nav-tab.active {
      color: var(--accent2);
      background: rgba(59, 130, 246, .08);
      border-bottom-color: var(--accent);
    }

    .user-info {
      text-align: right;
    }

    .user-name {
      font-size: 13px;
      font-weight: 600;
    }

    .user-role {
      font-size: 11px;
      color: var(--muted);
    }

    /* ───── MAIN ───── */
    #main {
      flex: 1;
      overflow-y: auto;
    }

    .app-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 10px 24px;
      border-top: 1px solid var(--border);
      background: rgba(13, 21, 32, .92);
      color: var(--muted);
      font-size: 11px;
    }

    [data-theme="light"] .app-footer {
      background: rgba(255, 255, 255, .92);
      border-top-color: rgba(0, 0, 0, .08);
    }

    .app-footer-links {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .app-footer-links a {
      color: var(--muted);
      text-decoration: none;
    }

    .app-footer-links a:hover {
      color: var(--text);
    }

    .app-footer-powered strong {
      color: var(--text);
      font-weight: 600;
    }

    .page {
      padding: 24px 28px;
      max-width: 1400px;
      margin: 0 auto;
      animation: fadeIn .2s ease;
    }

    /* ───── STATS GRID ───── */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(134px, 1fr));
      gap: 12px;
      margin-bottom: 22px;
    }

	    .stat-card {
	      background: var(--surface);
	      border-radius: 12px;
	      padding: 14px 12px;
	      border: 1px solid var(--border);
      container-type: inline-size;
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
	      text-align: center;
	      gap: 5px;
	    }

	    .stat-card-active {
	      position: relative;
	      border-color: var(--accent2) !important;
	      background: color-mix(in srgb, var(--surface) 86%, var(--accent) 14%);
	      box-shadow: 0 0 0 2px rgba(96, 165, 250, .28), 0 12px 30px rgba(37, 99, 235, .18);
	    }

	    .stat-card-active::before {
	      content: "";
	      position: absolute;
	      left: 12px;
	      right: 12px;
	      top: 7px;
	      height: 3px;
	      border-radius: 999px;
	      background: var(--accent2);
	    }

	    .stat-card-active .stat-label {
	      color: var(--accent2);
	      font-weight: 800;
	    }

	    .stat-value {
	      font-size: calc(clamp(22px, 22cqw, 38px) * var(--ui-scale-factor, 1));
      font-weight: 700;
      font-variant-numeric: tabular-nums;
      line-height: 1;
      white-space: nowrap;
    }

	    .stat-label {
	      font-size: calc(clamp(10px, 3.4cqw, 12px) * var(--ui-scale-factor, 1));
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .04em;
      line-height: 1.3;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 3px;
      flex-wrap: wrap;
      word-break: break-word;
      overflow-wrap: break-word;
      text-align: center;
    }

    /* ───── TOOLBAR ───── */
    .toolbar {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
      margin-bottom: 18px;
    }

    .toolbar-pagination {
      justify-content: center;
      gap: 6px;
      padding-top: 0;
      margin-bottom: 10px;
    }

    .toolbar-pagination .count-badge {
      margin-left: 0;
    }

    .toolbar .inp,
    #page-admin .inp,
    #page-logs .inp {
      width: auto;
      background: var(--surface2);
      color: var(--text);
      border: 1px solid var(--border2);
    }

    [data-theme="light"] .toolbar .inp,
    [data-theme="light"] #page-admin .inp,
    [data-theme="light"] #page-logs .inp {
      background: #ffffff;
      color: #06090f;
      border: 1px solid #cbd5e1;
    }

    #page-admin .inp,
    #page-logs .inp {
      width: 100%;
    }

    .toolbar .inp:focus,
    #page-admin .inp:focus,
    #page-logs .inp:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    }

    .toolbar .inp::placeholder,
    #page-admin .inp::placeholder,
    #page-logs .inp::placeholder {
      color: var(--muted);
    }

    .count-badge {
      margin-left: auto;
      color: var(--muted);
      font-size: 12px;
    }

    .table-wrap-spaced {
      margin-top: 20px;
    }

