/* v3_components.css - Enterprise components */
.card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-card);
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
    min-width: 0;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.card-title {
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.card-body {
    color: var(--text-secondary);
}

.card-body p {
    margin-top: 0;
    line-height: 1.7;
}

.hero-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.surface-subtle {
    background: var(--surface-light);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
}

.metric-grid,
.widget-grid,
.service-grid,
.feature-grid {
    display: grid;
    gap: var(--space-4);
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.widget-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.service-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.feature-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.metric-card,
.feature-card,
.service-card,
.quick-card {
    background: var(--surface-light);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: var(--space-4);
    min-width: 0;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.05;
    color: var(--text-primary);
}

.metric-label {
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-note {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.feature-card h3,
.service-card h3,
.quick-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: var(--text-primary);
}

.feature-card p,
.service-card p,
.quick-card p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.service-tag-row,
.chip-row,
.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    min-width: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: var(--radius-btn);
    border: 1px solid transparent;
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
}

.btn:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-inverse);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: linear-gradient(135deg, #1f58d7 0%, #3376e6 100%);
}

.btn-secondary {
    background: var(--surface-card);
    color: var(--text-primary);
    border-color: var(--border-subtle);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: var(--surface-light);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--border-subtle);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    background: var(--primary-soft);
    border-color: #c8d9ff;
}

.btn-disabled,
.btn[aria-disabled="true"] {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-sm {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 0.76rem;
}

.btn-full {
    width: 100%;
}

.alert {
    padding: var(--space-4);
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: var(--space-5);
    border: 1px solid transparent;
}

.alert-warning {
    background: var(--alert-warning-bg);
    border-color: var(--alert-warning-border);
    color: var(--alert-warning-text);
}

.alert-error {
    background: var(--alert-error-bg);
    border-color: var(--alert-error-border);
    color: var(--alert-error-text);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid transparent;
}

.badge-info {
    background: var(--info-bg);
    color: var(--info-color);
    border-color: var(--info-border);
}

.badge-warning {
    background: var(--alert-warning-bg);
    color: var(--alert-warning-text);
    border-color: var(--alert-warning-border);
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-color);
    border-color: var(--success-border);
}

.badge-danger {
    background: var(--alert-error-bg);
    color: var(--alert-error-text);
    border-color: var(--alert-error-border);
}

.form-group {
    margin-bottom: var(--space-4);
    min-width: 0;
}

.form-grid {
    display: grid;
    gap: var(--space-4);
    min-width: 0;
}

.form-row {
    display: grid;
    gap: var(--space-4);
    min-width: 0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    min-width: 0;
}

.form-actions > * {
    flex: 1 1 100%;
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.form-input,
.form-control {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.96rem;
    box-sizing: border-box;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea.form-input,
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-input::placeholder,
.form-control::placeholder {
    color: #99a8bb;
}

.form-input:focus,
.form-control:focus {
    outline: none;
    border-color: #8ab1ff;
    box-shadow: 0 0 0 4px var(--focus-ring);
}

.field-hint,
.form-help-text,
.field-caption {
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.45;
}

.check-row,
.radio-row,
.toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: flex-start;
}

.check-row label,
.radio-row label,
.toggle-row label {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.48;
}

.security-banner {
    background: var(--alert-warning-bg);
    border: 1px solid var(--alert-warning-border);
    border-left: 4px solid var(--alert-warning-text);
    border-radius: 18px;
    color: var(--alert-warning-text);
    padding: var(--space-3) var(--space-4);
    font-size: 0.9rem;
    margin-bottom: var(--space-5);
}

.security-banner summary {
    font-weight: 800;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
}

.security-banner summary::-webkit-details-marker {
    display: none;
}

.security-banner p,
.security-banner div {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(154, 88, 0, 0.14);
    color: var(--text-secondary);
    line-height: 1.6;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 18px;
    max-width: 100%;
    overscroll-behavior-x: contain;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

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

.table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-subtle);
    overflow-wrap: anywhere;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf1f6;
    color: var(--text-primary);
    font-size: 0.92rem;
    vertical-align: top;
    overflow-wrap: anywhere;
}

.table td > * {
    max-width: 100%;
}

.table tbody tr:hover td {
    background: #fbfdff;
}

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

.progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--surface-muted);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--primary-gradient);
}

.panel-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    min-width: 0;
}

.panel-toolbar > * {
    min-width: 0;
}

.inline-stat-list,
.definition-list {
    display: grid;
    gap: 10px;
}

.definition-row {
    display: grid;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.definition-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.definition-row dt {
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.definition-row dd {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.96rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.status-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.empty-state {
    padding: 18px 14px;
    border-radius: 18px;
    border: 1px dashed var(--border-hover);
    background: var(--surface-light);
    color: var(--text-secondary);
    text-align: center;
}

.auth-provider-grid {
    display: grid;
    gap: var(--space-3);
}

.auth-provider-grid .btn {
    justify-content: flex-start;
}

.helper-stack {
    display: grid;
    gap: var(--space-4);
    min-width: 0;
}

.truncate-inline {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.truncate-copy {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
}

.compact-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.76rem;
    min-width: 0;
}

.hash-chip {
    display: inline-flex;
    max-width: 100%;
    padding: 6px 8px;
    border-radius: 10px;
    background: var(--surface-muted);
    border: 1px solid var(--border-subtle);
    font-family: var(--font-family-mono);
    font-size: 0.72rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.action-stack > * {
    flex: 0 0 auto;
}

.details-compact summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    cursor: pointer;
    list-style: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.details-compact summary::-webkit-details-marker {
    display: none;
}

.details-compact[open] summary {
    margin-bottom: 10px;
}

.details-compact > div,
.details-compact > p,
.details-compact > section {
    max-width: 100%;
    min-width: 0;
}

.info-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.meta-key-value {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.meta-key-value strong {
    color: var(--text-primary);
}

@media (min-width: 720px) {
    .form-row--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-actions > * {
        flex: initial;
    }
}

@media (max-width: 767px) {
    .card {
        padding: 16px;
        margin-bottom: 14px;
    }

    .table th,
    .table td {
        padding: 12px 10px;
        font-size: 0.82rem;
    }

    .table-card-mobile thead {
        display: none;
    }

    .table-card-mobile,
    .table-card-mobile tbody,
    .table-card-mobile tr,
    .table-card-mobile td {
        display: block;
        width: 100%;
    }

    .table-card-mobile tbody {
        display: grid;
        gap: var(--space-3);
    }

    .table-card-mobile tr {
        padding: 12px;
        border: 1px solid var(--border-subtle);
        border-radius: 18px;
        background: #fbfdff;
        box-shadow: 0 6px 20px rgba(15, 31, 61, 0.04);
        overflow: hidden;
    }

    .table-card-mobile td {
        padding: 0;
        margin-bottom: 8px;
        border: 0;
        background: transparent;
    }

    .table-card-mobile td:last-child {
        margin-bottom: 0;
    }

    .table-card-mobile td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 4px;
        color: var(--text-muted);
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .btn {
        min-height: 40px;
        font-size: 0.84rem;
    }

    .btn-sm {
        min-height: 32px;
        padding: 6px 10px;
    }

    .panel-toolbar {
        align-items: flex-start;
    }
}
