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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #fcf9ff 0%, #f5f0ff 100%);
    color: #1d1d20;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0 30px;
    background: linear-gradient(135deg, #A14AE5 0%, #8B39C6 100%);
    box-shadow: 0 4px 12px rgba(161, 74, 229, 0.2);
    position: relative;
}

#admin-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}

#admin-nav a {
    transition: all 0.2s ease;
}

#admin-nav a:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.header-logo {
    height: 50px;
    width: auto;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

h1 {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#status-summary {
    /* Styles moved to .status-banner class */
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background-color: #ffffff;
    border-radius: 12px;
    font-weight: 500;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.up {
    background-color: #34c759;
}

.status-indicator.down {
    background-color: #ff3b30;
}

.status-text {
    font-size: 16px;
}

.status-container {
    margin-bottom: 40px;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 20px 28px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(74, 124, 247, 0.1);
}

.category-title,
#applications-container > h2 {
    font-size: 28px;
    font-weight: 700;
    flex-grow: 1;
    color: #1d1d20;
    margin-bottom: 24px;
}

.status-grid,
.applications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.status-item-full,
.application-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(74, 124, 247, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status-item-full:hover,
.application-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74, 124, 247, 0.15);
}

.status-name,
.application-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1d1d20;
}

.application-card p {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
}

.status-indicator-small {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator-small.up,
.up {
    background-color: #34c759;
    color: #34c759;
    font-weight: 700;
}

.status-indicator-small.down,
.down {
    background-color: #ff3b30;
    color: #ff3b30;
    font-weight: 700;
}

.status-indicator-small.degraded,
.degraded {
    background-color: #ff9500;
    color: #ff9500;
    font-weight: 700;
}

.status-indicator-small.unknown,
.unknown {
    background-color: #8e8e93;
    color: #8e8e93;
    font-weight: 700;
}

.status-details {
    font-size: 14px;
    color: #6e6e73;
    margin-top: 5px;
}

footer {
    text-align: center;
    padding: 32px 20px;
    margin-top: 40px;
    border-top: 2px solid rgba(74, 124, 247, 0.1);
    color: #6e6e73;
    font-size: 14px;
}

footer p {
    margin: 8px 0;
}

footer p:first-child {
    font-weight: 600;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

/* Admin Sub-Tabs */
.admin-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.admin-tab-btn {
    padding: 12px 24px;
    background: #ffffff;
    border: 2px solid rgba(161, 74, 229, 0.2);
    border-radius: 12px;
    color: #6e6e73;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.admin-tab-btn:hover {
    background: rgba(161, 74, 229, 0.05);
    border-color: rgba(161, 74, 229, 0.4);
    color: #A14AE5;
}

.admin-tab-btn.active {
    background: linear-gradient(135deg, #A14AE5 0%, #8B39C6 100%);
    border-color: #A14AE5;
    color: white;
    box-shadow: 0 4px 12px rgba(161, 74, 229, 0.3);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.tab-link {
    padding: 12px 20px;
    text-decoration: none;
    color: #6e6e73;
    font-weight: 500;
    border-bottom: 2px solid transparent;
}

.tab-link.active {
    color: #A14AE5;
    border-bottom-color: #A14AE5;
}

.tab-link:hover {
    color: #A14AE5;
    background: rgba(161, 74, 229, 0.05);
}

/* KPI Section */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.kpi-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(74, 124, 247, 0.1);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74, 124, 247, 0.15);
}

.kpi-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #6e6e73;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 36px;
    font-weight: 700;
    margin-top: 12px;
    background: linear-gradient(135deg, #A14AE5 0%, #8B39C6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Charts */
#charts-container {
    margin-bottom: 40px;
}

.chart-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(74, 124, 247, 0.1);
    margin-bottom: 30px;
}

.chart-wrapper h2 {
    margin-bottom: 20px;
}

.chart-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.chart-container.line-chart {
    height: 300px;
}

.chart-container.doughnut-chart {
    height: 400px;
    max-width: 500px;
}

#charts-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Event List Table */
.event-list {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(74, 124, 247, 0.1);
}

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

#events-table th,
#events-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

#events-table th {
    background-color: #f5f5f7;
    font-weight: 600;
    color: #1d1d20;
}

#events-table tr:hover {
    background-color: #f9f9fa;
}

/* Children Container Styling */
.children-container {
    margin-top: 20px;
    padding: 20px;
    background: rgba(74, 124, 247, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(74, 124, 247, 0.1);
}

.children-container h4 {
    font-size: 16px;
    font-weight: 600;
    color: #A14AE5;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.children-container ul {
    list-style: none;
    padding: 0;
}

.children-container li {
    padding: 12px 16px;
    margin: 8px 0;
    background: #ffffff;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s ease;
}

.children-container li:hover {
    transform: translateX(4px);
}

.children-container li strong {
    color: #1d1d20;
    font-weight: 600;
}

/* Additional Polish */
h2 {
    color: #1d1d20;
}

a {
    color: #A14AE5;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #8B39C6;
}

/* Admin Page Specific Styles */
.admin-section {
    margin-bottom: 48px;
}

.admin-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1d1d20;
}

