/* ---------------------------------------------------------
   AIGatewayX Admin - main.css (final)
   - duplicate rules consolidated
   - current layout/header sizing reflected
---------------------------------------------------------- */

/* =========================================================
   Base / Body
========================================================= */
.aigw-body {
    margin: 0;
    padding: 0;
    font-family: Inter, "Pretendard", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #0b1120 0, #020617 60%, #000 100%);
    color: #e5e7eb;
}

/* =========================================================
   Main App Layout
========================================================= */
.aigw-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

.aigw-main {
    min-width: 0;
    max-width: 100%;
    flex: 1;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top center, rgba(25, 64, 128, 0.22), transparent 38%),
        #030c20;
}

.aigw-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    padding: 20px 24px 24px;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* legacy layout compatibility */
.aigw-layout {
    display: flex;
    min-height: 100vh;
}

.aigw-layout-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================================
   Sidebar
========================================================= */
.aigw-sidebar {
    width: 220px;
    overflow-x: hidden;
    transition: width 0.2s ease;
    background:
        linear-gradient(180deg, rgba(7, 20, 48, 0.96), rgba(3, 12, 32, 0.98));
    border-right: 1px solid rgba(145, 167, 206, 0.18);
    box-sizing: border-box;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.aigw-sidebar-brand {
    height: 72px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(145, 167, 206, 0.18);
}

.aigw-brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
    text-decoration: none;
    width: 100%;
    min-width: 0;
}

.aigw-brand-logo {
    display: block;
    width: auto;
    height: 42px;
    max-width: 190px;
    object-fit: contain;
    flex-shrink: 0;
}

.aigw-brand-text {
    min-width: 0;
}

.aigw-brand-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
}

.aigw-brand-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #a7b3c9;
    line-height: 1.2;
}

.aigw-sidebar-nav {
    padding: 12px 8px 18px;
}

.aigw-nav {
    flex: 1;
    padding: 10px 0 20px 0;
}

.aigw-nav-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.aigw-nav-section-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 700;
    color: #e5e7eb;
    text-transform: none;
    letter-spacing: -0.2px;
    border-radius: 10px;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.aigw-nav-section-title:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #f3f4f6;
}

.aigw-nav-section-title:focus,
.aigw-nav-section-title.aigw-nav-section-toggle:focus {
    outline: 2px solid rgba(56, 189, 248, 0.35);
    outline-offset: 2px;
    border-radius: 6px;
}

.aigw-nav-section-title::after {
    content: "▸";
    font-size: 14px;
    line-height: 1;
    color: #9ca3af;
    transform-origin: 50% 50%;
    transition: transform 0.18s ease, color 0.18s ease;
}

.aigw-nav-section-title[aria-expanded="true"]::after {
    transform: rotate(90deg);
    color: #e5e7eb;
}

.aigw-nav-section.is-collapsed > .aigw-nav-item {
    display: none;
}

.aigw-nav-section-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-out;
    padding-bottom: 6px;
}

.aigw-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    color: #d8e3f3;
    text-decoration: none;
    font-size: 15px;
    font-weight: 400;
    transition: background 0.15s ease, color 0.15s ease;
    border-left: 3px solid transparent;
    box-sizing: border-box;
}

.aigw-nav-item:hover {
    background: rgba(73, 132, 255, 0.10);
    color: #f3f4f6;
    cursor: pointer;
}

.aigw-nav-item-active {
    background: linear-gradient(90deg, rgba(48, 124, 255, 0.22), rgba(48, 124, 255, 0.10));
    color: #ffffff;
    box-shadow: inset 3px 0 0 #3da8ff;
    font-weight: 450;
}

.aigw-nav-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    font-size: 14px;
}

.aigw-nav-menu a,
.aigw-nav-menu span {
    font-size: 13px;
    font-weight: 400;
    color: #9ca3af;
}

.aigw-nav-section-toggle i,
.aigw-nav-section-toggle svg {
    font-size: 15px;
    width: 15px;
    height: 15px;
    color: #e5e7eb;
    transition: transform 0.2s ease, color 0.2s ease;
}

.aigw-nav-section.open .aigw-nav-section-toggle i,
.aigw-nav-section.open .aigw-nav-section-toggle svg {
    transform: rotate(90deg);
}

.aigw-nav-section.open > .aigw-nav-section-items {
    max-height: 500px;
}

.aigw-nav-section.is-collapsed > .aigw-nav-section-items {
    max-height: 0;
}

.aigw-nav-section-toggle:hover i,
.aigw-nav-section-title:hover {
    color: #f9fafb;
}

.aigw-sidebar .aigw-nav-section-items .aigw-nav-item {
    padding: 9px 16px 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    border-left: 3px solid transparent;
    border-radius: 10px;
    margin: 2px 6px;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.aigw-sidebar .aigw-nav-section-items .aigw-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #f3f4f6;
}

.aigw-sidebar .aigw-nav-section-items .aigw-nav-item.aigw-nav-item-active {
    background-color: rgba(56, 189, 248, 0.12);
    border-left-color: #38bdf8;
    color: #ffffff;
    font-weight: 700;
}

.aigw-sidebar .aigw-nav-section > .aigw-nav-item {
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #cbd5e1;
    border-radius: 10px;
    margin: 2px 8px;
}

.aigw-sidebar .aigw-nav-section > .aigw-nav-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #f3f4f6;
}

.aigw-sidebar .aigw-nav-section > .aigw-nav-item.aigw-nav-item-active {
    background-color: rgba(56, 189, 248, 0.12);
    border-left-color: #38bdf8;
    color: #ffffff;
    font-weight: 700;
}

/* legacy sidebar logo compatibility */
.aigw-sidebar-logo {
    padding: 8px 12px;
    border-bottom: 1px solid #1e293b;
    text-align: center;
}

.aigw-sidebar-logo-img {
    max-width: 140px;
    height: auto;
    display: block;
    margin: 4px auto;
}

/* =========================================================
   Header
========================================================= */
.aigw-header {
    min-height: 72px;
    padding: 8px 24px 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(145, 167, 206, 0.18);
}

.aigw-header-left {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.aigw-header-title-wrap {
    min-width: 0;
}

.aigw-header-title {
    margin: 0;
    font-size: 25px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.aigw-breadcrumb {
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 16px;
    font-size: 12px;
    color: #97a7c3;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aigw-breadcrumb-home {
    font-size: 12px;
    line-height: 1;
}

.aigw-breadcrumb-link {
    color: #97a7c3;
    text-decoration: none;
}

.aigw-breadcrumb-link:hover {
    color: #d9e7ff;
}

.aigw-breadcrumb-sep {
    color: #6f7f9c;
}

.aigw-breadcrumb-current {
    color: #c8d4e8;
}

.aigw-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.aigw-user-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.aigw-user-plan {
    padding: 3px 9px;
    border: 1px solid rgba(145, 167, 206, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 11px;
    font-weight: 700;
    color: #c8d4e8;
}

.aigw-logout-form {
    margin: 0;
}

/* legacy topbar compatibility */
.aigw-topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background-color: #020617;
    border-bottom: 1px solid #1f2937;
}

.aigw-topbar-title {
    display: flex;
    align-items: center;
}

.aigw-topbar-logo-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.aigw-topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.aigw-topbar-username {
    font-size: 13px;
    color: #e5e7eb;
}

.aigw-topbar-logo-img {
    height: 24px;
    width: auto;
    display: block;
}

/* =========================================================
   Panel / Card
========================================================= */
.aigw-panel {
    background-color: #0b1120;
    border-radius: 12px;
    border: 1px solid #1f2937;
    padding: 16px 20px 20px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.aigw-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.aigw-panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #f9fafb;
}

.aigw-page-header {
    margin-bottom: 14px;
}

.aigw-page-header h1,
.aigw-page-header h2 {
    margin: 0 0 6px;
}

.aigw-page-header .desc {
    margin: 0;
    font-size: 13px;
    color: #97a7c3;
}

/* =========================================================
   Table
========================================================= */
.aigw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.aigw-table th {
    background-color: #111827;
    color: #9ca3af;
    font-weight: 500;
    padding: 8px;
}

.aigw-table th:not(:last-child),
.aigw-table td:not(:last-child) {
    border-right: 1px solid #1f2937;
}

.aigw-table td {
    padding: 8px;
    border-bottom: 1px solid #1f2937;
    vertical-align: middle;
    font-weight: 400;
}

.aigw-table tr:nth-child(even) {
    background-color: #020617;
}

.aigw-table tr:hover {
    background-color: #1e293b;
}

.aigw-table-empty {
    text-align: center;
    padding: 20px 0;
    color: #6b7280;
}

.aigw-text-left {
    text-align: left;
}

.aigw-text-center {
    text-align: center;
}

.aigw-text-right {
    text-align: right;
}

.aigw-table-actions {
    display: inline-flex;
    gap: 6px;
    justify-content: center;
}

.aigw-table-project .aigw-table-head th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #030712;
    color: #9ca3af;
    font-weight: 600;
    font-size: 14px;
    vertical-align: middle;
    border-bottom: 1px solid #1f2937;
    text-align: center;
}

.aigw-table-project .aigw-table-body tr td {
    background-color: #020617;
    border-bottom: 1px solid #111827;
    vertical-align: middle;
    padding: 5px 12px;
    line-height: 1.2;
}

.aigw-table-project .aigw-table-body tr:nth-child(even) td {
    background-color: #020617;
}

.aigw-table-project .aigw-table-body tr:hover td {
    background-color: #111827;
}

/* =========================================================
   Buttons
========================================================= */
.aigw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background-color: transparent;
    color: #f8fafc;
}

