* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern gradient-inspired color palette */
    --page-bg: #EAEDED;
    --background-overlay: rgba(15, 30, 50, 0.38);
    --topbar-bg: #232F3E;
    --topbar-bg-hover: #2E3D50;
    --topbar-border: #16191F;
    --topbar-text: #FFFFFF;
    --topbar-text-secondary: #B6BEC9;

    --bg-elevated: #FFFFFF;
    --bg-card-hover: #FAFAFA;
    --bg-subtle: #F2F3F3;
    --border: #D5DBDB;
    --border-light: #E9EBED;

    --text-primary: #16191F;
    --text-secondary: #5F6B7A;
    --text-muted: #8D99A8;

    --brand-orange: #FF9900;
    --brand-gradient: linear-gradient(135deg, #FF9900 0%, #FFB84D 100%);

    --primary: #0972D3;
    --primary-hover: #075BB5;
    --primary-active: #033160;
    --primary-bg: #F0FBFF;
    --primary-gradient: linear-gradient(135deg, #0972D3 0%, #0C5BBF 100%);

    --success: #037F51;
    --success-bg: #EDFBF3;
    --success-gradient: linear-gradient(135deg, #037F51 0%, #04A76A 100%);

    --danger: #D91515;
    --danger-bg: #FDF3F1;
    --danger-gradient: linear-gradient(135deg, #D91515 0%, #E82525 100%);

    --warning: #8D6605;
    --warning-bg: #FFFAEB;
    --warning-gradient: linear-gradient(135deg, #8D6605 0%, #B8860B 100%);

    --info: #0972D3;
    --info-bg: #F0FBFF;

    --shadow-sm: 0 1px 2px rgba(0, 7, 22, 0.07);
    --shadow: 0 2px 8px rgba(0, 7, 22, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 7, 22, 0.14);
    --shadow-glow: 0 4px 16px rgba(9, 114, 211, 0.15);
    --radius: 8px;
    --radius-sm: 6px;
}

body.dark-theme {
    --page-bg: #2a3142;
    --background-overlay: rgba(10, 18, 32, 0.82);
    --topbar-bg: #0B1220;
    --topbar-bg-hover: #1F2937;
    --topbar-border: #334155;
    --topbar-text: #F8FAFC;
    --topbar-text-secondary: #CBD5E1;

    --bg-elevated: #1E293B;
    --bg-card-hover: #263449;
    --bg-subtle: #162235;
    --border: #334155;
    --border-light: #2A3A50;

    --text-primary: #F1F5F9;
    --text-secondary: #B6C2D2;
    --text-muted: #8291A7;

    --primary: #5DADE2;
    --primary-hover: #87C7F3;
    --primary-active: #B9E4FF;
    --primary-bg: #14324A;

    --success: #4ADE80;
    --success-bg: #123525;
    --danger: #FB7185;
    --danger-bg: #431C28;
    --warning: #FBBF24;
    --warning-bg: #40300C;
    --info: #5DADE2;
    --info-bg: #14324A;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);

    --bg-image-opacity: 0.7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--page-bg);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

body:not(.dark-theme) {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/inventory-background.png') center / cover no-repeat;
    opacity: var(--bg-image-opacity, 0.08);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

header {
    background: linear-gradient(135deg, var(--topbar-bg) 0%, #1a2634 100%);
    padding: 16px 24px;
    margin-bottom: 24px;
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--topbar-border);
    position: relative;
    overflow: visible;
    z-index: 100;
}

/* Removed shimmer animation to prevent page shaking */

h1 {
    color: var(--topbar-text);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 18px;
}

.account-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.account-selector label {
    font-weight: 600;
    color: var(--topbar-text-secondary);
    font-size: 13px;
}

.account-selector select {
    padding: 7px 12px;
    border: 1px solid #414D5C;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--topbar-bg-hover);
    color: var(--topbar-text);
    cursor: pointer;
    min-width: 190px;
    transition: border-color 0.15s ease;
}

.account-selector select:hover {
    border-color: #6B7889;
}

.account-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.multi-select {
    position: relative;
}

.multi-select-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 12px;
    border: 1px solid #414D5C;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--topbar-bg-hover);
    color: var(--topbar-text);
    cursor: pointer;
    min-width: 190px;
    transition: border-color 0.15s ease;
}

.multi-select-toggle:hover {
    border-color: #6B7889;
}

.multi-select-toggle svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.multi-select-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 240px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 1000;
}

.multi-select-panel.show {
    display: block;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}

.multi-select-option:hover {
    background: var(--bg-subtle);
}

.multi-select-option input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.multi-select-all {
    font-weight: 600;
}

.multi-select-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 2px;
}

.logout-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--topbar-text);
    border: 1px solid #414D5C;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 34px;
    padding: 0;
    background: transparent;
    color: var(--topbar-text);
    border: 1px solid #414D5C;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.theme-icon {
    font-size: 18px;
    line-height: 1;
}

