.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    background: rgba(34, 18, 51, 0.45);
    justify-content: center;
    align-items: center;
}

div#imageViewport {
    width: 665px;
}

.modal-content {
    background: #1a0826;
    margin: 8vh auto;
    padding: 2.5rem 2.5rem 2rem 2.5rem;
    border-radius: 18px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    min-width: 340px;
    max-width: 520px;
    width: 96vw;
    position: relative;
    color: #f8f6fc;
}

.close {
    color: #b57bee;
    position: absolute;
    top: 18px;
    right: 24px;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #fff;
}

.switch-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.2rem 1.2rem;
    align-items: center;
    justify-content: center;
    margin: 1.2rem 0 1.5rem 0;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    background: rgba(30, 18, 40, 0.7);
    border-radius: 12px;
    padding: 0.7rem 0.2rem;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0.2rem;
    background: rgba(60, 30, 80, 0.18);
    border-radius: 8px;
    padding: 0.2rem 0.7rem 0.2rem 0.3rem;
    transition: background 0.2s;
}

.switch-label:hover {
    background: rgba(124, 58, 237, 0.13);
}

.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(124,58,237,0.10);
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #2d1a3a;
    border-radius: 22px;
    transition: .3s;
    border: 1.5px solid #7c3aed;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: .3s;
    box-shadow: 0 2px 8px rgba(124,58,237,0.18);
}

.switch input:checked + .slider {
    background: linear-gradient(90deg, #7c3aed 0%, #b57bee 100%);
    border: 1.5px solid #b57bee;
}

.switch input:checked + .slider:before {
    transform: translateX(16px);
}

.switch-row span {
    color: #b57bee;
    font-size: 1rem;
    text-align: left;
    display: inline-block;
    vertical-align: middle;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.login-container, .dashboard-container, .admin-container {
    background: rgba(34, 18, 51, 0.92);
    padding: 2.5rem 2.5rem 2rem 2.5rem;
    border-radius: 18px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    text-align: center;
    min-width: 340px;
    max-width: 75vw;
}

#roleButtons button,.manga-list button, .chapter-list button {
    width: 100%;
}

input, button, select {
    margin: 0.7rem 0;
    padding: 0.8rem;
    border-radius: 8px;
    border: none;
    width: 90%;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
}

input[type="checkbox"] {
    display: none;
}

input {
    background: #2d1a3a;
    color: #f8f6fc;
    border: 1px solid #7c3aed;
    transition: border 0.2s;
}

input:focus {
    outline: none;
    border: 1.5px solid #b57bee;
}

button {
    min-width: 120px;
    width: 10%;
    background: linear-gradient(90deg, #7c3aed 0%, #b57bee 100%);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(124,58,237,0.15);
}

button:hover {
    background: linear-gradient(90deg, #b57bee 0%, #7c3aed 100%);
    transform: translateY(-2px) scale(1.03);
}

.error {
    color: #ff4d4d;
    margin-top: 1rem;
}

h2 {
    color: #b57bee;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

.tool-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.manga-list, .chapter-list, .page-list { margin-bottom: 2em; }
.page-thumb { width: 120px; height: 170px; object-fit: cover; margin: 0.5em; border: 2px solid #444; cursor: pointer; }
.page-thumb.selected { border-color: #a0f; }
.image-canvas { position: relative; display: inline-block; }
.selection-box { position: absolute; border: 2px dashed #a0f; pointer-events: none; z-index: 10; }
.translation-popup {
    position: fixed;
    background: #222;
    color: #fff;
    border: 1px solid #a0f;
    padding: 1em;
    z-index: 1000;
    min-width: 260px;
    border-radius: 8px;
}
.arrow { position: absolute; width: 30px; height: 30px; pointer-events: none; }
.translation-label { position: absolute; background: #a0f; color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 1em; z-index: 15; margin: 0 10px 0 0; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
    background: rgba(34, 18, 51, 0.85);
    border-radius: 10px;
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid #7c3aed44;
}

.admin-table th {
    background: #7c3aed;
    color: #fff;
    font-weight: 600;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-actions button {
    width: auto;
    margin: 0 0.2rem;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

body {
    background: linear-gradient(135deg, #12071b 0%, #23102e 100%);
    color: #f8f6fc;
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ── Kanban Board ─────────────────────────────────────────────── */
.kanban-board {
    display: flex;
    flex-direction: row;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px;
    height: calc(100vh - 56px);
    box-sizing: border-box;
    align-items: flex-start;
    background: #1a0f2e;
}

.kanban-col {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    width: 240px;
    min-width: 240px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    transition: background 0.15s;
    border: 1px solid rgba(255,255,255,0.07);
}

.kanban-col.drag-over {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.5);
}

.kanban-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px 9px 12px;
    border-radius: 12px 12px 0 0;
    border-top: 3px solid var(--col-color, #7c3aed);
    flex-shrink: 0;
}

.kanban-col-title {
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #e2d4f8;
}

.kanban-count {
    background: rgba(255,255,255,0.1);
    color: #b57bee;
    border-radius: 99px;
    padding: 1px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
}

.kanban-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.kanban-cards::-webkit-scrollbar { width: 4px; }
.kanban-cards::-webkit-scrollbar-track { background: transparent; }
.kanban-cards::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.4); border-radius: 4px; }

.kanban-card {
    background: #241536;
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    padding: 10px 12px;
    color: #f0eaff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: grab;
    user-select: none;
    transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s, background 0.12s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-card::before {
    content: '⠿';
    color: rgba(180,150,230,0.35);
    font-size: 1rem;
    flex-shrink: 0;
}

.kanban-card:hover {
    background: #2e1a42;
    border-color: rgba(124, 58, 237, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.2);
}

.kanban-card.dragging {
    opacity: 0.35;
    cursor: grabbing;
    transform: scale(0.97);
}

.kanban-card-label {
    flex: 1;
}

.kanban-drop-indicator {
    height: 3px;
    border-radius: 3px;
    background: #7c3aed;
    margin: 0 4px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.kanban-drop-indicator.active {
    opacity: 1;
}

/* Manga selection on board page */
.board-page .manga-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.5rem;
    align-items: flex-start;
}

.board-page .manga-list button,
.board-page .manga-btn {
    width: auto;
    min-width: 200px;
    text-align: left;
}