.aigw-btn:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.aigw-btn-primary {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.78);
}

.aigw-btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.92);
}

.aigw-btn-secondary {
    background-color: transparent;
    color: #e5e7eb;
    border: 1px solid rgba(229, 231, 235, 0.58);
}

.aigw-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(229, 231, 235, 0.82);
}

.aigw-btn-info {
    background-color: transparent;
    color: #7dd3fc;
    border: 1px solid rgba(125, 211, 252, 0.62);
}

.aigw-btn-info:hover {
    background-color: rgba(125, 211, 252, 0.10);
    border-color: rgba(125, 211, 252, 0.88);
}

.aigw-btn-search {
    background-color: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.78);
}

.aigw-btn-search:hover {
    background-color: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.92);
}

.aigw-btn-danger {
    background-color: transparent;
    color: #fca5a5;
    border: 1px solid rgba(252, 165, 165, 0.68);
}

.aigw-btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.10);
    border-color: rgba(252, 165, 165, 0.92);
}

.aigw-btn-sm {
    min-height: 32px;
    padding: 0 11px;
    font-size: 12px;
    font-weight: 600;
}

.aigw-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    font-size: 14px;
    line-height: 1;
}

/* =========================================================
   Filter / Search
========================================================= */
.aigw-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 4px;
    margin-bottom: 1rem;
    justify-content: space-between;
}

.aigw-filter-bar form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
    flex-grow: 1;
}

.aigw-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.aigw-filter-bar select,
.aigw-filter-bar input[type="text"] {
    flex-shrink: 0;
    width: auto;
    max-width: 260px;
}

.aigw-filter-bar .aigw-btn-search {
    flex-shrink: 0;
}

.aigw-filter-bar a.aigw-btn-primary,
.aigw-filter-bar a.aigw-btn-action {
    margin-left: auto;
    flex-shrink: 0;
}

/* =========================================================
   Form
========================================================= */
.aigw-input,
.aigw-select,
.aigw-textarea {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    background-color: #020617;
    border-radius: 6px;
    border: 1px solid #374151;
    color: #e5e7eb;
    padding: 9px 11px;
    font-size: 13px;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.aigw-input:focus,
.aigw-select:focus,
.aigw-textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

.aigw-form {
    max-width: 520px;
    margin: 0 auto;
}

.aigw-panel .aigw-form {
    max-width: 780px;
    margin-left: 0;
    margin-right: auto;
}

.aigw-form-group {
    margin-bottom: 22px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.aigw-form-group label {
    margin-bottom: 6px;
    display: block;
    font-weight: 600;
    color: #e5e7eb;
}

.aigw-field-hint {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.4;
}

.aigw-field-error,
.aigw-error {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #f97373;
    line-height: 1.4;
}

/* =========================================================
   Alert / Notice
========================================================= */
.aigw-alert {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background-color: rgba(15, 23, 42, 0.72);
    color: #dbeafe;
}

.aigw-alert-info {
    border-color: rgba(56, 189, 248, 0.32);
    background-color: rgba(8, 47, 73, 0.44);
    color: #bae6fd;
}

.aigw-alert-success {
    border-color: rgba(34, 197, 94, 0.32);
    background-color: rgba(20, 83, 45, 0.34);
    color: #bbf7d0;
}

.aigw-alert-warning,
.aigw-alert-warn {
    border-color: rgba(245, 158, 11, 0.36);
    background-color: rgba(120, 53, 15, 0.34);
    color: #fde68a;
}

.aigw-alert-danger {
    border-color: rgba(248, 113, 113, 0.36);
    background-color: rgba(127, 29, 29, 0.34);
    color: #fecaca;
}

.aigw-alert-warn.aigw-notice {
    background-color: #111827;
    border: 1px solid #374151;
}


.aigw-notice-text {
    font-size: 0.8125rem;
    color: #e5e7eb;
    line-height: 1.5;
}

.aigw-notice-icon {
    margin-right: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffff80;
    opacity: 0.9;
}

/* =========================================================
   Pagination
========================================================= */
.aigw-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 12px;
}

.aigw-page-link {
    min-width: 26px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    text-align: center;
    text-decoration: none;
    color: #9ca3af;
    border: 1px solid #1f2937;
    background-color: #020617;
}

.aigw-page-link:hover {
    border-color: #38bdf8;
    color: #e5e7eb;
}

.aigw-page-link-active {
    background-color: #38bdf8;
    color: #0f172a;
    border-color: #38bdf8;
}

/* =========================================================
   Footer
========================================================= */
.aigw-footer {
    padding: 8px 24px 12px 24px;
    border-top: 1px solid #1f2937;
    background-color: #020617;
    font-size: 12px;
    color: #6b7280;
    margin-top: auto;
}

.aigw-footer-text {
    display: block;
    text-align: right;
}

/* =========================================================
   Login
========================================================= */
.aigw-login-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #0b1120 0, #020617 60%, #000 100%);
}

.aigw-login-panel {
    width: 360px;
    max-width: 90%;
    background-color: #020617;
    border-radius: 16px;
    border: 1px solid #1f2937;
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.8);
    padding: 24px 24px 28px 24px;
}

.aigw-login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    text-align: center;
}

.aigw-login-logo-img {
    max-width: 160px;
    height: auto;
    margin-bottom: 12px;
}

.aigw-login-logo-title {
    font-size: 18px;
    font-weight: 700;
    color: #f9fafb;
}

.aigw-login-logo-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
}

/* =========================================================
   Billing Detail
========================================================= */
.billing-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.billing-detail-title {
    font-size: 18px;
    font-weight: 700;
    color: #f9fafb;
}

.billing-detail-alert {
    margin-bottom: 16px;
}

.billing-detail-card {
    margin-bottom: 18px;
}

.billing-detail-th {
    width: 260px;
}

.billing-refund-preview-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.billing-refund-reason-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.billing-refund-reason-label {
    font-size: 14px;
    color: #d1d5db;
    min-width: 70px;
}

.billing-refund-reason-select {
    width: 220px;
}

.billing-refund-message {
    white-space: pre-line;
    line-height: 1.7;
}

.billing-refund-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.billing-refund-request-form {
    margin: 0;
}

.billing-refund-empty {
    margin-top: 12px;
    color: #f87171;
    font-size: 14px;
}

/* =========================================================
   Dashboard
========================================================= */
.dashboard-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.dashboard-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 2px;
}

.dashboard-page-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.2px;
}

.dashboard-page-desc {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
}

.dashboard-page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dashboard-top-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) 78px;
    gap: 14px;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 14px;
}

.dashboard-panel-span-2 {
    min-height: 312px;
}

.dashboard-kpi-card {
    position: relative;
    overflow: hidden;
    min-height: 142px;
    background:
        radial-gradient(circle at top right, rgba(59,130,246,0.14), transparent 36%),
        linear-gradient(180deg, rgba(10,20,45,0.94) 0%, rgba(9,17,32,0.98) 100%);
}

.dashboard-kpi-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 142px;
    padding: 18px 10px;
}