.theme-toggle:hover {
    border-color: #6B7889;
    background: var(--topbar-bg-hover);
}

.logout-btn:hover {
    border-color: #6B7889;
    background: var(--topbar-bg-hover);
}

.logout-btn:active {
    transform: none;
}

.dashboard-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 24px 26px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.dashboard-section:hover {
    box-shadow: var(--shadow-lg);
}

.service-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 5px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    z-index: 0;
}

.service-tab {
    flex: 1;
    padding: 11px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease;
}

.service-tab:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.service-tab.active {
    background: var(--primary-gradient);
    color: #FFFFFF;
    box-shadow: var(--shadow-glow);
}

.service-section {
    display: none;
}

.service-section.active {
    display: block;
}

h2 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.service-icon {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.service-icon:hover {
    transform: none;
}

.ec2-icon {
    background: linear-gradient(135deg, #FF9900 0%, #FFB84D 100%);
    border-color: #FF9900;
}

.rds-icon {
    background: linear-gradient(135deg, #0972D3 0%, #0C5BBF 100%);
    border-color: #0972D3;
}

.eks-icon {
    background: linear-gradient(135deg, #5DADE2 0%, #87C7F3 100%);
    border-color: #5DADE2;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 22px;
    overflow: hidden;
}

.stat-card {
    background: var(--bg-elevated);
    padding: 16px 20px;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transition: background 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow);
}

.stat-card.running::before,
.stat-card.available::before {
    background: var(--success);
}

.stat-card.stopped::before {
    background: var(--danger);
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    display: block;
    font-size: 26px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.stat-card.running .stat-value,
.stat-card.available .stat-value {
    color: var(--success);
}

.stat-card.stopped .stat-value {
    color: var(--danger);
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-subtle);
}

th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    white-space: nowrap;
}

td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 14px;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.1s ease;
}

tbody tr:hover {
    background: var(--primary-bg);
}

/* Status shown as a colored dot + text, matching Console's StatusIndicator
   pattern, instead of a filled pill badge. */
.state-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
}

.state-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.state-running,
.state-available {
    color: var(--success);
}

.state-running::before,
.state-available::before {
    background: var(--success);
}

.state-stopped {
    color: var(--danger);
}

.state-stopped::before {
    background: var(--danger);
}

.state-pending,
.state-stopping,
.state-starting {
    color: var(--warning);
}

.state-pending::before,
.state-stopping::before,
.state-starting::before {
    background: var(--warning);
}

.state-other {
    color: var(--text-secondary);
}

.state-other::before {
    background: var(--text-muted);
}

.region-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}

.actions {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 5px 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    background: var(--bg-elevated);
}

