/* ── Nominal Roll ─────────────────────────────────────────────────────────── */

.nom-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 160px 24px 80px;
}

.nom-header {
    text-align: center;
    margin-bottom: 40px;
}

.nom-card {
    background: var(--surface-container-lowest);
    border-radius: 28px;
    padding: 40px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(0, 37, 66, 0.04);
}

.nom-card.hidden { display: none; }

.nom-card-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--on-surface);
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.nom-desc {
    color: var(--on-surface-variant);
    font-size: 0.9rem;
    margin: 0 0 24px;
    line-height: 1.6;
}

.nom-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--on-surface-variant);
    margin-bottom: 8px;
}

.nom-input, .nom-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--outline-variant);
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--on-surface);
    background: var(--surface-container-low);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.nom-input:focus, .nom-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Default column tags — toggleable */
.nom-default-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.nom-col-tag {
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.nom-col-tag.default.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.nom-col-tag.default:not(.active) {
    background: var(--surface-container-high);
    color: var(--on-surface-variant);
    border-color: var(--outline-variant);
    opacity: 0.6;
}

.nom-col-tag.default:hover {
    opacity: 1;
}

/* Custom column inputs */
.nom-custom-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.nom-custom-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nom-custom-row input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--outline-variant);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--on-surface);
    background: var(--surface-container-low);
}

.nom-custom-row input:focus {
    outline: none;
    border-color: var(--primary);
}

.nom-custom-row .nom-remove-col,
.nom-reorder-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, background 0.15s;
    font-family: inherit;
}

.nom-custom-row .nom-remove-col {
    background: var(--error, #d32f2f);
    color: white;
}

.nom-custom-row .nom-remove-col:hover { opacity: 0.8; }

.nom-reorder-btn {
    background: var(--surface-container-high);
    color: var(--on-surface-variant);
    font-size: 0.85rem;
    width: 32px;
    height: 32px;
}

.nom-reorder-btn:hover {
    background: var(--primary);
    color: white;
}

.nom-reorder-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.nom-setup-row {
    margin-top: 24px;
}

/* Buttons */
.nom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 100px;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.nom-btn:hover {
    transform: translateY(-1px);
}

.nom-btn.primary {
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 1rem;
}

.nom-btn.primary:hover {
    box-shadow: 0 6px 16px rgba(0, 101, 179, 0.3);
}

.nom-btn.secondary {
    background: var(--surface-container-high);
    color: var(--primary);
    font-weight: 700;
}

.nom-btn.outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--outline-variant);
}

/* Add multiple row group */
.nom-add-multi {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Editor header */
.nom-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

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

.nom-select {
    width: auto;
    padding: 10px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Table */
.nom-table-wrap {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--outline-variant);
}

.nom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.nom-table th {
    padding: 12px 14px;
    text-align: left;
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.nom-table th:first-child { border-radius: 15px 0 0 0; }
.nom-table th:last-child  { border-radius: 0 15px 0 0; }

.nom-table td {
    padding: 4px 6px;
    border-bottom: 1px solid var(--outline-variant);
    vertical-align: middle;
}

.nom-table tbody tr:hover {
    background: rgba(0, 101, 179, 0.03);
}

.nom-table tbody tr:nth-child(even) {
    background: var(--surface-container-lowest);
}

.nom-table tbody tr:nth-child(even):hover {
    background: rgba(0, 101, 179, 0.05);
}

/* Serial number column */
.nom-serial {
    font-weight: 800;
    color: var(--on-surface-variant);
    text-align: center;
    width: 50px;
    font-size: 0.8rem;
}

/* Inline editable cells */
.nom-table td input {
    width: 100%;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.85rem;
    color: var(--on-surface);
    padding: 8px;
    box-sizing: border-box;
}

.nom-table td input:focus {
    outline: none;
    background: var(--surface-container-low);
    border-radius: 8px;
}

.nom-table td input[type="date"] {
    min-width: 130px;
}

/* Age cell (auto-calculated) */
.nom-age {
    text-align: center;
    font-weight: 600;
    color: var(--on-surface-variant);
    padding: 8px 14px !important;
}

/* Row action buttons */
.nom-row-actions {
    display: flex;
    gap: 2px;
    align-items: center;
    justify-content: center;
}

/* Delete row button */
.nom-delete-row {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--error, #d32f2f);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.nom-delete-row:hover {
    background: rgba(211, 47, 47, 0.08);
}

/* Row reorder (small arrows) */
.nom-row-move {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--on-surface-variant);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    padding: 0;
    font-family: inherit;
}

.nom-row-move:hover {
    background: var(--primary);
    color: white;
}

.nom-row-move:disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
}

.nom-count {
    text-align: right;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--on-surface-variant);
    margin: 12px 0 0;
}

/* Export section */
.nom-export-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--outline-variant);
}

.nom-export-options {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.nom-pill-group {
    display: flex;
    gap: 4px;
    background: var(--surface-container-high);
    border-radius: 100px;
    padding: 3px;
}

.nom-pill {
    padding: 8px 18px;
    border-radius: 100px;
    border: none;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    background: transparent;
    color: var(--on-surface-variant);
    transition: all 0.2s;
}

.nom-pill.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 101, 179, 0.25);
}

.nom-color-swatches {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nom-swatch {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s;
    padding: 0;
    outline: none;
}

.nom-swatch:hover {
    transform: scale(1.15);
}

.nom-swatch.active {
    border-color: var(--on-surface);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--on-surface);
}

/* ── PDF Preview Modal ─────────────────────────────────────────────────────── */

.nom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(11, 28, 48, 0.4);
    backdrop-filter: blur(8px);
    overflow-y: auto;
    padding: 20px;
}

.nom-modal-container {
    max-width: 900px;
    margin: 3vh auto;
    background: var(--surface-container-lowest);
    border-radius: 40px;
    overflow: hidden;
    box-shadow: 0 50px 100px rgba(11, 28, 48, 0.2);
}

.nom-modal-header {
    padding: 24px 32px;
    background: var(--surface-container-low);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nom-modal-header h2 {
    margin: 0;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -1px;
    color: var(--on-surface);
}

.nom-modal-actions {
    display: flex;
    gap: 12px;
}

.nom-modal-body {
    padding: 32px;
    display: flex;
    justify-content: center;
    background: var(--surface-container-high);
    min-height: 300px;
}

.nom-modal-body iframe {
    max-width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: white;
}

/* Responsive */
@media (max-width: 768px) {
    .nom-card { padding: 24px; border-radius: 20px; }
    .nom-editor-header { flex-direction: column; align-items: flex-start; }
    .nom-editor-actions { width: 100%; }
    .nom-export-options { flex-direction: column; gap: 16px; }
    .nom-modal-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .nom-modal-body { padding: 16px; }
}
