@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #F0F0F8;
  --card-bg: #F5F4FA;
  --text-primary: #383A42;
  --text-secondary: #7E7F9A;
  --accent-blue: #4285F4;
  --profit-green: #34A853;
  --waste-red: #EA4335;
  --border-radius: 16px;
}

* { box-sizing: border-box; font-family: 'Fira Code', monospace; }

body { background-color: var(--bg-main); color: var(--text-primary); padding: 20px 30px; margin: 0; display: flex; flex-direction: column; align-items: center; min-height: 100vh; }
.dashboard-container { background: #FFFFFF; border-radius: 24px; width: 100%; max-width: 1400px; box-shadow: 0 12px 40px rgba(0,0,0,0.06); display: flex; flex-direction: column; flex: 1; overflow: hidden; max-height: calc(100vh - 90px); }
.header { display: flex; align-items: center; gap: 16px; padding: 20px 32px; border-bottom: 2px dashed #E8E6F8; flex-shrink: 0; }
.title-group h1 { font-size: 22px; margin: 0; font-weight: 600; }
.title-group p { margin: 4px 0 0 0; font-size: 12.5px; color: var(--text-secondary); }
.main-layout { display: grid; grid-template-columns: 320px 1fr; height: 100%; overflow: hidden; }
.left-col { padding: 24px 16px; overflow-y: auto; background: #FAFAFD; }
.left-col::-webkit-scrollbar, .right-col::-webkit-scrollbar { width: 8px; }
.left-col::-webkit-scrollbar-track, .right-col::-webkit-scrollbar-track { background: transparent; }
.left-col::-webkit-scrollbar-thumb, .right-col::-webkit-scrollbar-thumb { background: #DCD8F0; border-radius: 10px; }
.section-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 0 0 12px 0; text-transform: uppercase; letter-spacing: 1px; }

/* SWIPE EFFECTS */
.swipe-container { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid #E2E0EE; margin-bottom: 10px; background: var(--waste-red); }
.swipe-container.active { border: 2px solid var(--accent-blue); box-shadow: 0 4px 15px rgba(66, 133, 244, 0.12); }
.swipe-content { position: relative; z-index: 2; background: #FFFFFF; padding: 12px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer; border-radius: 12px; transition: transform 0.3s ease; }
.swipe-container:hover .swipe-content { transform: translateX(-60px); background: #F8F8FC; }
.swipe-container.active .swipe-content { background: #FFFFFF; }
.char-card-icon { font-size: 22px; }
.char-card-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.char-card-name { font-size: 12.5px; font-weight: 700; color: #2D2E3E; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-card-spot { font-size: 10.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-capsule { background: #E8E6F8; color: var(--accent-blue); padding: 1px 6px; border-radius: 8px; font-size: 8.5px; font-weight: 700; display: inline-block; width: fit-content; text-transform: uppercase; }
.swipe-action { position: absolute; right: 0; top: 0; bottom: 0; width: 60px; z-index: 1; display: flex; align-items: center; justify-content: center; color: white; font-size: 20px; cursor: pointer; background: var(--waste-red); }
.swipe-action:hover { background: #c53030; }

.add-char-card { background: #FAFAFD; border: 2px dashed #C5C2E0; border-radius: 14px; padding: 12px; text-align: center; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); cursor: pointer; transition: all 0.2s ease; }
.add-char-card:hover { border-color: var(--accent-blue); color: var(--accent-blue); background: #F4F5FC; }

.right-col { padding: 28px 32px; overflow-y: auto; background: #FFFFFF; }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; gap: 15px; }
.header-inputs { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.edit-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* INPUTS */
.edit-input-name { font-size: 24px; font-weight: 700; color: #2D2E3E; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 2px 6px; font-family: inherit; outline: none; min-width: 50px; transition: border-color 0.2s ease; }
.edit-input-name:hover, .edit-input-name:focus { border-color: #DCD8F0; background: #FAFAFD; }
.edit-input-level { font-size: 13.5px; font-weight: 600; color: var(--text-primary); border: 1px solid #D8DCF0; background: #E8E6F8; border-radius: 6px; padding: 4px 8px; font-family: inherit; outline: none; text-align: center; transition: all 0.2s ease; }
.edit-input-level:hover, .edit-input-level:focus { border-color: var(--accent-blue); background: #FFFFFF; }
.edit-input-spot { font-size: 12.5px; font-weight: 600; color: var(--text-primary); border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px 6px; font-family: inherit; outline: none; width: 100%; max-width: 160px; transition: all 0.2s ease; }
.edit-input-spot:hover, .edit-input-spot:focus { border-color: #DCD8F0; background: #FAFAFD; }
.party-status-select { max-width: 160px; cursor: pointer; border: 1px solid #D8DCF0; background: #F8F8FC; }

.edit-input-expense { font-size: 12px; color: var(--text-secondary); border: 1px solid #D8DCF0; background: #FFFFFF; border-radius: 6px; padding: 6px 8px; font-family: inherit; outline: none; width: 100%; transition: all 0.2s ease; box-sizing: border-box; }
.edit-input-expense:hover, .edit-input-expense:focus { border-color: var(--accent-blue); color: var(--text-primary); }

.header-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.btn-save-hunt, .btn-clear-hunt, .btn-delete-hunt, .btn-history { color: white; border: none; border-radius: 10px; padding: 8px 14px; font-family: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; transition: background 0.2s ease; }
.btn-save-hunt { background: var(--profit-green); }
.btn-save-hunt:hover { background: #2b8a43; }
.btn-clear-hunt:hover { background: #DCD8F0; }
.btn-delete-hunt { background: var(--waste-red); }
.btn-delete-hunt:hover { background: #c53030; }
.btn-history { background: #7E7F9A; }
.btn-history:hover { background: #5c5d73; }

.coming-soon-badge { background: #E8E6F8; color: var(--accent-blue); padding: 3px 8px; border-radius: 8px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.5px; }
.meta-bar { display: flex; flex-direction: column; gap: 8px; background: #F8F8FC; border: 1px solid #EAE8F5; border-radius: 12px; padding: 12px 14px; margin-bottom: 24px; font-size: 11.5px; }
.meta-bar-top { display: flex; justify-content: space-between; align-items: center; }
.meta-bar-top label { color: var(--text-secondary); font-weight: 700; text-transform: uppercase; font-size: 10.5px; }
.btn-add-imbue { background: #E8E6F8; border: none; border-radius: 6px; padding: 4px 10px; font-family: inherit; font-size: 11px; font-weight: 600; color: var(--accent-blue); cursor: pointer; }
.btn-add-imbue:hover { background: #DCD8F0; }

.imbues-tags-container { display: flex; flex-wrap: wrap; gap: 8px; }
.imbue-tag { background: #FFFFFF; border: 1px solid #DCD8F0; border-radius: 8px; padding: 4px 8px; display: flex; align-items: center; gap: 6px; font-size: 11px; }
.imbue-tag input[type="text"] { border: none; outline: none; font-family: inherit; font-size: 11px; width: 90px; color: var(--text-primary); }
.imbue-tag input[type="number"] { border: 1px solid #E2E0EE; border-radius: 4px; outline: none; font-family: inherit; font-size: 11px; width: 40px; text-align: center; color: var(--accent-blue); font-weight: 600; }
.imbue-tag button { background: transparent; border: none; color: var(--waste-red); cursor: pointer; font-weight: bold; font-size: 12px; }

.input-group { margin-bottom: 16px; }
.input-group label { display: block; font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; }
.input-group textarea { width: 100%; border: 1px solid #DCD8F0; border-radius: 12px; padding: 10px 12px; font-family: inherit; font-size: 11.5px; color: var(--text-primary); outline: none; resize: vertical; box-sizing: border-box; }
.input-group textarea:focus { border-color: var(--accent-blue); }

.summary-box { background: #FDFDF6; border: 1px solid #E8E6D9; border-radius: 16px; padding: 24px; margin-bottom: 24px; }
.summary-title { font-size: 15px; font-weight: 600; margin-bottom: 18px; color: #2D2E3E; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat-block { display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 10.5px; color: #8C8A79; font-weight: 600; text-transform: uppercase; }
.stat-value { font-size: 15px; font-weight: 600; color: #2D2E3E; display: flex; align-items: center; gap: 4px; }
.val-profit { color: var(--profit-green); }
.val-waste { color: var(--waste-red); }

/* ESTILOS PARA EL PARTY SPLIT ENGINE (PANEL DE RESULTADOS) */
.party-split-container { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.party-split-card { background: #FFFFFF; border-radius: 16px; border: 1px solid #E2E0EE; padding: 18px; box-shadow: 0 4px 15px rgba(0,0,0,0.02); display: flex; flex-direction: column; gap: 12px; }
.party-split-card.yellow { background: #FFFDF4; border: 1px solid #F3EFE0; }
.party-split-header { font-size: 13px; font-weight: 700; color: #2D2E3E; display: flex; align-items: center; gap: 6px; border-bottom: 1px dashed #E8E6F8; padding-bottom: 8px; }
.transfer-row { background: #FFFFFF; border: 1px solid #E8E6F8; border-radius: 10px; padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; }

.damage-box { background: #FFFDF9; border: 1px solid #F3EFE0; border-radius: 16px; padding: 20px; margin-bottom: 24px; }
.damage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: #2D2E3E; }
.damage-section-title { font-size: 12px; font-weight: 700; color: #744210; margin: 14px 0 8px 0; text-transform: uppercase; border-bottom: 1px dashed #EFECE1; padding-bottom: 4px; }
.damage-row { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; margin-bottom: 4px; }
.damage-bar-bg { background: #EFECE1; border-radius: 4px; height: 5px; width: 100%; margin-top: 2px; margin-bottom: 6px; overflow: hidden; }
.damage-bar-fill { background: #E06D53; height: 100%; border-radius: 4px; }
.damage-icon-wrapper { display: inline-block; width: 16px !important; height: 16px !important; vertical-align: middle; margin-right: 6px; }
.damage-icon-wrapper img { width: 16px !important; height: 16px !important; display: block; object-fit: contain; image-rendering: pixelated; }
.dmg-icon { width: 16px !important; height: 16px !important; object-fit: contain !important; vertical-align: middle; margin-right: 6px; image-rendering: pixelated; }

.lists-container { margin-top: 20px; }
.list-section { margin-bottom: 16px; }
.list-title { font-size: 12px; font-weight: 700; color: #2D2E3E; margin: 0 0 8px 0; display: flex; align-items: center; gap: 6px; }
.sprites-container { display: flex; flex-wrap: wrap; gap: 8px; }
.item-badge { background: #FFFFFF; border: 1px solid #E2E0EE; border-radius: 8px; padding: 4px 10px; display: flex; align-items: center; gap: 6px; font-size: 11px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }
.mob-badge { background: #FFF5F5; border: 1px solid #FAD1D1; color: #C53030; }
.item-badge img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
.footer-josos { margin-top: 12px; font-size: 11px; color: #9E9FAE; font-weight: 500; text-align: center; letter-spacing: 0.5px; line-height: 1.5; }

/* MODAL HISTORIAL Y ALERTAS */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #fff; border-radius: 16px; width: 90%; max-width: 550px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,0.2); }
.alert-modal-box { max-width: 380px; max-height: auto; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.btn-close-modal { background: none; border: none; font-size: 24px; cursor: pointer; color: #888; }
.btn-close-modal:hover { color: #333; }
.history-list { padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; overflow-x: hidden; }
.history-item-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-secondary); width: 100%; }
.history-item-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: bold; width: 100%; margin-top: 6px; }
.party-badge { padding: 2px 6px; border-radius: 6px; font-size: 9.5px; font-weight: 700; background: #F4F5FC; color: #383A42; border: 1px solid #E2E0EE; }
.manual-member-box { background: #F8F8FC; border: 1px solid #E2E0EE; border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }