[v-cloak] { display: none; }

body {
    min-height: 100vh;
    margin: 0;
    background: #fff;
}

:root {
    --table-copy-width: 280px;
    --table-compact-copy-width: 220px;
    --table-remark-width: 140px;
}

.app-container {
    width: min(80vw, 1200px);
    margin: 0 auto;
}

.app-main {
    padding: 28px 0 48px;
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}

.app-brand-nav {
    min-width: 0;
    flex: 1;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    white-space: nowrap;
}

.app-menu {
    flex: 1;
    min-width: 360px;
    border-bottom: 0;
}

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

.page-toolbar.compact {
    margin-bottom: 16px;
}

.page-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.page-actions .ant-input-search {
    width: min(280px, 100%);
}

.stacked-page {
    display: grid;
    gap: 16px;
}

.dashboard-stat-grid {
    margin-bottom: 24px;
}

.dashboard-stat-card,
.resource-section-card,
.aws-control-card {
    border-radius: 10px;
}

.operation-toolbar {
    display: grid;
    gap: 14px;
}

.operation-titlebar {
    margin-bottom: 0;
}

.operation-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.table-section-card {
    max-width: 100%;
    overflow: hidden;
}

.table-section-card .ant-table-wrapper {
    max-width: 100%;
    min-width: 0;
}

.ip-cell {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.ip-cell .ant-typography {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.instance-table .ant-table-cell {
    white-space: nowrap;
}

.instance-table .ant-table-cell .ant-space {
    flex-wrap: nowrap;
}

.instance-table .ip-wrap-cell,
.instance-table .ip-wrap-cell .ip-cell {
    white-space: normal;
}

.region-zone-cell {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.35;
}

.region-zone-cell-zone {
    color: #9ca3af;
    font-size: 12px;
}

.dashboard-stat-card .ant-statistic-content {
    font-size: 28px;
    line-height: 1;
}

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

.account-region-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff 0%, #fafcff 100%);
}

.account-region-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.account-region-account {
    min-width: 0;
    overflow: hidden;
    color: #1f1f1f;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-region-rows {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.account-region-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #fafafa;
    white-space: nowrap;
}

.account-region-title {
    font-weight: 500;
}

.account-region-count {
    color: #8c8c8c;
    font-size: 12px;
}

.section-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.adaptive-toolbar {
    margin-bottom: 0;
}

.aws-toolbar-controls {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    min-width: 0;
}

.toolbar-control {
    width: min(220px, 100%);
    min-width: 180px;
}

.aws-inline-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.instance-list-toolbar {
    align-items: center;
}

.billing-summary-row td {
    background: #fafafa !important;
    font-weight: 600;
}

.ant-layout-header .ant-menu {
    overflow-x: auto;
    overflow-y: hidden;
}

.ant-layout-header .ant-menu::-webkit-scrollbar {
    display: none;
}

.provider-card .ant-card-meta-title {
    margin-bottom: 4px;
}

.copy-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
}

.truncate-text {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    max-width: var(--table-copy-width);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-button {
    flex: 0 0 auto;
    padding: 0;
    color: #8c8c8c;
}

.copy-button:hover,
.copy-button:focus {
    color: #595959;
}

.break-text {
    word-break: break-all;
}

.nowrap-cell {
    white-space: nowrap;
}

.table-remark {
    max-width: var(--table-remark-width);
}

.modal-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.modal-form-actions-main {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.account-form-actions {
    margin-top: 4px;
}

.form-helper-text {
    display: block;
    margin-top: 6px;
}

.batch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #f5f7fb;
    border: 1px solid #e6eaf2;
    border-radius: 8px;
}

.ant-table-pagination.ant-pagination {
    align-items: center;
}

.ant-table-pagination .ant-pagination-options {
    order: -1;
    margin-inline-start: 0;
    margin-inline-end: 8px;
}

@media (max-width: 640px) {
    .app-container {
        width: calc(100vw - 24px);
    }

    .app-main {
        padding: 18px 0 32px;
    }

    .app-header-inner {
        height: auto;
        min-height: 64px;
        align-items: flex-start;
        padding: 10px 0;
    }

    .app-brand-nav {
        display: block !important;
    }

    .app-brand {
        margin-bottom: 8px;
    }

    .app-menu {
        width: calc(100vw - 72px);
        min-width: 0;
    }

    .ant-layout-header .ant-menu-horizontal > .ant-menu-item,
    .ant-layout-header .ant-menu-horizontal > .ant-menu-submenu {
        padding-inline: 10px;
    }

    .page-toolbar {
        display: block;
        margin-bottom: 16px;
    }

    .section-toolbar,
    .adaptive-toolbar {
        display: block;
    }

    .page-actions {
        display: flex;
        flex-wrap: wrap;
        margin-top: 16px;
    }

    .aws-toolbar-controls {
        justify-content: stretch;
    }

    .operation-controls {
        align-items: stretch;
    }

    .toolbar-control {
        width: 100%;
        min-width: 0;
    }

    .aws-inline-controls {
        width: 100%;
        justify-content: stretch;
    }

    .page-actions .ant-btn,
    .page-actions .ant-input-search,
    .page-actions .toolbar-control {
        flex: 1 1 auto;
        min-width: 0;
    }

    .aws-toolbar-controls .ant-btn {
        flex: 1 1 30%;
    }

    .operation-controls .ant-btn {
        flex: 1 1 auto;
    }

    .ant-modal {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px);
    }

    .ant-modal-content {
        max-width: 100%;
    }

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

    .table-section-card .ant-card-body {
        padding-inline: 12px;
    }

    .truncate-text {
        max-width: var(--table-compact-copy-width);
    }

    .batch-toolbar,
    .modal-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .modal-form-actions-main {
        justify-content: stretch;
    }

    .modal-form-actions-main .ant-btn {
        flex: 1;
    }
}