.admin-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(74, 124, 247, 0.1);
    margin-bottom: 24px;
}

.admin-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1d1d20;
}

.admin-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d20;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    padding: 14px 16px;
    border: 2px solid rgba(74, 124, 247, 0.2);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: #ffffff;
    color: #1d1d20;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #A14AE5;
    box-shadow: 0 0 0 4px rgba(74, 124, 247, 0.1);
}

.form-group input::placeholder {
    color: #8e8e93;
}

/* Buttons */
.btn-primary,
.btn-danger {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #A14AE5 0%, #8B39C6 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 124, 247, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 124, 247, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(135deg, #ff3b30 0%, #ff453a 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.3);
    padding: 10px 20px;
    font-size: 14px;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 59, 48, 0.4);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-copy {
    background: #A14AE5;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s ease;
    font-family: inherit;
}

.btn-copy:hover {
    background: #8B39C6;
}

code {
    background: #f5f5f7;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
}

/* Applications Table */
.applications-table-container {
    overflow-x: auto;
}

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

#apps-table th,
#apps-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(74, 124, 247, 0.1);
}

#apps-table th {
    background: rgba(74, 124, 247, 0.05);
    font-weight: 600;
    color: #A14AE5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
}

#apps-table tr:hover {
    background: rgba(74, 124, 247, 0.02);
}

#apps-table td strong {
    color: #1d1d20;
    font-weight: 600;
}

/* Token Management Styles */
#tokens-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#tokens-table th,
#tokens-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(161, 74, 229, 0.1);
}

#tokens-table th {
    background: rgba(161, 74, 229, 0.05);
    font-weight: 600;
    color: #A14AE5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    white-space: nowrap;
}

#tokens-table tbody tr {
    transition: background 0.2s ease;
}

#tokens-table tbody tr:hover {
    background: rgba(161, 74, 229, 0.02);
}

#tokens-table td {
    vertical-align: middle;
}

.token-name {
    font-weight: 600;
    color: #1d1d20;
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
}

.token-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.token-value {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    background: #f5f5f7;
    padding: 6px 12px;
    border-radius: 6px;
    color: #1d1d20;
    border: 1px solid rgba(161, 74, 229, 0.1);
}

.token-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.token-btn-copy {
    background: #A14AE5;
    color: white;
}

.token-btn-copy:hover {
    background: #8B39C6;
    transform: translateY(-1px);
}

.token-btn-reveal {
    background: #f5f5f7;
    color: #A14AE5;
    border: 1px solid rgba(161, 74, 229, 0.2);
}

.token-btn-reveal:hover {
    background: rgba(161, 74, 229, 0.1);
}

.token-creator {
    color: #6e6e73;
    font-size: 13px;
}

.token-date {
    color: #1d1d20;
    font-size: 13px;
}

.token-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.token-status.active {
    background: rgba(52, 199, 89, 0.1);
    color: #34c759;
}

.token-status.inactive {
    background: rgba(142, 142, 147, 0.1);
    color: #8e8e93;
}

.token-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.token-actions .btn-primary {
    padding: 8px 16px;
    font-size: 13px;
}

.token-actions .btn-danger {
    padding: 8px 16px;
    font-size: 13px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    color: #ffffff;
}

.notification-error {
    background: linear-gradient(135deg, #ff3b30 0%, #ff453a 100%);
    color: #ffffff;
}

/* Apple-style Status Page */
/* KPI Section */
.kpi-container {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.kpi-card {
    flex: 1;
    min-width: 200px;
    padding: 24px 28px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(161, 74, 229, 0.1);
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(161, 74, 229, 0.15);
}

.kpi-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b6b7a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 36px;
    font-weight: 700;
    color: #1d1d20;
    line-height: 1.2;
}

.kpi-value.uptime {
    color: #A14AE5;
}

.kpi-unit {
    font-size: 20px;
    font-weight: 600;
    color: #6b6b7a;
    margin-left: 4px;
}

.status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
    padding: 32px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(74, 124, 247, 0.1);
}

.status-banner-ok {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8f4 100%);
    border-color: rgba(52, 199, 89, 0.2);
}

