/* DockerCP CRUD backend UI additions */
.ec-alert-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.ec-alert {
    border-radius: 14px;
    padding: 13px 15px;
    border: 1px solid var(--ec-border);
    font-weight: 800;
}

.ec-alert-success {
    background: #E9FBF4;
    color: #008F5C;
    border-color: rgba(0, 166, 106, .25);
}

.ec-alert-error {
    background: var(--ec-red-soft);
    color: var(--ec-red);
    border-color: rgba(229,72,77,.25);
}

.ec-alert-info {
    background: var(--ec-card-head);
    color: var(--ec-muted);
}

.ec-crud-grid {
    display: grid;
    grid-template-columns: minmax(320px, 430px) 1fr;
    gap: 18px;
    align-items: start;
}

.ec-crud-form {
    display: grid;
    gap: 14px;
}

.ec-crud-form label {
    font-weight: 900;
    display: grid;
    gap: 7px;
}

.ec-crud-form input,
.ec-crud-form select,
.ec-crud-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--ec-border);
    border-radius: 13px;
    padding: 10px 12px;
    color: var(--ec-text);
    background: var(--ec-panel-bg);
    outline: none;
}

.ec-crud-form textarea {
    min-height: 110px;
    resize: vertical;
}

.ec-crud-form input:focus,
.ec-crud-form select:focus,
.ec-crud-form textarea:focus {
    border-color: var(--ec-green);
    box-shadow: 0 0 0 4px rgba(31, 111, 245,.12);
}

.ec-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ec-inline-form {
    display: inline-flex;
}

.ec-danger-zone {
    border: 1px solid rgba(229,72,77,.22);
    background: var(--ec-red-soft);
    color: var(--ec-red);
    border-radius: 16px;
    padding: 14px;
}

.ec-help-note {
    border-radius: 14px;
    padding: 13px 14px;
    background: var(--ec-green-soft);
    color: var(--ec-green-dark);
    border: 1px solid rgba(31, 111, 245,.22);
    font-weight: 700;
}

.ec-table-wrap {
    overflow-x: auto;
}

.ec-muted-line {
    color: var(--ec-muted);
    font-weight: 700;
}

.ec-form-section-title {
    margin: 4px 0;
    color: var(--ec-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 900;
}

@media (max-width: 1080px) {
    .ec-crud-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   Long technical values (service/container/domain/
   image/path). Scoped: cards stay inside their grid
   column, and only the overflowing value scrolls.
================================================== */

.ec-crud-grid > * {
    min-width: 0; /* grid children may shrink below content width */
}

.ec-card-title span,
.ec-card-title small {
    min-width: 0; /* flex children in card headers may shrink */
}

.ec-domain-row > * {
    min-width: 0; /* grid children in domain routes may shrink */
}

/* Reusable, narrowly scoped horizontal scroller for one technical value.
   Short values render normally; the mini scrollbar appears only when the
   content genuinely overflows. Matches the existing customised sidebar
   scrollbar (thin, rounded, muted slate thumb, light/dark compatible). */
.ec-scroll-x {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    vertical-align: bottom;
    scrollbar-width: thin;                                /* Firefox */
    scrollbar-color: rgba(100, 116, 139, 0.45) transparent; /* Firefox */
}

.ec-scroll-x::-webkit-scrollbar {
    height: 6px;
}

.ec-scroll-x::-webkit-scrollbar-track {
    background: transparent;
}

.ec-scroll-x::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.32);
    border-radius: 999px;
}

.ec-scroll-x::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.5);
}

/* Multi-line code blocks (compose file, logs) keep their line breaks and
   scroll horizontally only when a single line genuinely overflows. */
pre.ec-scroll-x {
    display: block;
    white-space: pre;
}

/* ==================================================
   Custom file-selection control (static-site ZIP).
   The native file input stays in the page (accessible
   technique: transparent overlay), so the form works
   without JavaScript and stays keyboard reachable.
================================================== */

.ec-file-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 4px 12px 4px 4px;
    border: 1px solid var(--ec-border);
    border-radius: 13px;
    background: var(--ec-panel-bg);
}

.ec-crud-form .ec-file-control .ec-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;         /* visually hidden, still focusable and clickable */
    cursor: pointer;
}

.ec-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--ec-border);
    border-radius: 10px;
    background: var(--ec-card);
    color: var(--ec-text);
    font-weight: 800;
    white-space: nowrap;
    flex-shrink: 0;
    pointer-events: none; /* the overlaid native input receives the click */
}

.ec-file-icon {
    color: var(--ec-green);
    font-weight: 900;
    line-height: 1;
}

/* Hover state */
.ec-file-control:hover .ec-file-btn {
    border-color: rgba(31, 111, 245, 0.24);
    background: var(--ec-green-soft);
    color: var(--ec-green-dark);
}

/* Focus state (keyboard focus lands on the native input) */
.ec-file-control:focus-within {
    border-color: var(--ec-green);
    box-shadow: 0 0 0 4px rgba(31, 111, 245, 0.12);
}

/* Active state */
.ec-file-control:active .ec-file-btn {
    background: var(--ec-green-soft);
    border-color: var(--ec-green);
    color: var(--ec-green-dark);
}

/* Disabled state */
.ec-file-control .ec-file-input:disabled {
    cursor: not-allowed;
}

.ec-file-control .ec-file-input:disabled ~ .ec-file-btn,
.ec-file-control .ec-file-input:disabled ~ .ec-file-name {
    opacity: 0.65;
}

/* Validation state */
.ec-file-control.ec-file-invalid {
    border-color: rgba(229, 72, 77, 0.55);
}

.ec-file-name {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--ec-muted);
    font-weight: 700;
}

.ec-file-name.ec-has-file {
    color: var(--ec-text);
}

.ec-file-hint {
    color: var(--ec-soft-text);
    font-weight: 700;
    font-size: 0.78rem;
}

.ec-file-error {
    margin: 0;
    border: 1px solid rgba(229, 72, 77, 0.25);
    border-radius: 13px;
    padding: 10px 12px;
    background: var(--ec-red-soft);
    color: var(--ec-red);
    font-weight: 800;
}
.ec-field-hint {
    display: block;
    margin: 5px 0 0;

    color: var(--ec-muted);

    font-size: 0.76rem;
    line-height: 1.45;
    font-weight: 500;
}

.ec-service-note {
    margin: 10px 0 0;
}