.dashboard-kpi-side-icon {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.dashboard-kpi-side-value {
    font-size: 38px;
    line-height: 1;
    font-weight: 700;
    color: #f8fafc;
}

.dashboard-kpi-side-label {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.45;
}

.dashboard-kpi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dashboard-kpi-title {
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
}

.dashboard-kpi-subtitle {
    font-size: 11px;
    color: #94a3b8;
}

.dashboard-kpi-value {
    margin-top: 10px;
    font-size: 24px;
    line-height: 1.1;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.3px;
}

.dashboard-kpi-footer {
    margin-top: 10px;
    font-size: 12px;
    color: #cbd5e1;
}

.dashboard-kpi-visual {
    margin-top: 12px;
    min-height: 26px;
    display: flex;
    align-items: center;
}

.dashboard-mini-line {
    width: 100%;
    height: 34px;
    opacity: 0.95;
}

.dashboard-kpi-progress {
    width: 100%;
    height: 7px;
    background: rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    overflow: hidden;
}

.dashboard-kpi-progress-bar {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3cb8ff 0%, #7dd3fc 100%);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.dashboard-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.dashboard-panel-header-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dashboard-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #23324d;
    background-color: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
    font-size: 12px;
}

.dashboard-link-inline {
    color: #7dd3fc;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.dashboard-link-inline:hover {
    color: #bae6fd;
}

.dashboard-chart-wrap {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 10px;
    align-items: stretch;
    min-height: 235px;
}

.dashboard-chart-yaxis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 6px;
    padding-bottom: 26px;
    font-size: 12px;
    color: #94a3b8;
}

.dashboard-chart-body {
    position: relative;
    min-height: 235px;
}

.dashboard-chart-grid {
    position: absolute;
    inset: 0 0 26px 0;
    border-radius: 10px;
    background-image:
        linear-gradient(to bottom, rgba(148,163,184,0.08) 1px, transparent 1px);
    background-size: 100% 25%;
    pointer-events: none;
}

.dashboard-line-chart {
    position: absolute;
    inset: 0 0 26px 0;
    width: 100%;
    height: calc(100% - 26px);
}

.dashboard-chart-xaxis {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.dashboard-donut-layout {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 8px;
    align-items: center;
}

.dashboard-legend {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dashboard-legend-item {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.dashboard-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    box-shadow: 0 0 12px rgba(255,255,255,0.08);
}

.dashboard-tone-blue {
    background: #58a6ff;
}

.dashboard-tone-purple {
    background: #a78bfa;
}

.dashboard-tone-green {
    background: #8fb98b;
}

.dashboard-tone-gray {
    background: #7c89b8;
}

.dashboard-legend-name {
    color: #e5e7eb;
    font-weight: 500;
}

.dashboard-legend-value {
    color: #93c5fd;
    font-weight: 600;
}

.dashboard-donut-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-donut {
    position: relative;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background:
        conic-gradient(
            #4f8dff 0deg 151deg,
            #7d79ff 151deg 246deg,
            #58b8a3 246deg 298deg,
            #97b55d 298deg 328deg,
            #6f7dac 328deg 360deg
        );
    box-shadow: inset 0 0 30px rgba(0,0,0,0.18);
}

.dashboard-donut::after {
    content: "";
    position: absolute;
    inset: 22px;
    border-radius: 50%;
    background: #0b1120;
    box-shadow: inset 0 0 20px rgba(2, 6, 23, 0.65);
}

.dashboard-donut-center {
    position: absolute;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-donut-center strong {
    font-size: 20px;
    color: #f8fafc;
    line-height: 1;
}

.dashboard-donut-center span {
    font-size: 12px;
    color: #94a3b8;
}

.dashboard-donut-percent {
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 600;
}

.dashboard-driver-table {
    border: 1px solid #1f2937;
    border-radius: 12px;
    overflow: hidden;
    background-color: rgba(2, 6, 23, 0.38);
}

.dashboard-driver-head,
.dashboard-driver-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-driver-head > div {
    padding: 14px 16px;
    background-color: rgba(17, 24, 39, 0.82);
    border-right: 1px solid #1f2937;
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
}

.dashboard-driver-head > div:last-child {
    border-right: none;
}

.dashboard-driver-row {
    border-top: 1px solid #1f2937;
}

.dashboard-driver-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 16px;
    border-right: 1px solid #1f2937;
}

.dashboard-driver-row .dashboard-driver-cell:last-child {
    border-right: none;
}

.dashboard-driver-name {
    font-size: 14px;
    color: #f8fafc;
    font-weight: 500;
}

.dashboard-driver-price {
    font-size: 14px;
    color: #cbd5e1;
    font-weight: 600;
}

.dashboard-driver-price-accent {
    color: #60a5fa;
}

.dashboard-alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dashboard-alert-card {
    border: 1px solid #243244;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(18, 28, 48, 0.72) 0%, rgba(11, 17, 32, 0.88) 100%);
    padding: 14px 14px 12px;
}

.dashboard-alert-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dashboard-alert-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
}

.dashboard-alert-icon {
    color: #facc15;
}

.dashboard-alert-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background-color: rgba(99, 102, 241, 0.18);
    color: #cbd5e1;
    font-size: 11px;
    border: 1px solid rgba(99, 102, 241, 0.22);
}

.dashboard-alert-desc {
    margin-top: 10px;
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
}

.dashboard-health-mini {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #1f2937;
}

.dashboard-health-mini-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 14px;
}

.dashboard-health-mini-line {
    margin-top: 10px;
    width: 100%;
    height: 42px;
    opacity: 0.95;
}

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

.dashboard-health-stat {
    border: 1px solid #1f2937;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.38);
    padding: 14px;
}

.dashboard-health-value {
    font-size: 28px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.05;
}

.dashboard-health-label {
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.dashboard-health-chart {
    margin-top: 4px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(10, 20, 45, 0.55) 0%, rgba(11, 17, 32, 0.22) 100%);
    padding: 8px 4px 0 4px;
}

.dashboard-health-chart svg {
    width: 100%;
    height: 160px;
}

.dashboard-activity-table {
    margin-top: 0;
}

.dashboard-activity-table th {
    background-color: rgba(17, 24, 39, 0.92);
    color: #cbd5e1;
}

.dashboard-activity-table td {
    color: #e5e7eb;
}

.dashboard-cost-cell {
    color: #f8fafc;
    font-weight: 600;
}

/* =========================================================
   Input number spinner removal
========================================================= */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type='number'] {
    -moz-appearance: textfield;
}

/* =========================================================
   Responsive
========================================================= */
@media (max-width: 1440px) {
    .dashboard-top-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-kpi-side {
        grid-column: 1 / -1;
        flex-direction: row;
        gap: 12px;
        justify-content: flex-start;
        min-height: auto;
    }

    .dashboard-kpi-side-label {
        margin-top: 0;
    }
}

@media (max-width: 1200px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-panel-span-2 {
        min-height: auto;
    }
}

