/* KoaNode UI Polish - Mili v1 */

/* ============================================
   Enhanced Table Styling
   ============================================ */

.instances-table th {
    font-weight: 650;
    color: #475467;
    font-size: 13px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.instances-table td {
    padding-top: 18px;
    padding-bottom: 18px;
    vertical-align: middle;
}

.instances-table tbody tr {
    transition: background-color 0.15s ease;
}

.instances-table tbody tr:hover {
    background: rgba(21, 94, 239, 0.04);
}

/* Improve table cell content readability */
.instances-table .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 13px;
    color: #344054;
}

/* ============================================
   Enhanced Status Pills
   ============================================ */

.pill {
    font-size: 12px;
    padding: 4px 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.pill.green {
    background: #d1fadf;
    color: #039855;
}

.pill.red {
    background: #fee4e2;
    color: #d92d20;
}

.pill.amber {
    background: #fef0c7;
    color: #dc6803;
}

.pill.blue {
    background: #eff6ff;
    color: #1570ef;
}

.pill.gray {
    background: #f2f4f7;
    color: #475467;
}

/* ============================================
   Instance Actions - Better Grouping
   ============================================ */

.instance-actions-grid {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(249, 250, 251, 0.5);
}

.action-group.is-danger {
    border-color: #fecdca;
    background: rgba(254, 228, 226, 0.2);
}

.action-group-header {
    width: 100%;
    margin-bottom: 8px;
}

.action-group-header h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 650;
    color: #344054;
}

.action-group-header p {
    margin: 0;
    font-size: 13px;
    color: #667085;
}

/* ============================================
   Create Instance Form - Enhanced Layout
   ============================================ */

.create-instance-card {
    max-width: 900px;
}

.choice-section {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fafbfc;
    margin-bottom: 18px;
    transition: all 0.2s ease;
}

.choice-section:hover {
    border-color: #bfdbfe;
    background: #f0f7ff;
}

.choice-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.choice-step {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #1570ef 0%, #155eef 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.choice-section-heading h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 650;
    color: #111827;
}

.choice-section-heading .muted {
    margin: 0;
    font-size: 13px;
}

.choice-card {
    padding: 16px 18px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
}

.choice-card.is-selected {
    border-color: #1570ef;
    background: #f0f7ff;
}

.choice-card strong {
    font-size: 14px;
    font-weight: 650;
    color: #111827;
    display: block;
    margin-bottom: 4px;
}

.choice-card p {
    margin: 0;
    font-size: 13px;
    color: #667085;
}

/* OS Card Grid */
.os-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.os-card {
    padding: 16px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: white;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.os-card:hover {
    border-color: #93c5fd;
    background: #f9fafb;
    transform: translateY(-2px);
}

.os-card.is-selected {
    border-color: #1570ef;
    background: #eff6ff;
}

.os-card-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.os-card-name {
    font-size: 13px;
    font-weight: 650;
    color: #111827;
    margin-bottom: 4px;
}

.os-card-version {
    font-size: 11px;
    color: #667085;
}

/* ============================================
   Console Layout - Better Responsive
   ============================================ */

@media (max-width: 1024px) {
    .console-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-width: none;
        position: static;
        height: auto;
    }

    .console-main {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .instances-table {
        font-size: 13px;
    }

    .instances-table th,
    .instances-table td {
        padding: 12px 8px;
    }

    .row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .row-actions button,
    .row-actions .button {
        width: 100%;
    }
}

/* ============================================
   Section Headings - Better Hierarchy
   ============================================ */

.section-heading-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.section-heading-row h2 {
    margin-bottom: 8px;
}

.section-heading-row .muted {
    max-width: 600px;
}

/* ============================================
   Dashboard Cards - Enhanced Spacing
   ============================================ */

.traffic-pool-card {
    margin-top: 24px;
}

.instances-card {
    margin-top: 24px;
}

.create-instance-card {
    margin-top: 24px;
}

/* ============================================
   Monitoring Cards - Better Layout
   ============================================ */

.monitoring-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.metric-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, #fafbfc 0%, #ffffff 100%);
}

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

.metric-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 650;
    color: #344054;
}

.metric-big-number {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.metric-big-number .unit {
    font-size: 18px;
    font-weight: 600;
    color: #667085;
    margin-left: 2px;
}

/* ============================================
   Button Enhancements
   ============================================ */

button.blue,
.button.blue {
    background: linear-gradient(135deg, #1570ef 0%, #155eef 100%);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

button.blue:hover,
.button.blue:hover {
    background: linear-gradient(135deg, #1366de 0%, #1151d8 100%);
    box-shadow: 0 4px 8px rgba(21, 94, 239, 0.24);
}

button.secondary:hover,
.button.secondary:hover {
    background: #e5e7eb;
}

/* ============================================
   Utility Classes
   ============================================ */

.console-stack {
    display: grid;
    gap: 24px;
}

.sr-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
/* Logo 图片样式 */
.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
}

/* 保留原有的 .mark 样式作为备用 */
.mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