.btn-start {
    color: var(--primary);
    border: 1px solid var(--primary);
    background: var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

.btn-start::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-start:hover::before {
    width: 200%;
    height: 200%;
}

.btn-start:hover {
    background: var(--primary-gradient);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(9, 114, 211, 0.3);
}

.btn-stop {
    color: var(--danger);
    border: 1px solid var(--danger);
    background: var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

.btn-stop::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn-stop:hover::before {
    width: 200%;
    height: 200%;
}

.btn-stop:hover {
    background: var(--danger-gradient);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(217, 21, 21, 0.3);
}

.btn-metrics {
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    background: var(--bg-elevated);
}

.btn-metrics:hover {
    background: var(--primary-gradient);
    color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(9, 114, 211, 0.3);
}

.btn:disabled {
    background: var(--bg-subtle);
    color: var(--text-muted);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.8;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    font-style: italic;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    border-left: 4px solid var(--info);
    background: var(--bg-elevated);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.notification.show {
    opacity: 1;
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.info {
    border-left-color: var(--info);
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Node Groups */
.nodegroups-container {
    padding: 16px;
    background: var(--bg-subtle);
    border-radius: var(--radius-sm);
}

.nodegroup-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.15s ease;
}

.nodegroup-card:last-child {
    margin-bottom: 0;
}

.nodegroup-card:hover {
    box-shadow: var(--shadow);
}

.nodegroup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.nodegroup-header strong {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 700;
}

.nodegroup-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.nodegroup-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.info-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
}

.nodegroup-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-view-nodegroups {
    color: var(--primary);
    border: 1px solid var(--primary);
    background: var(--bg-elevated);
}

.btn-view-nodegroups:hover {
    background: var(--primary);
    color: #FFFFFF;
}

.btn-scale-up {
    color: var(--success);
    border: 1px solid var(--success);
    background: var(--bg-elevated);
}

.btn-scale-up:hover:not(:disabled) {
    background: var(--success);
    color: #FFFFFF;
}

.btn-scale-down {
    color: var(--danger);
    border: 1px solid var(--danger);
    background: var(--bg-elevated);
}

.btn-scale-down:hover:not(:disabled) {
    background: var(--danger);
    color: #FFFFFF;
}

/* Underline tabs, matching Console's Tabs component */
.region-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.region-tab {
    padding: 10px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s ease;
}

.region-tab:hover {
    color: var(--text-primary);
}

.region-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.region-section {
    margin-bottom: 24px;
}

.region-header {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    color: var(--text-secondary);
    font-size: 13px;
}

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

.pagination-button {
    padding: 6px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.pagination-button:hover:not(:disabled) {
    background: var(--primary-bg);
}

.pagination-button:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    background: var(--bg-subtle);
}

.pagination-page {
    white-space: nowrap;
}

/* CPU metrics modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 21, 30, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-elevated);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    background: var(--bg-subtle);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.cpu-ranges {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.cpu-range-btn {
    padding: 6px 13px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
    transition: all 0.15s ease;
}

.cpu-range-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.cpu-range-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.cpu-current {
    margin-bottom: 16px;
}

.cpu-current-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    margin-right: 10px;
}

.cpu-current-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.cpu-chart svg {
    width: 100%;
    height: auto;
    display: block;
}

.cpu-chart-grid {
    stroke: var(--border);
    stroke-width: 1;
}

.cpu-chart-axis-label {
    fill: var(--text-muted);
    font-size: 11px;
}

.cpu-chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.cpu-chart-area {
    fill: var(--primary-bg);
    stroke: none;
}

.cpu-status {
    text-align: center;
    color: var(--text-secondary);
    padding: 12px 0;
    font-size: 14px;
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 16px;
        padding: 14px;
        gap: 12px;
    }

    h1 {
        font-size: 15px;
    }

    .header-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .account-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .account-selector label {
        font-size: 12px;
    }

    .account-selector select,
    .multi-select-toggle {
        width: 100%;
        min-width: unset;
        font-size: 12px;
    }

    .theme-toggle,
    .logout-btn {
        width: 100%;
        padding: 10px;
        font-size: 12px;
    }

    .service-tabs {
        margin-bottom: 16px;
    }

    .service-tab {
        padding: 12px 8px;
        font-size: 13px;
    }

    .dashboard-section {
        padding: 16px;
        margin-bottom: 16px;
    }

    h2 {
        font-size: 15px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        margin-bottom: 16px;
    }

    .stat-card {
        padding: 12px 14px;
    }

    .stat-label {
        font-size: 11px;
    }

    .stat-value {
        font-size: 22px;
    }

    .region-tabs {
        margin-bottom: 14px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .region-tab {
        padding: 8px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 11px;
        min-width: 600px;
    }

    th, td {
        padding: 8px 10px;
        font-size: 11px;
    }

    th {
        font-size: 10px;
    }

    .btn {
        padding: 6px 10px;
        font-size: 11px;
        white-space: nowrap;
    }

    .actions {
        flex-direction: column;
        gap: 6px;
    }

    .pagination {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .pagination-summary {
        font-size: 12px;
    }

    /* Node Groups Mobile */
    .nodegroups-container {
        padding: 12px;
    }

    .nodegroup-card {
        padding: 14px;
        margin-bottom: 10px;
    }

    .nodegroup-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .nodegroup-header strong {
        font-size: 14px;
    }

    .nodegroup-details {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 12px;
    }

    .nodegroup-actions {
        flex-direction: column;
        gap: 8px;
    }

    .nodegroup-actions .btn {
        width: 100%;
        padding: 10px;
        font-size: 12px;
    }

    /* Modal Mobile */
    .modal-overlay {
        padding: 10px;
    }

    .modal {
        max-width: 100%;
    }

    .modal-header {
        padding: 16px;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .modal-subtitle {
        font-size: 12px;
    }

    .modal-body {
        padding: 16px;
    }

    .cpu-ranges {
        gap: 4px;
    }

    .cpu-range-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .cpu-current-value {
        font-size: 26px;
    }

    /* Notification Mobile */
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        padding: 12px 16px;
        font-size: 13px;
        opacity: 0;
    }

    .notification.show {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 12px;
    }

    h1 {
        font-size: 14px;
    }

    .dashboard-section {
        padding: 14px;
    }

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

    .stat-value {
        font-size: 20px;
    }

    table {
        min-width: 500px;
    }

    th, td {
        padding: 6px 8px;
    }

    .btn {
        padding: 5px 8px;
        font-size: 10px;
    }

    .service-tab {
        padding: 10px 6px;
        font-size: 12px;
    }
}