.status-banner-warning {
    background: linear-gradient(135deg, #fff8e5 0%, #fffaeb 100%);
    border-color: rgba(255, 149, 0, 0.2);
}

.status-banner-error {
    background: linear-gradient(135deg, #ffe5e5 0%, #ffebeb 100%);
    border-color: rgba(255, 59, 48, 0.2);
}

.status-banner-maintenance {
    background: linear-gradient(135deg, #e8f0ff 0%, #f0f5ff 100%);
    border-color: rgba(74, 124, 247, 0.3);
}

.status-icon-large {
    font-size: 48px;
    line-height: 1;
}

.status-banner p {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.status-ok {
    color: #1d1d20;
}

.status-warning {
    color: #1d1d20;
}

.status-error {
    color: #1d1d20;
}

.status-maintenance-text {
    color: #1d1d20;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.service-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 36px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(74, 124, 247, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 80px;
    gap: 20px;
}

.service-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(74, 124, 247, 0.15);
}

.service-name {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d20;
    flex: 1;
    line-height: 1.4;
}

.service-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-dot {
    font-size: 20px;
    line-height: 1;
}

.status-label {
    font-weight: 600;
}

.status-up .status-dot,
.status-up .status-label {
    color: #34c759;
}

.status-down .status-dot,
.status-down .status-label {
    color: #ff3b30;
}

.status-degraded .status-dot,
.status-degraded .status-label {
    color: #ff9500;
}

.status-unknown .status-dot,
.status-unknown .status-label {
    color: #8e8e93;
}

.status-maintenance .status-dot,
.status-maintenance .status-label {
    color: #4A7CF7;
}

.error-message,
.no-services {
    text-align: center;
    padding: 60px 20px;
    color: #6e6e73;
    font-size: 18px;
}

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

    h1 {
        font-size: 32px;
    }

    header {
        padding: 30px 0 24px;
    }

    .kpi-container {
        flex-direction: column;
    }

    .kpi-card {
        min-width: 100%;
    }

    .kpi-value {
        font-size: 32px;
    }

    .status-grid,
    .applications-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-link {
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 5px;
    }

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

    .application-card,
    .status-item-full,
    .kpi-card,
    .event-list,
    .admin-card {
        padding: 20px;
    }

    .admin-section h2 {
        font-size: 24px;
    }

    .btn-primary,
    .btn-danger {
        width: 100%;
    }

    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }

    #apps-table th,
    #apps-table td {
        padding: 12px;
        font-size: 14px;
    }

    #tokens-table {
        font-size: 13px;
    }

    #tokens-table th,
    #tokens-table td {
        padding: 12px 8px;
    }

    .token-cell {
        flex-direction: column;
        align-items: flex-start;
    }

    .token-value {
        font-size: 11px;
        padding: 4px 8px;
    }

    .token-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .token-actions {
        flex-direction: column;
        width: 100%;
    }

    .token-actions button {
        width: 100%;
    }

    .admin-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .admin-tab-btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    #admin-nav {
        position: static !important;
        justify-content: center;
        margin-top: 16px;
        gap: 6px;
    }

    #admin-nav a {
        font-size: 12px;
        padding: 6px 12px;
    }

    .status-banner {
        padding: 24px 20px;
        flex-direction: column;
        text-align: center;
    }

    .status-icon-large {
        font-size: 36px;
    }

    .status-banner p {
        font-size: 18px;
    }

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

    .service-row {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .service-name {
        font-size: 16px;
    }

    .service-status {
        font-size: 15px;
    }
}

/* Tab Navigation Styles */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 2px solid rgba(161, 74, 229, 0.1);
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: #A14AE5;
}

.tab-button.active {
    color: #A14AE5;
    border-bottom-color: #A14AE5;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Preview Environments Styles */
.preview-environments {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.preview-env-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.preview-env-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(161, 74, 229, 0.15);
}

.preview-env-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(161, 74, 229, 0.1);
}

.preview-env-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d20;
    margin: 0;
}

.preview-env-status {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.preview-env-section {
    margin: 16px 0;
}

.preview-env-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.preview-list li {
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.preview-list li:last-child {
    border-bottom: none;
}

.preview-list a {
    color: #A14AE5;
    text-decoration: none;
    font-weight: 500;
}

.preview-list a:hover {
    text-decoration: underline;
}

.deployment-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.deployment-details {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.preview-pods-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.pod-name {
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

.pod-phase {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.preview-env-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.preview-env-footer small {
    font-size: 12px;
    color: #999;
}

#preview-status-summary {
    margin-bottom: 24px;
}

/* Component status styles */
.component-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 8px;
}

.component-label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.component-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.status-na {
    background-color: #e0e0e0;
    color: #666;
}

/* Preview URL styling */
.preview-url {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #A14AE5;
}

.preview-url a {
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
}

/* Issues section */
.preview-issues {
    background: #fff3cd;
    border-radius: 6px;
    padding: 12px;
    border-left: 3px solid #ffc107;
}

.preview-issues h4 {
    color: #856404;
}

.issue-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
}

.issue-list li {
    padding: 4px 0;
    color: #856404;
    font-size: 13px;
}

/* Responsive adjustments for preview environments */
@media (max-width: 768px) {
    .preview-environments {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .tab-button {
        padding: 10px 16px;
        font-size: 14px;
    }

    .component-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .component-status {
        margin-left: 0;
    }
}

/* Toggle Switch for KPI Exclusion */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #A14AE5;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.toggle-slider:hover {
    box-shadow: 0 0 4px rgba(161, 74, 229, 0.4);
}
