/* LPH design system — components layer.
   Ordered slice of lph-system.css, split to honour the <500-line rule.
   MUST load in sequence base -> components -> utilities -> portal -> responsive, BEFORE lph-theme.css.
   Do not reorder or edit across slice boundaries. */
/* --------------------------------------------------
   Section + Toolbar
-------------------------------------------------- */

.lph-section {
    border-radius: 24px;
    padding: 22px;
}

.lph-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.lph-section-heading {
    min-width: 0;
}

.lph-section-subtitle {
    margin: 6px 0 0;
    color: var(--lph-text-secondary);
    font-size: 0.88rem;
    line-height: 1.5;
}

.lph-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.lph-toolbar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.lph-toolbar-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* --------------------------------------------------
   Inputs / Buttons
-------------------------------------------------- */

.lph-input-wrap {
    min-width: 260px;
}

.lph-input,
.lph-select,
.lph-textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    background: #0d1e2e;
    color: #e0e4ec;
    font-size: 0.88rem;
    line-height: 1.2;
    outline: none;
    transition: 160ms ease;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
}

/* Override native select white background in all browsers */
select,
select.lph-input,
.lph-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e98ae' d='M1.41 0 6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px !important;
    color-scheme: dark;
}

option,
select option {
    background-color: #0d1e2e;
    color: #e0e4ec;
}

.lph-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.lph-input::placeholder,
.lph-textarea::placeholder {
    color: #8e98ae;
}

.lph-input:focus,
.lph-select:focus,
.lph-textarea:focus {
    border-color: rgba(199, 162, 71, 0.32);
    box-shadow: 0 0 0 3px rgba(199, 162, 71, 0.08);
}

.lph-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    background: var(--color-surface-veil);
    color: var(--color-text);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: 160ms ease;
}

.lph-btn:hover {
    text-decoration: none;
    background: rgba(var(--ink-rgb), 0.06);
    color: var(--color-text);
}

.lph-btn-primary {
    background: linear-gradient(180deg, rgba(199, 162, 71, 0.22), var(--color-primary-soft));
    border-color: rgba(199, 162, 71, 0.34);
    color: var(--color-text);
}

.lph-btn-primary:hover {
    background: linear-gradient(180deg, var(--color-border-strong), rgba(199, 162, 71, 0.16));
}

.lph-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    background: rgba(var(--ink-rgb), 0.025);
    color: var(--lph-text-secondary);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    transition: 160ms ease;
}

.lph-filter-chip:hover {
    color: var(--color-text);
    text-decoration: none;
    border-color: rgba(199, 162, 71, 0.18);
}

.lph-filter-chip.is-active {
    color: var(--color-text);
    background: var(--color-primary-soft);
    border-color: var(--color-border-strong);
}

.lph-filter-chip small {
    color: var(--lph-text-muted);
    font-size: 0.78rem;
}

/* --------------------------------------------------
   Table Card
-------------------------------------------------- */

.lph-table-wrap {
    width: 100%;
}

.lph-table-scroll {
    width: 100%;
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(var(--ink-rgb), 0.045);
    background: rgba(var(--ink-rgb), 0.015);
}

.lph-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.lph-table thead th {
    text-align: left;
    padding: 14px 16px;
    color: var(--lph-text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.06);
    background: rgba(var(--ink-rgb), 0.015);
}

.lph-table tbody td {
    padding: 16px;
    color: var(--lph-text-primary);
    font-size: 0.9rem;
    line-height: 1.45;
    border-bottom: 1px solid rgba(var(--ink-rgb), 0.04);
    vertical-align: top;
}

.lph-table tbody tr:last-child td {
    border-bottom: 0;
}

.lph-table tbody tr:hover {
    background: rgba(var(--ink-rgb), 0.018);
}

.lph-table-actions-head,
.lph-table-actions {
    text-align: right;
}

.lph-cell-stack {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lph-cell-stack strong {
    color: var(--color-text);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
}

.lph-cell-stack small {
    color: var(--lph-text-secondary);
    font-size: 0.8rem;
    line-height: 1.45;
}

.lph-row-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lph-row-action {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(var(--ink-rgb), 0.06);
    background: var(--color-surface-veil);
    color: var(--color-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: 160ms ease;
}

.lph-row-action:hover {
    text-decoration: none;
    background: rgba(var(--ink-rgb), 0.055);
    color: var(--color-text);
}

.lph-row-action.is-primary {
    border-color: var(--color-border-strong);
    background: var(--color-primary-soft);
}

.lph-row-action.is-primary:hover {
    background: rgba(199, 162, 71, 0.18);
}

.lph-table-empty-actions {
    color: var(--lph-text-muted);
    font-size: 0.9rem;
}

/* --------------------------------------------------
   Form Card
-------------------------------------------------- */

.lph-form {
    display: grid;
    gap: 18px;
}

.lph-form-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(var(--ink-rgb), 0.015);
    border: 1px solid var(--color-surface-hover);
}

.lph-form-section-head h4 {
    margin: 0 0 6px;
    color: var(--color-text);
    font-size: 0.98rem;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.012em;
}

.lph-form-section-head p {
    margin: 0;
    color: var(--lph-text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.lph-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.lph-form-group {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.lph-form-group-full {
    grid-column: 1 / -1;
}

.lph-label {
    color: var(--color-text);
    font-size: 0.84rem;
    line-height: 1.2;
    font-weight: 600;
}

.lph-required {
    color: #ffb0b0;
    margin-inline-start: 4px;
}

.lph-field-hint {
    color: var(--lph-text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.lph-field-error {
    color: #ffb0b0;
    font-size: 0.78rem;
    line-height: 1.4;
}

.lph-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
}

.lph-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--lph-gold);
}

.lph-file-input {
    padding-top: 9px;
    padding-bottom: 9px;
}

.lph-form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 2px;
}


/* Multilingual content editor (translatable form field) */
.lph-i18n-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.lph-i18n-primary {
    position: relative;
}
.lph-i18n-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--lph-text-muted);
    margin-bottom: 4px;
    letter-spacing: .02em;
}
.lph-i18n-more > summary {
    cursor: pointer;
    font-size: 12px;
    color: var(--lph-gold);
    padding: 4px 0;
    user-select: none;
}
.lph-i18n-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--color-border-strong);
    border-radius: 8px;
    background: var(--color-surface-veil);
}
.lph-i18n-locale {
    display: flex;
    flex-direction: column;
}