@media (max-width: 992px) {
    .aigw-sidebar {
        width: 232px;
    }

    .dashboard-page-header {
        flex-direction: column;
        align-items: stretch;
    }

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

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

    .dashboard-health-stats {
        grid-template-columns: 1fr;
    }

    .dashboard-driver-head,
    .dashboard-driver-row {
        grid-template-columns: 1fr;
    }

    .dashboard-driver-head > div,
    .dashboard-driver-cell {
        border-right: none;
        border-bottom: 1px solid #1f2937;
    }

    .dashboard-driver-head > div:last-child,
    .dashboard-driver-row .dashboard-driver-cell:last-child {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .aigw-shell {
        flex-direction: column;
    }

    .aigw-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(145, 167, 206, 0.18);
    }

    .aigw-header {
        min-height: auto;
        padding: 10px 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .aigw-header-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .aigw-content {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .dashboard-top-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-wrap {
        grid-template-columns: 1fr;
    }

    .dashboard-chart-yaxis {
        display: none;
    }

    .dashboard-chart-body {
        min-height: 210px;
    }
}

/* =========================================================
   Global Typography Refinement
   - final global tuning for title / menu / data / buttons
========================================================= */

/* Base text rhythm */
.aigw-body {
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Page title */
.aigw-header-title {
    font-size: 25px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* Breadcrumb */
.aigw-breadcrumb,
.aigw-breadcrumb-link,
.aigw-breadcrumb-current,
.aigw-breadcrumb-sep {
    font-size: 12px;
    font-weight: 400;
}

/* Sidebar menu */
.aigw-nav-item {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.aigw-nav-item-active {
    font-weight: 600;
}

.aigw-nav-section-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Panel / section titles */
.aigw-panel-title,
.dashboard-page-title,
.billing-detail-title {
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Descriptions / help text */
.aigw-page-header .desc,
.aigw-field-hint,
.dashboard-page-desc,
.dashboard-kpi-subtitle,
.dashboard-health-label,
.dashboard-alert-desc,
.billing-refund-message {
    font-weight: 400;
    line-height: 1.55;
}

/* Form labels */
.aigw-form-group label,
.billing-refund-reason-label {
    font-weight: 600;
}

/* Input / select / textarea text */
.aigw-input,
.aigw-select,
.aigw-textarea {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* Table header */
.aigw-table th,
.aigw-table-project .aigw-table-head th,
.dashboard-activity-table th {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* Table body data */
.aigw-table td,
.aigw-table-project .aigw-table-body tr td,
.dashboard-activity-table td,
.dashboard-driver-name,
.dashboard-driver-price,
.dashboard-driver-price-accent,
.dashboard-legend-name,
.dashboard-legend-value,
.dashboard-cost-cell {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* KPI / emphasized numeric values */
.dashboard-kpi-value,
.dashboard-health-value,
.dashboard-kpi-side-value,
.dashboard-donut-center strong {
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Button text */
.aigw-btn,
.aigw-btn-sm,
.aigw-btn-primary,
.aigw-btn-secondary,
.aigw-btn-info,
.aigw-btn-search,
.aigw-btn-danger {
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Top-right user area */
.aigw-user-name {
    font-size: 13px;
    font-weight: 600;
}

.aigw-user-plan {
    font-weight: 600;
}

/* Notice / alert */
.aigw-notice-text {
    font-weight: 400;
}

.aigw-alert-title,
.dashboard-alert-title,
.dashboard-health-mini-title,
.dashboard-kpi-title {
    font-weight: 600;
}

/* =========================================================
   Billing Page
========================================================= */
.billing-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.billing-page-alert {
    margin-bottom: 0;
}

.billing-page-section {
    margin-bottom: 0;
}

.billing-summary-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.billing-summary-main {
    flex: 1;
    min-width: 320px;
}

.billing-current-plan-name {
    font-size: 30px;
    font-weight: 700;
    color: #f9fafb;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.billing-action-row {
    margin-top: 18px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.billing-inline-form {
    margin: 0;
}

.billing-info-table {
    margin-top: 20px;
}

.billing-info-table th {
    width: 240px;
}

.billing-info-table-compact th {
    width: 150px;
}

.billing-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.billing-plan-card,
.billing-plan-detail-card {
    background: #111827;
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

.billing-plan-card-selected {
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.25);
}

.billing-plan-card-title,
.billing-plan-detail-title {
    font-size: 20px;
    font-weight: 700;
    color: #f9fafb;
}

.billing-plan-card-subtitle,
.billing-plan-detail-subtitle {
    margin-top: 8px;
    font-size: 14px;
    color: #d1d5db;
}

.billing-plan-card-price,
.billing-plan-detail-price {
    margin-top: 14px;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
}

.billing-plan-card-meta {
    margin-top: 16px;
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.8;
    flex: 1;
}

.billing-plan-card-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

.billing-plan-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.billing-section-empty {
    color: #d1d5db;
    font-size: 14px;
    line-height: 1.7;
}

.billing-history-toolbar {
    align-items: center;
    gap: 12px;
}

.billing-history-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.billing-history-search-input {
    width: 220px;
}

.billing-history-back {
    margin-left: auto;
}

.billing-col-product { width: 260px; }
.billing-col-period { width: 160px; }
.billing-col-amount { width: 140px; }
.billing-col-currency { width: 120px; }
.billing-col-status { width: 120px; }
.billing-col-paid-at { width: 180px; }
.billing-col-action { width: 120px; }

@media (max-width: 1200px) {
    .billing-plan-detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .billing-current-plan-name {
        font-size: 24px;
    }

    .billing-history-back {
        margin-left: 0;
    }

    .billing-history-search-input {
        width: 100%;
    }
}

/* =========================================================
   Billing Page - extracted from billing.html inline styles
========================================================= */
.billing-page-help {
    margin-top: 12px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.6;
}

.billing-plan-change-card {
    margin-top: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.42);
    box-shadow: none;
}

.billing-plan-change-card-body {
    padding: 16px;
}

.billing-plan-change-label {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.billing-plan-change-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #f8fafc;
}

.billing-plan-change-desc {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.7;
    margin-bottom: 12px;
}

.billing-plan-guide {
    margin-top: 10px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
}

/* =========================================================
   accountUser/list.html tuning - 2026-03-24
   - darker table header
   - reduced header height
   - brighter overall table border
   - stronger input border readability
========================================================= */
.aigw-input,
.aigw-select,
.aigw-textarea {
    border-color: #4b5563;
    background-color: #020617;
    color: #e5e7eb;
}

.aigw-input::placeholder,
.aigw-textarea::placeholder {
    color: #9ca3af;
}

.aigw-input:focus,
.aigw-select:focus,
.aigw-textarea:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 1px rgba(147, 197, 253, 0.35);
}

.aigw-table {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.55);
}

.aigw-table-project .aigw-table-head th {
    background-color: #111827;
    color: #f3f4f6;
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    line-height: 1.2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.aigw-table-project .aigw-table-head th + th,
.aigw-table-project .aigw-table-body td + td {
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.aigw-table-project .aigw-table-body tr td {
    background-color: #020617;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    padding: 9px 12px;
}

.aigw-table-project .aigw-table-body tr:last-child td {
    border-bottom: none;
}

.aigw-table-project .aigw-table-body tr:hover td {
    background-color: rgba(255, 255, 255, 0.04);
}

.aigw-table-project .aigw-table-body tr td {
    padding: 5px 12px !important;
    line-height: 1.2;
}

.aigw-table-project .aigw-table-body .aigw-btn,
.aigw-table-project .aigw-table-body .aigw-btn-sm {
    min-height: 24px !important;
    height: 24px;
    padding: 0 8px !important;
    line-height: 1;
    border-radius: 6px;
    font-size: 12px;
}

/* =========================================================
   Budget Page - extracted from current budget.html inline styles
   structure unchanged / CSS only
========================================================= */

.budget-card-spacing {
    margin-bottom: 20px;
}

.budget-header-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.budget-header-bar {
    display: inline-block;
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: rgba(255,255,255,0.5);
}

.budget-header-title {
    font-size: 18px;
    font-weight: 700;
}

.budget-card-body-top {
    padding-top: 18px;
}

.budget-section-divider {
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.budget-section-text {
    font-size: 13px;
    line-height: 1.65;
    color: #9ca3af;
}

.budget-section-text-wide {
    font-size: 13px;
    line-height: 1.75;
    color: #9ca3af;
}

.budget-section-text-wide > div + div {
    margin-top: 4px;
}

.budget-subtitle-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.budget-subtitle-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.5);
}

.budget-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: #d1d5db;
}

.budget-subtext {
    font-size: 12px;
    line-height: 1.6;
    color: #9ca3af;
}

.budget-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.budget-summary-box {
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
}

.budget-summary-box-label {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 6px;
}

.budget-summary-box-value {
    font-size: 18px;
    font-weight: 700;
    color: #f9fafb;
}

.budget-progress-panel {
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
}

.budget-progress-scale {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: #9ca3af;
}

.budget-progress-bar {
    position: relative;
    width: 100%;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.10);
}

.budget-progress-seg-0-80 {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 80%;
    background: #1f7a45;
}

.budget-progress-seg-80-90 {
    position: absolute;
    left: 80%;
    top: 0;
    height: 100%;
    width: 10%;
    background: #b88900;
}

.budget-progress-seg-90-95 {
    position: absolute;
    left: 90%;
    top: 0;
    height: 100%;
    width: 5%;
    background: #c96a1a;
}

.budget-progress-seg-95-98 {
    position: absolute;
    left: 95%;
    top: 0;
    height: 100%;
    width: 3%;
    background: #b91c1c;
}

.budget-progress-seg-98-100 {
    position: absolute;
    left: 98%;
    top: 0;
    height: 100%;
    width: 2%;
    background: #7f1d1d;
}

.budget-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(255,255,255,0.18);
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.35);
}

.budget-progress-marker {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.9);
}

.budget-progress-marker-80 { left: 80%; }
.budget-progress-marker-90 { left: 90%; }
.budget-progress-marker-95 { left: 95%; }
.budget-progress-marker-98 { left: 98%; }

.budget-progress-labels {
    position: relative;
    height: 28px;
    margin-top: 8px;
    font-size: 12px;
    color: #9ca3af;
}

.budget-progress-labels span {
    position: absolute;
}

.budget-progress-label-0 { left: 0; }
.budget-progress-label-80 { left: 78.5%; }
.budget-progress-label-90 { left: 88.5%; }
.budget-progress-label-95 { left: 93.5%; }
.budget-progress-label-98 { left: 96.5%; }
.budget-progress-label-100 { right: 0; }

.budget-threshold-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.budget-threshold-box {
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    background: rgba(255,255,255,0.02);
}

.budget-threshold-title {
    font-size: 12px;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.budget-threshold-value {
    font-size: 13px;
    color: #d1d5db;
}

.budget-form-row-lg {
    margin-bottom: 16px;
}

.budget-form-row-md {
    margin-bottom: 10px;
}

.budget-form-label-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.budget-form-label {
    font-size: 13px;
    font-weight: 700;
    color: #e5e7eb;
    margin: 0;
}

.budget-form-help-inline {
    font-size: 12px;
    line-height: 1.65;
    color: #9ca3af;
    margin-top: 4px;
}

.budget-form-action-row {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

.budget-inline-form {
    display: inline;
}

.budget-bottom-action-row {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* responsive */
@media (max-width: 1200px) {
    .budget-summary-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {
    .budget-threshold-grid {
        grid-template-columns: 1fr;
    }

    .budget-bottom-action-row,
    .budget-form-action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .budget-bottom-action-row .aigw-btn,
    .budget-form-action-row .aigw-btn {
        width: 100%;
    }
}

/* 테이블 내부의 문맥 이동 링크는 일반 화면 링크와 동일하게 흰색 텍스트로 표시한다. */
.aigw-table-link {
    color: #f8fafc;
    text-decoration: none;
    font-weight: 600;
}

.aigw-table-link:hover {
    color: #ffffff;
    text-decoration: none;
}

/* Billing / Paddle approval polish */
.aigw-btn-disabled,
.aigw-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.billing-policy-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 12px;
    color: #9ca3af;
}

.billing-policy-links a {
    color: #e5e7eb;
    text-decoration: none;
    font-weight: 600;
}

.billing-policy-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.billing-receipt-note {
    display: inline-block;
    margin-left: 8px;
    color: #9ca3af;
    font-size: 12px;
}

.billing-history-toolbar {
    gap: 8px;
}

/* Paddle approval plan guide and API usage guide */
.billing-plan-guide-card,
.billing-plan-feature-list,
.api-usage-guide {
  margin-top: 16px;
  color: #e5e7eb;
}

.billing-plan-guide-title,
.billing-plan-feature-title {
  font-weight: 700;
  margin-bottom: 6px;
  color: #ffffff;
}

.billing-plan-guide-desc,
.billing-plan-guide-common,
.billing-plan-guide-notice {
  font-size: 13px;
  color: #cbd5e1;
  margin-top: 8px;
  line-height: 1.55;
}

.billing-plan-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.billing-plan-guide-item,
.billing-plan-feature-list,
.api-usage-guide .aigw-card-body,
.api-usage-guide details {
  border: 1px solid #4b5563;
  border-radius: 12px;
  background-color: #020617;
  color: #e5e7eb;
}

.billing-plan-guide-item {
  padding: 12px;
}

.billing-plan-feature-list {
  padding: 14px 16px;
}

.api-usage-guide .aigw-card-body {
  padding: 16px;
}

.billing-plan-guide-item ul,
.billing-plan-feature-list ul,
.api-usage-guide ul {
  margin: 8px 0 0 18px;
  padding: 0;
  color: #e5e7eb;
}

.billing-plan-guide-item li,
.billing-plan-feature-list li,
.api-usage-guide li {
  color: #e5e7eb;
  line-height: 1.55;
}

.api-usage-guide pre {
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid #4b5563;
  border-radius: 10px;
  padding: 12px;
  background-color: #020617;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
}

.api-usage-guide code {
  color: #e5e7eb;
}

.api-usage-guide details {
  padding: 10px 12px;
  margin-top: 8px;
}

.api-usage-guide summary {
  cursor: pointer;
  font-weight: 600;
  color: #ffffff;
}

.api-usage-guide .aigw-field-hint {
  color: #cbd5e1;
}

/* =========================================================
   LLM Model List
   - Alias management button layout is handled in CSS, not inline HTML.
========================================================= */
.aigw-model-list-search-input {
    width: 220px;
}

.aigw-model-list-revalidate-form {
    margin-left: 8px;
    flex: 0 0 auto;
}

.aigw-model-list-new-link {
    margin-left: auto;
}

.aigw-model-list-table .aigw-model-list-actions-cell {
    width: auto;
    min-width: 0;
}

.aigw-model-list-table .aigw-table-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.aigw-model-list-table .aigw-table-actions .aigw-btn {
    flex: 0 0 auto;
}
/* =========================================================
   Status chips / badges
   - Use dark-theme chips for all list status indicators.
========================================================= */
.aigw-status-chip,
.aigw-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(15, 23, 42, 0.78);
    color: #cbd5e1;
}

.aigw-status-chip-success,
.aigw-badge-success {
    border-color: rgba(34, 197, 94, 0.36);
    background: rgba(22, 101, 52, 0.26);
    color: #bbf7d0;
}

.aigw-status-chip-info,
.aigw-badge-info,
.aigw-status-chip-secondary,
.aigw-badge-secondary {
    border-color: rgba(56, 189, 248, 0.34);
    background: rgba(14, 116, 144, 0.20);
    color: #bae6fd;
}

.aigw-status-chip-warning,
.aigw-badge-warning {
    border-color: rgba(245, 158, 11, 0.38);
    background: rgba(146, 64, 14, 0.24);
    color: #fde68a;
}

.aigw-status-chip-danger,
.aigw-badge-danger {
    border-color: rgba(248, 113, 113, 0.40);
    background: rgba(153, 27, 27, 0.28);
    color: #fecaca;
}

.aigw-status-chip-muted,
.aigw-badge-muted {
    border-color: rgba(148, 163, 184, 0.24);
    background: rgba(30, 41, 59, 0.54);
    color: #94a3b8;
}

.aigw-status-chip-locked {
    border-color: rgba(168, 85, 247, 0.38);
    background: rgba(88, 28, 135, 0.24);
    color: #e9d5ff;
}

/* Project list polish */
.aigw-page-help {
    margin: 0 0 12px;
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.5;
}

.aigw-toolbar-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.aigw-action-group,
.aigw-action-group-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.aigw-action-group-wrap,
.aigw-project-action-group {
    flex-wrap: wrap;
}

.aigw-project-list-toolbar {
    align-items: center;
}

.aigw-project-search-form {
    min-width: 0;
}

.aigw-project-search-input {
    width: 220px;
}

.aigw-project-list-table .aigw-project-actions-col {
    width: auto;
    min-width: 360px;
}

.aigw-project-name-link {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
}

.aigw-project-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
}

/* =========================================================
   Customer Project UI/UX cleanup
   - Project form, project-level budget, provider/model list polish.
========================================================= */
.aigw-project-form {
    max-width: 860px;
}

.aigw-form-section-card {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.42);
}

.aigw-form-section-card-muted {
    background: rgba(15, 23, 42, 0.28);
}

.aigw-form-section-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.aigw-form-section-marker {
    display: inline-block;
    width: 4px;
    height: 18px;
    border-radius: 999px;
    background: #38bdf8;
    margin-top: 2px;
    flex-shrink: 0;
}

.aigw-form-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #f9fafb;
    line-height: 1.35;
}

.aigw-form-section-desc {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.55;
    color: #9ca3af;
}

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

.aigw-input-readonly {
    min-height: 18px;
    background: rgba(15, 23, 42, 0.70);
    color: #cbd5e1;
    cursor: default;
}

.aigw-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.aigw-form-actions-right {
    justify-content: flex-end;
}

.aigw-form-actions-between {
    justify-content: space-between;
}

.budget-inline-alert {
    margin: 14px 0;
}

.aigw-btn-with-chip {
    gap: 7px;
}

.aigw-status-chip-compact {
    padding: 2px 7px;
    font-size: 11px;
    line-height: 1.2;
}

.aigw-project-provider-toolbar,
.aigw-project-model-toolbar {
    align-items: center;
}

.aigw-project-provider-search-form,
.aigw-project-model-search-form {
    min-width: 0;
}

.aigw-project-provider-search-input,
.aigw-project-model-search-input {
    width: 220px;
}

.aigw-project-provider-list-table .aigw-project-provider-code-col {
    width: 300px;
}

.aigw-project-provider-list-table .aigw-project-provider-name-col {
    width: 250px;
}

.aigw-project-provider-list-table .aigw-project-provider-enabled-col {
    width: 90px;
}

.aigw-project-provider-list-table .aigw-project-provider-actions-col {
    min-width: 300px;
}

.aigw-project-model-list-table .aigw-project-model-default-col,
.aigw-project-model-list-table .aigw-project-model-quality-col,
.aigw-project-model-list-table .aigw-project-model-priority-col {
    width: 90px;
}

.aigw-project-model-list-table .aigw-project-model-max-tokens-col {
    width: 110px;
}

.aigw-project-model-list-table .aigw-project-model-enabled-col {
    width: 90px;
}

.aigw-project-model-list-table .aigw-project-model-actions-col {
    width: 230px;
}



/* =========================================================
   System notification admin
   - Keeps system notification settings aligned with the shared Admin UI.
========================================================= */
.aigw-system-notification-form {
    max-width: 920px;
}

.system-notification-table .system-notification-name-col { width: 220px; }
.system-notification-table .system-notification-method-col { width: 90px; }
.system-notification-table .system-notification-group-col { width: 120px; }
.system-notification-table .system-notification-severity-col { width: 120px; }
.system-notification-table .system-notification-enabled-col { width: 100px; }
.system-notification-table .system-notification-verification-col { width: 130px; }
.system-notification-table .system-notification-updated-col { width: 170px; }
.system-notification-table .system-notification-actions-col { width: 100px; }

.system-notification-detail-toolbar {
    justify-content: flex-end;
    width: 100%;
    margin-bottom: 12px;
}

.system-notification-detail-table th {
    width: 170px;
}

.system-notification-summary-grid .aigw-summary-value {
    font-size: 18px;
}

.system-notification-summary-date {
    overflow-wrap: anywhere;
}

.system-notification-log-table th:nth-child(1) { width: 170px; }
.system-notification-log-table th:nth-child(2) { width: 90px; }
.system-notification-log-table th:nth-child(4) { width: 90px; }
.system-notification-log-table th:nth-child(5) { width: 110px; }
.system-notification-log-table th:nth-child(6) { width: 90px; }

@media (max-width: 900px) {
    .aigw-form-grid-2 {
        grid-template-columns: 1fr;
    }

    .aigw-form-actions-between {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .aigw-form-actions-between > .aigw-action-group {
        justify-content: flex-start;
    }
}

/* Project submenu UI cleanup - provider/model/price/semantic cache pages */
.aigw-project-sub-form,
.aigw-project-provider-form-page .aigw-form,
.aigw-project-model-form-page .aigw-form,
.aigw-project-model-price-form-page .aigw-form,
.aigw-semantic-cache-form-page .aigw-form {
    max-width: 920px;
}

.aigw-muted-separator {
    margin: 0 6px;
    color: #64748b;
}

.aigw-project-model-price-table {
    table-layout: fixed;
}

.aigw-project-model-price-table th,
.aigw-project-model-price-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.aigw-project-model-price-table .aigw-price-rule-col {
    width: 34%;
    text-align: left;
}

.aigw-project-model-price-table .aigw-price-option-col {
    width: 24%;
    text-align: left;
}

.aigw-project-model-price-table .aigw-price-value-col {
    width: 16%;
}

.aigw-project-model-price-table .aigw-price-active-col {
    width: 11%;
}

.aigw-project-model-price-table .aigw-price-actions-col {
    width: 15%;
}

.aigw-price-cell-title {
    color: #f8fafc;
    font-weight: 700;
    line-height: 1.25;
}

.aigw-price-cell-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.25;
}

.aigw-price-cell-label {
    color: #64748b;
}

.aigw-price-cell-label::after {
    content: ":";
    margin-right: 4px;
}

.aigw-price-cell-value {
    color: #cbd5e1;
}

.aigw-price-unit-value {
    color: #f8fafc;
    font-weight: 700;
    line-height: 1.25;
}

.aigw-price-currency {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 12px;
}

.aigw-project-model-price-page .aigw-page-help,
.aigw-project-model-price-form-page .aigw-page-help {
    margin-top: 6px;
}

/* Project API key and routing-decision submenu cleanup */
.aigw-project-api-key-toolbar,
.aigw-routing-decision-toolbar {
    align-items: center;
}

.aigw-project-api-key-search-form,
.aigw-routing-decision-search-form {
    min-width: 0;
}

.aigw-project-api-key-search-input {
    width: 200px;
}

.aigw-project-api-key-actions-col {
    width: 240px;
}

.aigw-date-range-separator {
    margin: 0 6px;
    color: #94a3b8;
}

.aigw-routing-provider-select {
    min-width: 180px;
}

.aigw-routing-request-input {
    width: 220px;
}

.aigw-routing-decision-search-form {
    gap: 8px;
}

.aigw-routing-feedback,
.aigw-routing-decision-table {
    margin-top: 12px;
}

.aigw-js-hidden {
    display: none;
}

/* Project API key submenu form cleanup */
.aigw-project-api-key-form-page .aigw-form,
.aigw-project-api-key-issued-page .aigw-form {
    max-width: 920px;
}

.aigw-api-key-security-notice {
    margin-bottom: 16px;
}

/* =========================================================
   Customer Project UI/UX cleanup v3
   - remove remaining horizontal overflow from project submenu tables
   - align demo/project auxiliary screens with the shared dark UI system
========================================================= */
.aigw-project-provider-list-table,
.aigw-project-model-list-table,
.aigw-project-api-key-table,
.aigw-routing-decision-table,
.aigw-project-demo-table {
    width: 100%;
    table-layout: fixed;
}

.aigw-project-provider-list-table th,
.aigw-project-provider-list-table td,
.aigw-project-model-list-table th,
.aigw-project-model-list-table td,
.aigw-project-api-key-table th,
.aigw-project-api-key-table td,
.aigw-routing-decision-table th,
.aigw-routing-decision-table td,
.aigw-project-demo-table th,
.aigw-project-demo-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.aigw-project-provider-list-table .aigw-project-provider-actions-col,
.aigw-project-model-list-table .aigw-project-model-actions-col,
.aigw-project-api-key-table .aigw-project-api-key-actions-col,
.aigw-project-model-price-table .aigw-price-actions-col {
    white-space: normal;
}

.aigw-project-provider-list-table .aigw-table-actions,
.aigw-project-model-list-table .aigw-table-actions,
.aigw-project-api-key-table .aigw-table-actions,
.aigw-project-model-price-table .aigw-table-actions,
.aigw-routing-decision-table .aigw-table-actions,
.aigw-project-demo-table .aigw-table-actions {
    max-width: 100%;
}

.aigw-project-model-list-table th:nth-child(1) {
    width: 13%;
}

.aigw-project-model-list-table th:nth-child(2) {
    width: 22%;
}

.aigw-project-model-list-table th:nth-child(3) {
    width: 18%;
}

.aigw-project-model-list-table .aigw-project-model-default-col,
.aigw-project-model-list-table .aigw-project-model-quality-col,
.aigw-project-model-list-table .aigw-project-model-priority-col,
.aigw-project-model-list-table .aigw-project-model-max-tokens-col,
.aigw-project-model-list-table .aigw-project-model-enabled-col {
    width: 8%;
}

.aigw-project-model-list-table .aigw-project-model-actions-col {
    width: 15%;
}

.aigw-project-api-key-table th:nth-child(1) {
    width: 17%;
}

.aigw-project-api-key-table th:nth-child(2) {
    width: 23%;
}

.aigw-project-api-key-table th:nth-child(3) {
    width: 10%;
}

.aigw-project-api-key-table th:nth-child(4),
.aigw-project-api-key-table th:nth-child(5),
.aigw-project-api-key-table th:nth-child(6) {
    width: 13%;
}

.aigw-project-api-key-table .aigw-project-api-key-actions-col {
    width: 11%;
}

.aigw-routing-decision-table th:nth-child(1) {
    width: 16%;
}

.aigw-routing-decision-table th:nth-child(2) {
    width: 22%;
}

.aigw-routing-decision-table th:nth-child(3),
.aigw-routing-decision-table th:nth-child(4),
.aigw-routing-decision-table th:nth-child(5) {
    width: 14%;
}

.aigw-routing-decision-table th:nth-child(6) {
    width: 9%;
}

.aigw-routing-decision-table th:nth-child(7) {
    width: 11%;
}

.aigw-project-demo-table .aigw-project-demo-budget-col {
    width: 9%;
}

.aigw-project-demo-page .aigw-toolbar-actions {
    margin-left: auto;
}

.aigw-demo-usage-danger {
    color: #fca5a5;
}

.aigw-demo-usage-info {
    color: #93c5fd;
}

.aigw-demo-usage-neutral {
    color: #cbd5e1;
}

@media (max-width: 1100px) {
    .aigw-project-provider-toolbar,
    .aigw-project-model-toolbar,
    .aigw-project-api-key-toolbar,
    .aigw-routing-decision-toolbar,
    .aigw-project-list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .aigw-project-provider-search-form,
    .aigw-project-model-search-form,
    .aigw-project-api-key-search-form,
    .aigw-routing-decision-search-form,
    .aigw-project-search-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .aigw-project-provider-search-input,
    .aigw-project-model-search-input,
    .aigw-project-api-key-search-input,
    .aigw-routing-request-input,
    .aigw-project-search-input {
        width: min(100%, 320px);
    }

    .aigw-toolbar-actions,
    .aigw-project-demo-page .aigw-toolbar-actions {
        margin-left: 0;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.budget-progress-fill[data-progress-percent] {
    width: 0;
}

/* Project model plan-aware UI cleanup */
.aigw-project-model-plan-fields {
    margin-bottom: 14px;
}

.aigw-plan-feature-note {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.46);
}

.aigw-plan-feature-note-title {
    color: #e5f0ff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.aigw-plan-feature-note-desc {
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.5;
}

.aigw-project-model-list-note {
    margin: 0 0 14px;
}

.aigw-project-model-list-table {
    table-layout: fixed;
}

.aigw-project-model-list-table th,
.aigw-project-model-list-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.aigw-project-model-toolbar {
    align-items: center;
}

.aigw-project-model-search-form {
    min-width: 0;
}

.aigw-project-model-search-input {
    width: 220px;
}


/* =========================================================
   Remaining customer menu UI/UX cleanup
   - Billing/Plan, Notification, Usage, Budget, Cost, Organization
   - Shared dark cards, toolbars, summary cards and column sizing
========================================================= */
.aigw-card {
    background: rgba(15, 23, 42, 0.44);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.aigw-card + .aigw-card,
.aigw-card-spaced {
    margin-top: 16px;
}

.aigw-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(17, 24, 39, 0.62);
}

.aigw-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.35;
}

.aigw-card-body {
    padding: 16px;
}

.aigw-panel-subtitle,
.aigw-text-muted {
    margin: 6px 0 0;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.55;
}

.aigw-table-meta {
    margin-bottom: 12px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.45;
}

.aigw-alert-spacing {
    margin-bottom: 12px;
}

.aigw-filter-form-wrap {
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.aigw-filter-input-sm {
    width: 220px;
}

.aigw-filter-input-md {
    width: 280px;
}

.aigw-filter-select-sm {
    width: 130px;
}

.aigw-filter-select-md {
    width: 140px;
}


.aigw-form-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.aigw-form-row .aigw-form-group {
    margin-bottom: 18px;
}

.aigw-form-group-fill {
    flex: 1 1 220px;
    min-width: 0;
}

.aigw-js-hidden {
    display: none;
}

.aigw-feedback-message {
    margin-top: 10px;
}

.aigw-button-offset-left {
    margin-left: 8px;
}

.aigw-button-offset-left-sm {
    margin-left: 6px;
}

.aigw-summary-grid {
    display: grid;
    gap: 12px;
    margin: 14px 0 18px;
}

.aigw-summary-grid-3 {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.aigw-summary-grid-4 {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.aigw-summary-card {
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 36%),
        rgba(18, 25, 35, 0.94);
}

.aigw-summary-label {
    margin-bottom: 6px;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.35;
}

.aigw-summary-value {
    color: #f8fafc;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.aigw-subtotal-row td {
    background: rgba(24, 36, 51, 0.96) !important;
    font-weight: 700 !important;
    color: #f8fafc;
}

.aigw-table-fixed {
    table-layout: fixed;
}

.aigw-table-fixed th,
.aigw-table-fixed td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.aigw-org-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.aigw-org-form,
.aigw-notification-form {
    max-width: 920px;
}

.aigw-org-invite-form {
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.aigw-org-invite-input {
    width: 360px;
    max-width: 100%;
}

.aigw-help-spacing {
    margin-top: 12px;
}

.account-notification-table .account-notification-user-col { width: 180px; }
.account-notification-table .account-notification-method-col { width: 90px; }
.account-notification-table .account-notification-enabled-col { width: 110px; }
.account-notification-table .account-notification-verification-col { width: 130px; }
.account-notification-table .account-notification-updated-col { width: 165px; }
.account-notification-table .account-notification-actions-col { width: 110px; }

.billing-project-table .billing-project-period-col { width: 120px; }
.billing-project-table .billing-project-request-col { width: 140px; }
.billing-project-table .billing-project-token-col { width: 160px; }
.billing-project-table .billing-project-cost-col { width: 160px; }
.billing-project-table .billing-project-saved-col { width: 160px; }
.billing-project-table .billing-project-rate-col { width: 140px; }

.usage-stats-table .usage-project-col { width: 260px; }
.usage-stats-table .usage-model-col { width: 180px; }
.usage-stats-table .usage-calls-col { width: 120px; }
.usage-stats-table .usage-prompt-col { width: 140px; }
.usage-stats-table .usage-completion-col { width: 160px; }
.usage-stats-table .usage-total-col { width: 140px; }
.usage-stats-table .usage-cache-col { width: 120px; }
.usage-stats-table .usage-hit-rate-col { width: 120px; }

.cost-dashboard-table .cost-project-col { width: 260px; }
.cost-dashboard-table .cost-model-col { width: 220px; }
.cost-dashboard-table .cost-hits-col { width: 140px; }
.cost-dashboard-table .cost-per-call-col { width: 160px; }
.cost-dashboard-table .cost-total-savings-col { width: 180px; }

.cost-project-table .cost-project-actions-col { width: 180px; }

.account-user-table .account-user-name-col { width: 160px; }
.account-user-table .account-user-email-col { width: 240px; }
.account-user-table .account-user-role-col { width: 110px; }
.account-user-table .account-user-status-col { width: 120px; }
.account-user-table .account-user-invitation-status-col { width: 150px; }
.account-user-table .account-user-date-col { width: 160px; }
.account-user-table .account-user-actions-col { width: 230px; }

@media (max-width: 1100px) {
    .aigw-summary-grid-3,
    .aigw-summary-grid-4 {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .aigw-filter-input-sm,
    .aigw-filter-input-md {
        width: min(100%, 320px);
    }
}

@media (max-width: 720px) {
    .aigw-summary-grid-3,
    .aigw-summary-grid-4 {
        grid-template-columns: 1fr;
    }

    .aigw-org-invite-form {
        flex-direction: column;
        align-items: stretch;
    }

    .aigw-org-invite-input,
    .aigw-org-invite-form .aigw-btn {
        width: 100%;
    }
}


/* =========================================================
   Console width / collapsible sidebar / overflow guard
   - Keeps data-heavy Billing/Usage/Cost/Budget/Organization pages inside the right workspace.
   - Sidebar state is controlled by main.js and persisted in localStorage.
========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

.aigw-sidebar-header {
    min-height: 72px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(145, 167, 206, 0.18);
}

.aigw-sidebar-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    width: 100%;
}

.aigw-sidebar-logo-full {
    display: block;
}

.aigw-sidebar-logo-mark {
    display: none;
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.aigw-sidebar-toggle {
    width: 36px;
    height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.30);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.62);
    color: #dbeafe;
    cursor: pointer;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.aigw-sidebar-toggle:hover,
.aigw-sidebar-toggle:focus {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.46);
    color: #ffffff;
    outline: none;
}

.aigw-sidebar-toggle-icon {
    font-size: 17px;
    line-height: 1;
}

.aigw-sidebar-collapsed .aigw-sidebar {
    width: 72px;
}

.aigw-sidebar-collapsed .aigw-sidebar-header {
    padding-left: 8px;
    padding-right: 8px;
}

.aigw-sidebar-collapsed .aigw-sidebar-logo-full {
    display: none;
}

.aigw-sidebar-collapsed .aigw-sidebar-logo-mark {
    display: block;
}

.aigw-sidebar-collapsed .aigw-nav {
    padding-left: 6px;
    padding-right: 6px;
}

.aigw-sidebar-collapsed .aigw-nav-section {
    margin-top: 8px;
    padding-top: 6px;
}

.aigw-sidebar-collapsed .aigw-nav-section-title {
    min-height: 18px;
    padding: 0;
    justify-content: center;
    font-size: 0;
    cursor: default;
    pointer-events: none;
}

.aigw-sidebar-collapsed .aigw-nav-section-title > span,
.aigw-sidebar-collapsed .aigw-nav-section-title::after {
    display: none;
}

.aigw-sidebar-collapsed .aigw-nav-section-items,
.aigw-sidebar-collapsed .aigw-nav-section.is-collapsed > .aigw-nav-section-items {
    max-height: none !important;
    overflow: visible;
    padding-bottom: 4px;
}

.aigw-sidebar-collapsed .aigw-sidebar .aigw-nav-section-items .aigw-nav-item,
.aigw-sidebar-collapsed .aigw-sidebar .aigw-nav-section > .aigw-nav-item,
.aigw-sidebar-collapsed .aigw-nav-item {
    min-height: 42px;
    justify-content: center;
    gap: 0;
    margin: 4px 2px;
    padding: 0;
    border-left-width: 0;
    border-radius: 12px;
}

.aigw-sidebar-collapsed .aigw-nav-item span:not(.aigw-nav-icon),
.aigw-sidebar-collapsed .aigw-nav-item-label {
    display: none;
}

.aigw-sidebar-collapsed .aigw-nav-icon {
    width: auto;
    margin: 0;
    font-size: 16px;
}

.aigw-sidebar-collapsed .aigw-nav-item-active {
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.48);
}

.aigw-panel,
.aigw-card,
.aigw-card-body,
.aigw-summary-card,
.aigw-form,
.aigw-org-form,
.aigw-notification-form {
    min-width: 0;
    max-width: 100%;
}

.aigw-panel,
.aigw-card {
    overflow-x: hidden;
}

.aigw-table,
.aigw-table-fixed,
.aigw-table-project,
.account-notification-table,
.billing-project-table,
.usage-stats-table,
.cost-dashboard-table,
.cost-project-table,
.account-user-table {
    max-width: 100%;
}

.aigw-table th,
.aigw-table td {
    min-width: 0;
}

.aigw-filter-bar,
.aigw-filter-bar form,
.aigw-inline-form,
.aigw-form-row,
.aigw-form-actions,
.aigw-toolbar-actions,
.aigw-action-group,
.aigw-action-group-wrap,
.aigw-org-actions {
    max-width: 100%;
}

.aigw-filter-bar .aigw-input,
.aigw-filter-bar .aigw-select,
.aigw-inline-form .aigw-input,
.aigw-inline-form .aigw-select {
    flex: 0 1 auto;
}

.aigw-filter-input-sm,
.aigw-filter-input-md,
.aigw-project-search-input,
.aigw-project-provider-search-input,
.aigw-project-model-search-input,
.aigw-routing-request-input,
.aigw-org-invite-input {
    max-width: 100%;
}

@media (max-width: 980px) {
    .aigw-shell {
        overflow-x: hidden;
    }

    .aigw-sidebar {
        width: 72px;
    }

    .aigw-sidebar-logo-full {
        display: none;
    }

    .aigw-sidebar-logo-mark {
        display: block;
    }

    .aigw-nav-section-title > span,
    .aigw-nav-section-title::after,
    .aigw-nav-item span:not(.aigw-nav-icon) {
        display: none;
    }

    .aigw-nav-section-items,
    .aigw-nav-section.is-collapsed > .aigw-nav-section-items {
        max-height: none !important;
    }

    .aigw-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .aigw-header-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 720px) {
    .aigw-sidebar,
    .aigw-sidebar-collapsed .aigw-sidebar {
        width: 0;
        border-right: 0;
    }

    .aigw-content {
        padding-left: 14px;
        padding-right: 14px;
    }

    .aigw-header {
        padding-left: 14px;
        padding-right: 14px;
    }
}

/* =========================================================
   Admin UI/UX cleanup helpers
   - Removes one-off inline layout styles from admin/operator pages.
   - Keeps table/filter widths predictable so long data does not push the page horizontally.
========================================================= */
.aigw-filter-action-right,
.aigw-filter-action-form-right {
    margin-left: auto;
}

.aigw-inline-action-form {
    display: inline;
}

.aigw-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.aigw-table-empty {
    text-align: center;
    color: #94a3b8;
}

.aigw-meta-card {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.42);
    color: #cbd5e1;
}

.aigw-meta-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.5;
}

.aigw-meta-label {
    min-width: 140px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.aigw-meta-value {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #e5e7eb;
}

.aigw-summary-grid-5 {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.aigw-admin-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.aigw-panel-section-title {
    margin: 0 0 12px;
    color: #f8fafc;
    font-size: 18px;
    font-weight: 700;
}

.api-usage-guide .aigw-code-block {
    position: relative;
    max-width: 100%;
    min-width: 0;
}

.api-usage-guide .aigw-code-block pre {
    margin: 0;
    padding: 40px 12px 12px;
    box-sizing: border-box;
}

.aigw-code-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 24px;
    padding: 4px 8px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.92);
    color: #e5e7eb;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.aigw-code-copy-btn:hover,
.aigw-code-copy-btn:focus {
    border-color: rgba(56, 189, 248, 0.70);
    background: rgba(30, 41, 59, 0.98);
    color: #ffffff;
    outline: none;
}

.aigw-code-copy-icon {
    line-height: 1;
}

@media (max-width: 900px) {
    .aigw-summary-grid-5 {
        grid-template-columns: 1fr;
    }

    .aigw-filter-action-right,
    .aigw-filter-action-form-right {
        margin-left: 0;
    }

    .aigw-meta-row {
        display: block;
    }

    .aigw-meta-label {
        display: block;
        min-width: 0;
        margin-bottom: 2px;
    }
}

/* Cache monitor detail cleanup */
.aigw-subsection-title {
    margin: 18px 0 8px;
    color: #f8fafc;
    font-size: 15px;
    font-weight: 700;
}

.aigw-json-preview {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 10px;
    padding: 12px;
    background: rgba(2, 6, 23, 0.60);
    color: #e5e7eb;
    font-size: 12px;
    line-height: 1.5;
    box-sizing: border-box;
}

.aigw-cache-entry-detail-table th {
    width: 180px;
}

/* =========================================================
   Client-side validation cleanup
   - Replaces browser-native validation bubbles with inline console UI messages.
========================================================= */
.aigw-input.is-invalid,
.aigw-select.is-invalid,
.aigw-textarea.is-invalid {
    border-color: #f97373;
    box-shadow: 0 0 0 1px rgba(249, 115, 115, 0.45);
}

.aigw-client-field-error {
    display: block;
    width: 100%;
    margin-top: 6px;
    color: #fca5a5;
}

.aigw-inline-form .aigw-client-field-error {
    flex-basis: 100%;
    margin-top: 0;
}

/* =========================================================
   Console layout and Slack notification UI cleanup
========================================================= */
.aigw-locale-switcher,
.aigw-locale-form {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 0.15rem;
}

.aigw-locale-label {
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
}

.aigw-locale-select {
    min-width: 110px;
    padding: 0.38rem 1.7rem 0.38rem 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 0.6rem;
    background: #0f172a;
    color: #e5e7eb;
    font-size: 0.78rem;
    outline: none;
}

.aigw-locale-select:focus {
    border-color: rgba(56, 189, 248, 0.70);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.16);
}

.aigw-key-value-table th {
    width: 220px;
    min-width: 180px;
    white-space: nowrap;
}

.aigw-input-full {
    width: 100%;
    max-width: none;
}

.aigw-input-md {
    width: 100%;
    max-width: 420px;
}

.aigw-checkbox-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.aigw-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e5e7eb;
    font-size: 13px;
    line-height: 1.4;
}

.aigw-inline-form {
    display: inline-flex;
    margin: 0;
}

.aigw-col-xs {
    width: 90px;
}

.aigw-col-sm {
    width: 130px;
}

.aigw-col-datetime {
    width: 170px;
}

.aigw-break-word {
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 900px) {
    .aigw-key-value-table th,
    .aigw-key-value-table td {
        display: block;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .aigw-key-value-table th {
        border-right: 0;
    }

    .aigw-checkbox-group {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

