
.preset-cw-btn {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s;
}
.preset-cw-btn.active, .preset-cw-btn:hover {
    background: var(--tool-primary, #059669);
    color: #fff;
    border-color: var(--tool-primary, #059669);
}
.cw-cell {
    width: 34px;
    height: 34px;
    position: relative;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    font-family: 'SF Mono', Consolas, monospace;
    user-select: none;
    text-transform: uppercase;
}
.cw-cell.empty {
    background: #1e293b;
}
.cw-cell-num {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 9px;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
}
.cw-cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    background: transparent;
    padding: 0;
    outline: none;
    font-family: inherit;
}
.cw-cell input:focus {
    background: #ecfdf5;
}
@media print {
    body * { visibility: hidden; }
    #printWorksheetArea, #printWorksheetArea * { visibility: visible; }
    #printWorksheetArea {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: #fff;
        padding: 20px;
    }
}

/* ── Modal, A4 & toast (standar v2.63) ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 22, 18, 0.68);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-dialog {
    background: var(--psg-card);
    border: 1px solid var(--psg-border-strong);
    border-radius: 16px;
    max-width: 760px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(0,0,0,0.16);
    overflow: hidden;
}
.modal-head {
    padding: 1rem 1.25rem;
    background: var(--psg-surface);
    border-bottom: 1px solid var(--psg-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-body {
    padding: 1.25rem;
    overflow-y: auto;
}
.modal-foot {
    padding: 0.85rem 1.25rem;
    background: var(--psg-surface);
    border-top: 1px solid var(--psg-border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.a4-paper {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 2rem;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.a4-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2.5px solid #1a3c34;
    padding-bottom: 0.85rem;
    margin-bottom: 1.25rem;
}
.a4-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 1.25rem;
}
.a4-table th, .a4-table td {
    border: 1px solid #cbd5e1;
    padding: 0.55rem 0.75rem;
    text-align: left;
}
.a4-table th {
    background: #f1f5f9;
    font-weight: 700;
    color: #0f172a;
}

.toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast-msg {
    background: var(--psg-primary);
    color: #ffffff;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideUp 0.2s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

