:root {
      font-family: Arial,"Segoe UI",sans-serif;
      color: #202938;
      background: #f6f7f9;
      --dark: #fff;
      --nav: #fff;
      --accent: #2563eb;
      --line: #e3e7ec;
      --text: #202938;
      --muted: #697587;
      --shadow: none;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      font-size: 14px;
      background: #f6f7f9;
    }

    button,input,select {
      font: inherit;
    }

    button {
      cursor: pointer;
    }

    a {
      color: #2563eb;
      text-decoration: none;
    }

    input,select {
      outline: none;
    }

    input:focus,select:focus {
      border-color: #2563eb !important;
      box-shadow: 0 0 0 2px #2563eb1a;
    }

    button:disabled {
      opacity: .5;
      cursor: not-allowed;
    }

    button:focus-visible,a:focus-visible {
      outline: 2px solid #2563eb;
      outline-offset: 2px;
    }


    .app {
      display: grid;
      grid-template-columns: 210px minmax(0,1fr);
      min-height: 100vh;
    }

    .sidebar {
      background: #fff;
      border-right: 1px solid var(--line);
      padding: 20px 12px;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      color: var(--text);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 9px;
      color: #202938;
      font-size: 17px;
      font-weight: 700;
      letter-spacing: 0;
      padding: 4px 9px 23px;
      white-space: nowrap;
    }

    .brand-mark {
      width: 32px;
      height: 32px;
      flex-shrink: 0;
      background: #2563eb;
      border-radius: 6px;
      color: #fff;
      display: grid;
      place-items: center;
      font-size: 17px;
      box-shadow: none;
    }

    .brand span[style*="86a6ef"] {
      display: none;
    }

    .nav-section {
      display: none;
    }

    .side-nav {
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-bottom: 12px;
    }

    .nav-link {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 11px 12px;
      color: #475569;
      background: transparent;
      border: 0;
      border-radius: 6px;
      text-align: left;
      font-size: 13px;
      font-weight: 500;
      margin: 0;
    }

    .nav-link:hover {
      background: #f3f5f8;
      color: #182538;
    }

    .nav-link.active {
      background: #eaf1ff;
      color: #1d4ed8;
      font-weight: 700;
    }

    .nav-icon {
      width: 20px;
      text-align: center;
      font-size: 16px;
    }

    .side-foot {
      margin-top: auto;
      border-top: 1px solid var(--line);
      padding: 14px 8px 4px;
      color: #788292;
      font-size: 11px;
      line-height: 1.8;
      overflow-wrap: anywhere;
    }

    .side-config {
      display: block;
      background: none;
      border: 0;
      color: #2563eb;
      padding: 5px 0 12px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      text-align: left;
    }

    .side-config:hover {
      text-decoration: underline;
    }

    .status-dot {
      display: inline-block;
      background: #22a06b;
      height: 7px;
      width: 7px;
      border-radius: 50%;
      margin-right: 5px;
    }


    .main {
      min-width: 0;
    }

    .topbar {
      height: 62px;
      background: #fff;
      border-bottom: 1px solid var(--line);
      padding: 0 28px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .crumb {
      font-size: 13px;
      color: #788292;
    }

    .crumb strong {
      color: #334155;
    }

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

    .avatar {
      height: 32px;
      width: 32px;
      border: 1px solid var(--line);
      background: #f1f5f9;
      color: #475569;
      border-radius: 50%;
      font-weight: 700;
    }

    .user-name {
      font-size: 13px;
      font-weight: 700;
      max-width: 150px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .user-role {
      font-size: 11px;
      color: #6b7280;
      margin-top: 2px;
    }

    .content {
      max-width: 1360px;
      margin: 0 auto;
      padding: 26px 28px 50px;
    }

    .eyebrow {
      display: none;
    }

    .page-title {
      font-size: 23px;
      font-weight: 700;
      letter-spacing: 0;
      color: #202938;
      margin: 0 0 5px;
    }

    .page-sub {
      font-size: 13px;
      color: var(--muted);
      margin: 0;
      line-height: 1.5;
    }

    .head-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
    }

    .actions {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 7px;
    }


    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      border: 1px solid #cdd5df;
      background: #fff;
      color: #334155;
      border-radius: 6px;
      padding: 9px 12px;
      min-height: 36px;
      font-size: 12px;
      font-weight: 600;
      transition: background .1s;
    }

    .btn:hover:not(:disabled) {
      background: #f3f6f9;
    }

    .btn-primary {
      background: #2563eb;
      border-color: #2563eb;
      color: white;
      box-shadow: none;
    }

    .btn-primary:hover:not(:disabled) {
      background: #1d4ed8;
    }

    .btn-danger {
      color: #b42334;
      border-color: #f0ccd1;
      background: #fff;
    }

    .btn-danger:hover:not(:disabled) {
      background: #fff3f4;
    }

    .btn-muted {
      background: #f8fafc;
    }

    .btn-sm {
      min-height: 30px;
      padding: 6px 9px;
      font-size: 12px;
    }

    .btn-icon {
      min-width: 31px;
      padding: 5px 9px;
    }

    .btn-block {
      width: 100%;
      min-height: 42px;
      font-size: 14px;
    }


    .tag {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      border-radius: 5px;
      padding: 4px 8px;
      font-weight: 600;
      font-size: 11px;
    }

    .tag-green {
      color: #166534;
      background: #eef8f0;
    }

    .tag-gray {
      color: #64748b;
      background: #f1f5f9;
    }

    .tag-blue {
      color: #1d4ed8;
      background: #eff6ff;
    }

    .tag-purple {
      color: #6d28d9;
      background: #f5f3ff;
    }


    .card {
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 8px;
      box-shadow: none;
    }

    .filter-card {
      padding: 16px;
      margin-bottom: 16px;
    }

    .filter-grid {
      display: flex;
      align-items: end;
      flex-wrap: wrap;
      gap: 10px;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 130px;
      flex: 1;
    }

    .field.wide {
      flex: 1.6;
      min-width: 175px;
    }

    .field label {
      color: #475569;
      font-weight: 600;
      font-size: 12px;
    }

    .control {
      height: 38px;
      width: 100%;
      padding: 0 10px;
      background: #fff;
      color: #202938;
      border: 1px solid #cfd7e3;
      border-radius: 5px;
      font-size: 13px;
    }

    .field input[type=date] {
      max-width: unset;
    }


    .table-wrap {
      overflow-x: auto;
    }

    .data-table {
      width: 100%;
      border-collapse: collapse;
      min-width: 745px;
    }

    .data-table th {
      background: #f8fafc;
      border-bottom: 1px solid var(--line);
      color: #475569;
      text-align: left;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0;
      text-transform: none;
      white-space: nowrap;
      padding: 13px 14px;
    }

    .data-table td {
      font-size: 12px;
      color: #334155;
      border-bottom: 1px solid #edf0f3;
      padding: 12px 14px;
      vertical-align: middle;
    }

    .data-table tbody tr:hover td {
      background: #fafbfe;
    }

    .data-table tbody tr:last-child td {
      border-bottom: 0;
    }

    .table-title {
      font-size: 13px;
      color: #1f2937;
      font-weight: 700;
    }

    .table-sub {
      font-size: 11px;
      color: #94a3b8;
      margin-top: 4px;
    }

    .check {
      height: 16px;
      width: 16px;
      accent-color: #2563eb;
    }

    .table-foot {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      border-top: 1px solid var(--line);
      padding: 14px 16px;
      color: #64748b;
      font-size: 12px;
    }

    .pagination {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .page-number {
      display: grid;
      place-items: center;
      width: 32px;
      height: 32px;
      background: #eff6ff;
      color: #1d4ed8;
      border-radius: 5px;
      font-weight: 700;
    }


    .hero {
      display: none;
    }

    .hero-art {
      display: none;
    }

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

    .stat {
      padding: 18px;
      display: block;
    }

    .stat-label {
      font-size: 12px;
      font-weight: 600;
      color: #64748b;
    }

    .stat-number {
      font-size: 27px;
      font-weight: 700;
      color: #1f2937;
      margin-top: 10px;
      letter-spacing: 0;
    }

    .stat-hint {
      font-size: 11px;
      color: #94a3b8;
      margin-top: 6px;
    }

    .stat-icon {
      display: none;
    }

    .welcome-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px;
    }

    .pad-card {
      padding: 18px;
    }

    .panel-heading {
      font-size: 15px;
      font-weight: 700;
      color: #1f2937;
      margin: 0 0 12px;
    }

    .detail-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 0;
      border-bottom: 1px solid #edf0f3;
      font-size: 12px;
    }

    .detail-row:last-child {
      border-bottom: 0;
    }

    .detail-row span {
      color: #64748b;
    }

    .detail-row b {
      color: #334155;
    }

    .quick-list {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .quick-button {
      padding: 11px 12px;
      border: 1px solid var(--line);
      border-radius: 5px;
      background: #fff;
      color: #334155;
      text-align: left;
      font-size: 13px;
      font-weight: 500;
      display: flex;
      justify-content: space-between;
      cursor: pointer;
    }

    .quick-button:hover {
      background: #f8fafc;
    }


    .auth-layout {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      padding: 20px;
      background: #f6f7f9;
    }

    .auth-visual {
      display: none;
    }

    .auth-wrap {
      display: block;
      width: 100%;
      max-width: 430px;
      padding: 0;
    }

    .auth-card {
      width: 100%;
      max-width: 430px;
      background: white;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 30px 28px;
      box-shadow: none;
    }

    .auth-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 24px;
    }

    .auth-card h2 {
      font-size: 23px;
      letter-spacing: 0;
      margin: 0 0 7px;
      font-weight: 700;
    }

    .auth-card .field {
      margin: 15px 0;
    }

    .auth-card .control {
      height: 42px;
      font-size: 13px;
    }

    .auth-desc {
      font-size: 13px;
      line-height: 1.6;
      color: var(--muted);
    }

    .auth-links {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      margin: 13px 0 20px;
      font-size: 12px;
    }

    .auth-links button {
      background: none;
      color: #2563eb;
      border: 0;
      padding: 0;
      font-weight: 600;
    }

    .auth-footer {
      text-align: center;
      color: #64748b;
      font-size: 12px;
      margin-top: 20px;
    }

    .auth-footer button {
      background: none;
      border: 0;
      color: #2563eb;
      font-weight: 700;
    }

    .auth-note {
      background: #f8fafc;
      color: #64748b;
      padding: 11px 12px;
      border: 1px solid #edf0f3;
      border-radius: 6px;
      line-height: 1.6;
      font-size: 11px;
      margin-top: 18px;
    }

    .lang-select {
      font-size: 12px;
      font-weight: 600;
      color: #475569;
      background: #fff;
      border: 1px solid #d5dce5;
      border-radius: 5px;
      padding: 7px 8px;
    }

    .api-config {
      margin-top: 14px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #fff;
      padding: 10px 12px;
      font-size: 12px;
      color: #64748b;
    }

    .api-config summary {
      cursor: pointer;
      color: #475569;
      font-weight: 600;
    }

    .api-config p {
      margin: 9px 0;
      line-height: 1.5;
    }

    .api-config label {
      font-size: 12px;
      font-weight: 600;
      display: block;
      margin: 9px 0 6px;
    }

    .api-config-row {
      display: flex;
      gap: 8px;
    }

    .api-config-row input {
      flex: 1;
      min-width: 0;
    }

    .api-config-row button {
      white-space: nowrap;
    }

    /* Modal va thong bao */

    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: #17223591;
      z-index: 30;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 15px;
    }

    .modal {
      width: min(570px,100%);
      max-height: 92vh;
      overflow: auto;
      background: #fff;
      border-radius: 8px;
      border: 1px solid var(--line);
      box-shadow: 0 20px 60px #0002;
    }

    .modal.large {
      width: min(780px,100%);
    }

    .modal-head {
      padding: 18px 20px;
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .modal-head h3 {
      margin: 0;
      font-size: 17px;
      font-weight: 700;
    }

    .modal-close {
      width: 30px;
      height: 30px;
      background: #f1f5f9;
      border: 0;
      border-radius: 5px;
      font-size: 19px;
      color: #64748b;
    }

    .modal-body {
      padding: 20px;
    }

    .modal-fields {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0 14px;
    }

    .modal-fields .field {
      margin-bottom: 14px;
    }

    .span-2 {
      grid-column: span 2;
    }

    .modal-foot {
      display: flex;
      justify-content: flex-end;
      gap: 7px;
      padding-top: 8px;
    }

    .toast-stack {
      position: fixed;
      z-index: 55;
      right: 15px;
      top: 15px;
      display: flex;
      flex-direction: column;
      gap: 7px;
    }

    .toast {
      background: #334155;
      color: #fff;
      border-radius: 6px;
      font-size: 13px;
      padding: 12px 16px;
      max-width: 400px;
      box-shadow: 0 8px 25px #0002;
      line-height: 1.5;
    }

    .toast.error {
      background: #b42334;
    }

    .toast.success {
      background: #16734c;
    }

    .empty {
      padding: 38px 15px;
      text-align: center;
      color: #64748b;
      font-size: 13px;
    }

    .empty .emoji {
      font-size: 27px;
      display: block;
      margin-bottom: 8px;
    }

    .check-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px;
      max-height: 340px;
      overflow: auto;
    }

    .check-row {
      display: flex;
      gap: 8px;
      align-items: center;
      border: 1px solid var(--line);
      padding: 9px;
      border-radius: 5px;
      font-size: 12px;
    }

    .check-row small {
      color: #94a3b8;
    }

    .error-screen {
      padding: 45px 20px;
      text-align: center;
      max-width: 640px;
      margin: auto;
    }

    .error-screen .emoji {
      font-size: 43px;
    }

    .error-screen h2 {
      font-size: 24px;
      color: #202938;
    }

    .error-screen p {
      color: #64748b;
      font-size: 13px;
      line-height: 1.6;
    }

    @media (max-width:1120px) {
      .app {
        grid-template-columns: 180px minmax(0,1fr);
      }
      .content {
        padding: 22px 18px;
      }
      .stats {
        grid-template-columns: repeat(2,minmax(0,1fr));
      }
    }

    @media (max-width:760px) {
      .app {
        display: block;
      }
      .sidebar {
        min-height: 0;
        padding: 12px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
      }
      .brand {
        padding: 0 4px 12px;
      }
      .side-nav {
        flex-direction: row;
        flex-wrap: wrap;
        margin: 0 0 6px;
        gap: 3px;
      }
      .nav-link {
        width: auto;
        padding: 9px 10px;
      }
      .nav-icon {
        display: none;
      }
      .side-foot {
        display: none;
      }
      .topbar {
        height: 56px;
        padding: 0 14px;
      }
      .user-name {
        max-width: 100px;
      }
      .avatar {
        display: none;
      }
      .content {
        padding: 19px 13px 38px;
      }
      .head-row {
        align-items: flex-start;
        flex-direction: column;
      }
      .stats {
        gap: 9px;
      }
      .stat {
        padding: 14px;
      }
      .stat-number {
        font-size: 22px;
      }
      .welcome-grid {
        grid-template-columns: 1fr;
      }
      .modal-fields,.check-grid {
        grid-template-columns: 1fr;
      }
      .span-2 {
        grid-column: span 1;
      }
      .auth-card {
        padding: 25px 19px;
      }
    }

    @media (max-width:460px) {
      .table-foot {
        flex-direction: column;
        align-items: flex-start;
      }
      .topbar {
        gap: 6px;
      }
      .crumb {
        display: none;
      }
      .top-actions {
        width: 100%;
        justify-content: space-between;
      }
      .api-config-row {
        flex-direction: column;
      }
    }
