/* ============================================================
   app.css — shared component styles for all app-shell pages
   (pages that include includes/header.php)
   ============================================================ */


/* === Assigned Accessory Photo ===
   Used in: gun_view_assigned_optic/suppressor/bipod/lights.php
   ============================================================ */

.assigned-accessory-photo-box {
    margin: 0 0 16px 0;
    max-width: 520px;
}

.assigned-accessory-photo-link {
    display: inline-block;
    text-decoration: none;
    cursor: zoom-in;
}

.assigned-accessory-photo-wrap {
    border: 1px solid var(--border, #ccc);
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    padding: 6px;
    text-align: center;
}

.assigned-accessory-photo {
    display: inline-block;
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.assigned-accessory-photo-caption {
    margin-top: 8px;
    color: var(--muted, #666);
    font-size: 0.95em;
}


/* === Image Lightbox ===
   Used in: all *_view.php pages
   ============================================================ */

.image-lightbox[hidden] {
    display: none !important;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 11000;
    background: rgba(0, 0, 0, 0.86);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.image-lightbox-inner {
    position: relative;
    max-width: 96vw;
    max-height: 96vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-lightbox-img {
    display: block;
    max-width: 96vw;
    max-height: 96vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}

.image-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: rgba(20, 20, 20, 0.9);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.image-lightbox-close:hover {
    opacity: 0.92;
}


/* === Assignments Grid ===
   2-column grid wrapping the assignment sections on gun_view
   ============================================================ */

.assignments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
    margin-bottom: 24px;
}

.assignments-grid > * {
    min-width: 0;
}

/* Each column flows on its own so a tall box (one with a photo) never forces a
   gap under the shorter box beside it. */
.assignments-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.assignments-col > * {
    min-width: 0;
}

.assignments-col > .form-box {
    margin-bottom: 0;
}

@media (max-width: 1000px) {
    .assignments-grid {
        grid-template-columns: 1fr;
    }
}


/* === Assignment Form ===
   Used in: gun_view, optics_view, suppressors_view, lights_lasers_view
   ============================================================ */

.assignment-form {
    margin: 12px 0 18px 0;
    padding: 12px;
    border: 1px solid var(--border, #ccc);
    border-radius: 10px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
}

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

.assignment-form select {
    min-width: 320px;
    max-width: 100%;
    padding: 6px 8px;
}

.assignment-actions {
    margin-top: 10px;
}

.assignment-actions form {
    display: inline-block;
    margin-right: 8px;
}

.assignment-note {
    color: var(--muted, #666);
    font-size: 0.95em;
    margin-top: 8px;
}


/* === Details Box ===
   Used in: gun_view, optics_view, suppressors_view, lights_lasers_view, magazines_view, bipods_view
   ============================================================ */

.details-box {
    margin: 16px 0 20px 0;
}

.details-box table,
.nfa-details-box table {
    width: 100%;
    border-collapse: collapse;
}

.details-box th,
.details-box td,
.nfa-details-box th,
.nfa-details-box td {
    text-align: left;
    padding: 8px 10px;
    vertical-align: top;
}

.details-box th,
.nfa-details-box th {
    width: 220px;
}

.nfa-details-box {
    margin: 16px 0 20px 0;
}


/* === Shared Table Utilities ===
   Used in: gun_view, optics_view, suppressors_view, magazines_view
   ============================================================ */

.items-table,
.totals-table,
.documents-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 900px;
    margin-bottom: 20px;
}

.items-table th,
.items-table td,
.totals-table td,
.documents-table th,
.documents-table td {
    border: 1px solid var(--border, #ccc);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.items-table th,
.documents-table th {
    background: var(--panel-alt, rgba(0, 0, 0, 0.04));
}

.mount-items-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 1100px;
    margin-bottom: 20px;
}

.mount-items-table th,
.mount-items-table td {
    border: 1px solid var(--border, #ccc);
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.mount-items-table th {
    background: var(--panel-alt, rgba(0, 0, 0, 0.04));
}

.totals-box {
    max-width: 500px;
    margin-top: 20px;
}

.grand-total td {
    font-weight: bold;
}


/* === Utility Classes ===
   delete-link, money, inline-form — scattered across multiple views
   ============================================================ */

.delete-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.delete-link:hover {
    opacity: 0.85;
}

.money {
    text-align: right;
    white-space: nowrap;
}

.inline-form {
    display: inline-block;
    margin: 0;
}

.inline-form button {
    margin-left: 6px;
}


/* === Tax Stamp Upload ===
   Used in: gun_view, suppressors_view
   ============================================================ */

.tax-stamp-upload-form {
    margin: 12px 0 18px 0;
    padding: 12px;
    border: 1px solid var(--border, #ccc);
    border-radius: 10px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
    max-width: 900px;
}

.tax-stamp-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    align-items: end;
}

.tax-stamp-upload-grid label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.tax-stamp-upload-grid input[type="file"],
.tax-stamp-upload-grid input[type="text"] {
    width: 100%;
}

.tax-stamp-passphrase-row {
    margin-top: 12px;
    max-width: 480px;
}

.tax-stamp-passphrase-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.stamp-enc-badge {
    display: inline-block;
    font-size: 0.72rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    font-weight: 500;
    background: var(--accent-soft);
    color: var(--accent);
}

.stamp-enc-badge.private {
    background: rgba(176, 0, 32, 0.08);
    color: #b00020;
}


/* === Sold Banner ===
   Used in: gun_view
   ============================================================ */

.sold-banner {
    margin: 14px 0 18px 0;
    padding: 14px;
    border: 1px solid #b00020;
    border-radius: 10px;
    background: rgba(176, 0, 32, 0.08);
}

.sold-banner p {
    margin: 6px 0;
}


/* === Device Conditional ===
   Used in: lights_lasers_add, lights_lasers_edit
   ============================================================ */

.device-conditional[hidden] {
    display: none !important;
}


/* === Index Table ===
   Used in: inventory.php (previously also in orphaned index_styles.php)
   ============================================================ */

#index-guns,
#index-suppressors,
#index-magazines,
#index-optics,
#index-bipods {
    scroll-margin-top: 18px;
}

.index-table {
    width: 100%;
    border-collapse: collapse;
}

.index-table th,
.index-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.index-table tbody tr {
    transition: background-color 0.12s ease;
}

.index-table tbody tr:hover td {
    background: rgba(0, 95, 160, 0.10);
}

html.dark-theme .index-table tbody tr:hover td,
body.dark-theme .index-table tbody tr:hover td {
    background: rgba(100, 170, 255, 0.16);
}

.index-table tbody tr.clickable-row {
    cursor: pointer;
}

.index-table tbody tr.clickable-row td.actions-cell,
.index-table tbody tr.clickable-row td.actions-cell * {
    cursor: default;
}

.index-table thead th {
    position: sticky;
    top: 0;
    z-index: 5;
}

.index-table tbody tr.clickable-row:focus {
    outline: 2px solid rgba(0, 95, 160, 0.35);
    outline-offset: -2px;
}

html.dark-theme .index-table tbody tr.clickable-row:focus,
body.dark-theme .index-table tbody tr.clickable-row:focus {
    outline: 2px solid rgba(100, 170, 255, 0.45);
}

.actions-cell {
    white-space: nowrap;
}

.section-summary-row td {
    background: rgba(0, 0, 0, 0.03);
}

html.dark-theme .section-summary-row td,
body.dark-theme .section-summary-row td {
    background: rgba(255, 255, 255, 0.04);
}


/* === Hero Grid: Gun ===
   ============================================================ */

.gun-top-grid {
    display: grid;
    grid-template-columns: minmax(360px, 540px) minmax(420px, 1fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 20px;
}

.gun-top-grid .details-box,
.gun-top-grid .gun-hero-box {
    margin: 0;
}

.gun-hero-box {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.gun-hero-image-wrap {
    width: 100%;
    border: 1px solid var(--border, #ccc);
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    padding: 6px;
    text-align: center;
}

.gun-hero-image {
    display: inline-block;
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.gun-hero-caption {
    margin-top: 10px;
    color: var(--muted, #666);
    font-size: 0.95em;
}

.gun-hero-empty {
    min-height: 420px;
    border: 1px dashed var(--border, #ccc);
    border-radius: 10px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--muted, #666);
}

.gun-hero-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text, #222);
}

.gun-hero-empty-text {
    max-width: 320px;
    line-height: 1.5;
}

.gun-hero-upload {
    width: 100%;
    max-width: 380px;
    margin-top: 20px;
}

.gun-hero-upload .file-dropzone {
    background: transparent;
}

.gun-hero-upload .row {
    margin-bottom: 6px;
}

.gun-hero-upload label {
    display: block;
    font-size: 0.88em;
    color: var(--muted, #666);
    margin-bottom: 2px;
}

.gun-hero-upload input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    font-size: 0.92em;
}

.gun-hero-upload button[type="submit"] {
    margin-top: 8px;
    width: 100%;
}

/* Add Photo form embedded in the hero box, under the primary image */
.gun-hero-add-photo {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border, #ccc);
}

.gun-hero-add-photo .row {
    margin-bottom: 6px;
}

.gun-hero-link {
    display: inline-block;
    cursor: zoom-in;
}

.gun-hero-link:hover {
    opacity: 0.96;
}

/* Additional photos shown inside the hero box, under the primary image */
.gun-hero-more {
    margin-top: 16px;
}

.gun-hero-more-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 8px;
}

.gun-hero-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.gun-hero-thumb-card {
    border: 1px solid var(--border, #ccc);
    border-radius: 8px;
    padding: 6px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
}

.gun-hero-thumb-link {
    display: block;
    text-align: center;
}

.gun-hero-thumb-img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--panel-soft, #f5f5f5);
    cursor: zoom-in;
}

.gun-hero-thumb-cap {
    margin-top: 4px;
    font-size: 0.82em;
    color: var(--muted, #666);
    word-break: break-word;
}

.gun-hero-thumb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.gun-hero-thumb-actions .inline-form {
    display: inline;
    margin: 0;
}

.gun-hero-thumb-actions button {
    font-size: 0.72rem;
    padding: 3px 6px;
}

/* Standalone photo-upload box (was previously provided by entity_photos.php) */
.photo-add-hint {
    color: var(--muted, #666);
    font-size: 0.92em;
    margin: 0 0 12px 0;
}

.photo-upload-box {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--border, #ccc);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.02);
}

@media (max-width: 1100px) {
    .gun-top-grid {
        grid-template-columns: 1fr;
    }

    .gun-hero-image-wrap,
    .gun-hero-empty,
    .gun-hero-image {
        min-height: 320px;
    }
}


/* === Hero Grid: Optic ===
   ============================================================ */

.optic-top-grid {
    display: grid;
    grid-template-columns: minmax(360px, 540px) minmax(420px, 1fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 20px;
}

.optic-top-grid .details-box,
.optic-top-grid .optic-hero-box {
    margin: 0;
}

.optic-hero-box {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.optic-hero-image-wrap {
    width: 100%;
    border: 1px solid var(--border, #ccc);
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    padding: 6px;
    text-align: center;
}

.optic-hero-image {
    display: inline-block;
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.optic-hero-caption {
    margin-top: 10px;
    color: var(--muted, #666);
    font-size: 0.95em;
}

.optic-hero-empty {
    min-height: 420px;
    border: 1px dashed var(--border, #ccc);
    border-radius: 10px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--muted, #666);
}

.optic-hero-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text, #222);
}

.optic-hero-empty-text {
    max-width: 320px;
    line-height: 1.5;
}

.optic-hero-link {
    display: inline-block;
    cursor: zoom-in;
}

.optic-hero-link:hover {
    opacity: 0.96;
}

.optic-hero-upload {
    width: 100%;
    max-width: 380px;
    margin-top: 20px;
}

.optic-hero-upload .file-dropzone {
    background: transparent;
}

.optic-hero-upload .row {
    margin-bottom: 6px;
}

.optic-hero-upload label {
    display: block;
    font-size: 0.88em;
    color: var(--muted, #666);
    margin-bottom: 2px;
}

.optic-hero-upload input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    font-size: 0.92em;
}

.optic-hero-upload button[type="submit"] {
    margin-top: 8px;
    width: 100%;
}

.optic-hero-more {
    margin-top: 16px;
}

.optic-hero-more-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 8px;
}

.optic-hero-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.optic-hero-thumb-card {
    border: 1px solid var(--border, #ccc);
    border-radius: 8px;
    padding: 6px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
}

.optic-hero-thumb-link {
    display: block;
    text-align: center;
}

.optic-hero-thumb-img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--panel-soft, #f5f5f5);
    cursor: zoom-in;
}

.optic-hero-thumb-cap {
    margin-top: 4px;
    font-size: 0.82em;
    color: var(--muted, #666);
    word-break: break-word;
}

.optic-hero-thumb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.optic-hero-thumb-actions .inline-form {
    display: inline;
    margin: 0;
}

.optic-hero-thumb-actions button {
    font-size: 0.72rem;
    padding: 3px 6px;
}

@media (max-width: 1100px) {
    .optic-top-grid {
        grid-template-columns: 1fr;
    }

    .optic-hero-image-wrap,
    .optic-hero-empty,
    .optic-hero-image {
        min-height: 320px;
    }
}


/* === Hero Grid: Suppressor ===
   ============================================================ */

.suppressor-top-grid {
    display: grid;
    grid-template-columns: minmax(360px, 540px) minmax(420px, 1fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 20px;
}

.suppressor-top-grid .details-box,
.suppressor-top-grid .suppressor-hero-box {
    margin: 0;
}

.suppressor-hero-box {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.suppressor-hero-image-wrap {
    width: 100%;
    border: 1px solid var(--border, #ccc);
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    padding: 6px;
    text-align: center;
}

.suppressor-hero-image {
    display: inline-block;
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.suppressor-hero-caption {
    margin-top: 10px;
    color: var(--muted, #666);
    font-size: 0.95em;
}

.suppressor-hero-empty {
    min-height: 420px;
    border: 1px dashed var(--border, #ccc);
    border-radius: 10px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--muted, #666);
}

.suppressor-hero-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text, #222);
}

.suppressor-hero-empty-text {
    max-width: 320px;
    line-height: 1.5;
}

.suppressor-hero-link {
    display: inline-block;
    cursor: zoom-in;
}

.suppressor-hero-link:hover {
    opacity: 0.96;
}

.suppressor-hero-upload {
    width: 100%;
    max-width: 380px;
    margin-top: 20px;
}

.suppressor-hero-upload .file-dropzone {
    background: transparent;
}

.suppressor-hero-upload .row {
    margin-bottom: 6px;
}

.suppressor-hero-upload label {
    display: block;
    font-size: 0.88em;
    color: var(--muted, #666);
    margin-bottom: 2px;
}

.suppressor-hero-upload input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    font-size: 0.92em;
}

.suppressor-hero-upload button[type="submit"] {
    margin-top: 8px;
    width: 100%;
}

.suppressor-hero-more {
    margin-top: 16px;
}

.suppressor-hero-more-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 8px;
}

.suppressor-hero-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.suppressor-hero-thumb-card {
    border: 1px solid var(--border, #ccc);
    border-radius: 8px;
    padding: 6px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
}

.suppressor-hero-thumb-link {
    display: block;
    text-align: center;
}

.suppressor-hero-thumb-img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--panel-soft, #f5f5f5);
    cursor: zoom-in;
}

.suppressor-hero-thumb-cap {
    margin-top: 4px;
    font-size: 0.82em;
    color: var(--muted, #666);
    word-break: break-word;
}

.suppressor-hero-thumb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.suppressor-hero-thumb-actions .inline-form {
    display: inline;
    margin: 0;
}

.suppressor-hero-thumb-actions button {
    font-size: 0.72rem;
    padding: 3px 6px;
}

@media (max-width: 1100px) {
    .suppressor-top-grid {
        grid-template-columns: 1fr;
    }

    .suppressor-hero-image-wrap,
    .suppressor-hero-empty,
    .suppressor-hero-image {
        min-height: 320px;
    }
}


/* === Hero Grid: Light / Laser ===
   ============================================================ */

.light-laser-top-grid {
    display: grid;
    grid-template-columns: minmax(360px, 540px) minmax(420px, 1fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 20px;
}

.light-laser-top-grid .details-box,
.light-laser-top-grid .light-laser-hero-box {
    margin: 0;
}

.light-laser-hero-box {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.light-laser-hero-image-wrap {
    width: 100%;
    border: 1px solid var(--border, #ccc);
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    padding: 6px;
    text-align: center;
}

.light-laser-hero-image {
    display: inline-block;
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.light-laser-hero-caption {
    margin-top: 10px;
    color: var(--muted, #666);
    font-size: 0.95em;
}

.light-laser-hero-empty {
    min-height: 420px;
    border: 1px dashed var(--border, #ccc);
    border-radius: 10px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--muted, #666);
}

.light-laser-hero-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text, #222);
}

.light-laser-hero-empty-text {
    max-width: 320px;
    line-height: 1.5;
}

.light-laser-hero-link {
    display: inline-block;
    cursor: zoom-in;
}

.light-laser-hero-link:hover {
    opacity: 0.96;
}

.light-laser-hero-upload {
    width: 100%;
    max-width: 380px;
    margin-top: 20px;
}

.light-laser-hero-upload .file-dropzone {
    background: transparent;
}

.light-laser-hero-upload .row {
    margin-bottom: 6px;
}

.light-laser-hero-upload label {
    display: block;
    font-size: 0.88em;
    color: var(--muted, #666);
    margin-bottom: 2px;
}

.light-laser-hero-upload input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    font-size: 0.92em;
}

.light-laser-hero-upload button[type="submit"] {
    margin-top: 8px;
    width: 100%;
}

.light-laser-hero-more {
    margin-top: 16px;
}

.light-laser-hero-more-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 8px;
}

.light-laser-hero-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.light-laser-hero-thumb-card {
    border: 1px solid var(--border, #ccc);
    border-radius: 8px;
    padding: 6px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
}

.light-laser-hero-thumb-link {
    display: block;
    text-align: center;
}

.light-laser-hero-thumb-img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--panel-soft, #f5f5f5);
    cursor: zoom-in;
}

.light-laser-hero-thumb-cap {
    margin-top: 4px;
    font-size: 0.82em;
    color: var(--muted, #666);
    word-break: break-word;
}

.light-laser-hero-thumb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.light-laser-hero-thumb-actions .inline-form {
    display: inline;
    margin: 0;
}

.light-laser-hero-thumb-actions button {
    font-size: 0.72rem;
    padding: 3px 6px;
}

@media (max-width: 1100px) {
    .light-laser-top-grid {
        grid-template-columns: 1fr;
    }

    .light-laser-hero-image-wrap,
    .light-laser-hero-empty,
    .light-laser-hero-image {
        min-height: 320px;
    }
}


/* === Hero Grid: Magazine ===
   ============================================================ */

.magazine-top-grid {
    display: grid;
    grid-template-columns: minmax(360px, 540px) minmax(420px, 1fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 20px;
}

.magazine-top-grid .details-box,
.magazine-top-grid .magazine-hero-box {
    margin: 0;
}

.magazine-hero-box {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.magazine-hero-image-wrap {
    width: 100%;
    border: 1px solid var(--border, #ccc);
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    padding: 6px;
    text-align: center;
}

.magazine-hero-image {
    display: inline-block;
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.magazine-hero-caption {
    margin-top: 10px;
    color: var(--muted, #666);
    font-size: 0.95em;
}

.magazine-hero-empty {
    min-height: 420px;
    border: 1px dashed var(--border, #ccc);
    border-radius: 10px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--muted, #666);
}

.magazine-hero-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text, #222);
}

.magazine-hero-empty-text {
    max-width: 320px;
    line-height: 1.5;
}

.magazine-hero-link {
    display: inline-block;
    cursor: zoom-in;
}

.magazine-hero-link:hover {
    opacity: 0.96;
}

@media (max-width: 1100px) {
    .magazine-top-grid {
        grid-template-columns: 1fr;
    }

    .magazine-hero-image-wrap,
    .magazine-hero-empty,
    .magazine-hero-image {
        min-height: 320px;
    }
}


/* === Hero Grid: Bipod ===
   Upgraded to full parity with other entities
   ============================================================ */

.bipod-top-grid {
    display: grid;
    grid-template-columns: minmax(360px, 540px) minmax(420px, 1fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 20px;
}

.bipod-top-grid .details-box,
.bipod-top-grid .bipod-hero-box {
    margin: 0;
}

.bipod-hero-box {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.bipod-hero-image-wrap {
    width: 100%;
    border: 1px solid var(--border, #ccc);
    border-radius: 10px;
    overflow: hidden;
    background: transparent;
    padding: 6px;
    text-align: center;
}

.bipod-hero-image {
    display: inline-block;
    max-width: 100%;
    max-height: 600px;
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.bipod-hero-caption {
    margin-top: 10px;
    color: var(--muted, #666);
    font-size: 0.95em;
}

.bipod-hero-empty {
    min-height: 420px;
    border: 1px dashed var(--border, #ccc);
    border-radius: 10px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--muted, #666);
}

.bipod-hero-empty-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text, #222);
}

.bipod-hero-empty-text {
    max-width: 320px;
    line-height: 1.5;
}

.bipod-hero-link {
    display: inline-block;
    cursor: zoom-in;
}

.bipod-hero-link:hover {
    opacity: 0.96;
}

.bipod-hero-upload {
    width: 100%;
    max-width: 380px;
    margin-top: 20px;
}

.bipod-hero-upload .file-dropzone {
    background: transparent;
}

.bipod-hero-upload .row {
    margin-bottom: 6px;
}

.bipod-hero-upload label {
    display: block;
    font-size: 0.88em;
    color: var(--muted, #666);
    margin-bottom: 2px;
}

.bipod-hero-upload input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 5px 8px;
    font-size: 0.92em;
}

.bipod-hero-upload button[type="submit"] {
    margin-top: 8px;
    width: 100%;
}

.bipod-hero-add-photo {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border, #ccc);
}

.bipod-hero-add-photo .row {
    margin-bottom: 6px;
}

/* Additional photos shown inside the hero box, under the primary image */
.bipod-hero-more {
    margin-top: 16px;
}

.bipod-hero-more-title {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 8px;
}

.bipod-hero-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.bipod-hero-thumb-card {
    border: 1px solid var(--border, #ccc);
    border-radius: 8px;
    padding: 6px;
    background: var(--panel-soft, rgba(0, 0, 0, 0.02));
}

.bipod-hero-thumb-link {
    display: block;
    text-align: center;
}

.bipod-hero-thumb-img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    border-radius: 4px;
    background: var(--panel-soft, #f5f5f5);
    cursor: zoom-in;
}

.bipod-hero-thumb-cap {
    margin-top: 4px;
    font-size: 0.82em;
    color: var(--muted, #666);
    word-break: break-word;
}

.bipod-hero-thumb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.bipod-hero-thumb-actions .inline-form {
    display: inline;
    margin: 0;
}

.bipod-hero-thumb-actions button {
    font-size: 0.72rem;
    padding: 3px 6px;
}

@media (max-width: 1100px) {
    .bipod-top-grid {
        grid-template-columns: 1fr;
    }

    .bipod-hero-image-wrap,
    .bipod-hero-empty,
    .bipod-hero-image {
        min-height: 320px;
    }
}


/* === Form Utility Classes ===
   Used across all add/edit form pages
   ============================================================ */

.input-error {
    border-color: #c33 !important;
    background: #fff4f4 !important;
    color: #5a0b0b !important;
}

.input-error strong,
.input-error ul,
.input-error li {
    color: #5a0b0b !important;
}

html.dark-theme .input-error {
    border-color: #f87171 !important;
    background: #3a1010 !important;
    color: #fecaca !important;
}

html.dark-theme .input-error strong,
html.dark-theme .input-error ul,
html.dark-theme .input-error li {
    color: #fecaca !important;
}

.mt-8 {
    margin-top: 8px;
}

.label-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.label-inline-mr {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
}
