.btn,
button.btn,
.icon-button,
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0 16px;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn:hover,
.icon-button:hover,
.menu-toggle:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: var(--white);
    background: var(--brand);
    box-shadow: 0 10px 22px rgba(37, 99, 168, 0.18);
}

.btn-gold {
    color: var(--white);
    background: var(--gold);
    box-shadow: 0 10px 22px rgba(201, 149, 39, 0.18);
}

.btn-dark {
    color: var(--white);
    background: rgba(7, 29, 51, 0.84);
}

.btn-secondary {
    color: var(--brand-dark);
    border-color: var(--line);
    background: #f8fbff;
    box-shadow: inset 0 0 0 1px rgba(216, 226, 239, 0.55);
}

.btn-danger {
    color: var(--white);
    background: var(--danger);
}

.btn-ghost {
    color: var(--brand-dark);
    border-color: var(--line);
    background: transparent;
}

.icon-button {
    width: 42px;
    padding: 0;
    border-color: var(--line);
    background: var(--white);
}

.menu-toggle {
    position: relative;
    flex-direction: column;
    width: 42px;
    padding: 0;
    gap: 5px;
    border-color: var(--line);
    background: var(--white);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: var(--brand-dark);
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.topbar-actions {
    display: none;
}

.panel-card,
.data-card,
.filters-card,
.quick-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.panel-card {
    padding: 18px;
}

.filters-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 280px) auto auto;
    min-width: 0;
    max-width: 100%;
    gap: 12px;
    align-items: end;
    padding: 16px;
}

.quick-card {
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 18px;
}

.form-grid {
    display: grid;
    gap: 14px;
    align-content: start;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-field {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 750;
}

.form-field span,
.field-label {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 12px;
    color: var(--ink);
    background: var(--white);
    outline: none;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(37, 99, 168, 0.11);
}

.color-row,
.font-size-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
}

.color-row input[type="color"] {
    min-height: 42px;
    padding: 4px;
}

.actions-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.push-right {
    margin-left: auto;
}

.table-card {
    overflow: visible;
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.data-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    max-width: 100%;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

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

.data-row:hover {
    z-index: 3;
    background: #f8fbff;
}

.data-row:has(.icon-action:hover),
.data-row:has(.icon-action:focus-visible) {
    z-index: 8;
}

.data-main {
    min-width: 0;
}

.data-main strong,
.data-main span {
    display: block;
}

.data-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.data-title-line strong {
    display: inline-block;
}

.data-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-title-line strong {
    white-space: normal;
}

.data-main span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.row-actions {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.icon-action {
    position: relative;
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fbff;
    color: var(--brand-dark);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.icon-action svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-action:hover {
    z-index: 4;
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(15, 23, 42, 0.14);
}

.icon-action-primary {
    color: var(--white);
    border-color: transparent;
    background: var(--brand);
}

.icon-action-gold {
    color: var(--white);
    border-color: transparent;
    background: var(--gold);
}

.icon-action-danger {
    color: var(--white);
    border-color: transparent;
    background: var(--danger);
}

.icon-action::before,
.icon-action::after {
    position: absolute;
    left: 50%;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, 8px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.icon-action::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 10px);
    width: max-content;
    max-width: 190px;
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--white);
    background: #071d33;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

.icon-action::after {
    content: "";
    bottom: calc(100% + 4px);
    border: 6px solid transparent;
    border-top-color: #071d33;
}

.icon-action:hover::before,
.icon-action:hover::after,
.icon-action:focus-visible::before,
.icon-action:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.status-pill {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 4px 9px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 12px;
    font-weight: 850;
}

.status-pill.gold {
    color: var(--gold-dark);
    background: rgba(201, 149, 39, 0.16);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.52);
}

.modal-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(980px, 100%);
    max-height: min(90vh, 820px);
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-lg);
}

@media (min-width: 1101px) {
    .modal-panel:has(.song-editor-layout) {
        width: min(1320px, calc(100vw - 48px));
        max-height: min(94vh, 920px);
    }
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line);
    border-bottom: 0;
}

.modal-title p,
.section-heading p {
    margin: 0 0 3px;
    color: var(--gold-dark);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.modal-title h2,
.section-heading h2 {
    margin: 0;
}

.modal-body {
    min-height: 0;
    overflow: auto;
    padding: 20px;
}

.check-field {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-weight: 700;
}

.check-field input {
    width: auto;
    min-height: auto;
}
