/* MONTSERRAT FONT'UNU İÇE AKTAR */
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/Montserrat-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/Montserrat-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/Montserrat-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('fonts/Montserrat-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
/* MONTSERRAT FONT'UNU İÇE AKTAR - BİTİŞ */

:root {
  --edit-color: #10b981;
  --review-color: #ea580c;
  --toast-success-bg: #10b981;
  --toast-success-color: #ffffff;
  --toast-info-bg: #3b82f6;
  --toast-info-color: #ffffff;
  --toast-warning-bg: #f59e0b;
  --toast-warning-color: #ffffff;
  --toast-error-bg: #ef4444;
  --toast-error-color: #ffffff;
  
  --scrollbar-thumb-light: #cbd5e1;
  --scrollbar-track-light: #f1f5f9;
  --scrollbar-thumb-hover-light: #94a3b8;

  --scrollbar-thumb-dark: #475569;
  --scrollbar-track-dark: #1e293b;
  --scrollbar-thumb-hover-dark: #64748b;
}

body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  background: #f9fafb;
  color: #1e293b;
  transition: background 0.3s, color 0.3s;
}

/* Evrensel font tanımı */
* {
  font-family: 'Montserrat', sans-serif;
}

.dark {
  background: #0f172a;
  color: #e2e8f0;
}

.container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: background 0.3s;
}
.dark .container {
  background: #1e293b;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.actions button {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: #6366f1;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.actions button:hover {
  background: #4f46e5;
}
#startTourBtn {
  background: #8b5cf6;
}
#startTourBtn:hover {
  background: #7c3aed;
}

#megaLoginBtn {
    background-color: #d20007;
    padding: 6px 12px;
}
#megaLoginBtn:hover {
    background-color: #a90006;
}
#megaLoginBtn.logged-in {
    background-color: #16a34a; 
}
#megaLoginBtn.logged-in:hover {
    background-color: #15803d;
}
#megaLoginBtn img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}
#megaLoginBtn #megaLoginBtnText {
    font-weight: 500;
}
.beta-tag {
    font-size: 0.7rem;
    font-weight: bold;
    background-color: rgba(0, 0, 0, 0.2);
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
}

.color-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(99, 102, 241, 0.08);
  padding: 10px;
  border-radius: 8px;
}
.color-picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-controls strong {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.color-controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
}
.dark .color-controls {
  background: rgba(255, 255, 255, 0.08);
}
.dark .color-controls label {
  color: #e2e8f0;
}
.color-controls input[type="color"] {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  padding: 0;
}
.color-controls button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: #6366f1;
  color: white;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 14px;
}
.color-controls button:hover {
  background: #4f46e5;
}

.totals {
  display: flex;
  gap: 12px;
  margin: 20px 0;
}
.total-box {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-weight: bold;
}

.filter-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px;
  background-color: #f1f5f9;
  border-radius: 8px;
  margin-bottom: 20px;
}
.dark .filter-controls {
  background-color: #334155;
}
.filter-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-controls label {
  font-weight: 500;
}
.filter-controls select,
.filter-controls button,
.filter-controls input[type="text"] {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}
.dark .filter-controls select,
.dark .filter-controls button,
.dark .filter-controls input[type="text"] {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
.filter-controls button {
  background-color: #6366f1;
  color: white;
  cursor: pointer;
  border: none;
}
.filter-controls button:hover {
  background-color: #4f46e5;
}
.info-btn {
  background: transparent !important;
  color: #64748b !important;
  border: none !important;
  font-size: 1.2rem;
  padding: 0 8px;
}
.dark .info-btn {
  color: #94a3b8 !important;
}
.info-btn:hover {
  background: rgba(0,0,0,0.05) !important;
}
.dark .info-btn:hover {
  background: rgba(255,255,255,0.1) !important;
}

.filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}
.pagination-controls button {
    background-color: #6366f1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.pagination-controls button:hover {
    background-color: #4f46e5;
}
.pagination-controls button:disabled {
    background-color: #a5b4fc;
    cursor: not-allowed;
}
.dark .pagination-controls button {
    background-color: #475569;
}
.dark .pagination-controls button:hover {
    background-color: #64748b;
}
.dark .pagination-controls button:disabled {
    background-color: #334155;
    color: #94a3b8;
}
#pageInfo {
    font-weight: 500;
}

#dataForm .date-select-group {
  display: flex;
  gap: 8px;
}
#dataForm .date-select-group select {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}
.dark #dataForm .date-select-group select {
  background: #1e293b;
  border: 1px solid #475569;
  color: #e2e8f0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 450px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  transform: scale(0.95) translateY(-10px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.modal-overlay.show .modal-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.dark .modal-content {
  background: #1e293b;
  color: #e2e8f0;
}
.modal-content .popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal-content h3, .modal-content h2 {
  margin-top: 0;
  margin-bottom: 8px;
}
.modal-content .date-select-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}
.modal-content .date-select-group select {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
}
.dark .modal-content .date-select-group select {
   background: #334155;
   border-color: #475569;
   color: #e2e8f0;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}
.modal-actions.vertical {
  flex-direction: column;
}
.modal-actions.vertical button {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}
.modal-actions button {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
#confirmCsvDate, #csvImportSingleDateBtn, #confirmBatchDate, #applyDecideImportBtn {
  background: #10b981; color: white;
}
#csvImportAggregatedBtn {
  background: #3b82f6; color: white;
}
#csvImportMixedBtn {
  background: #8b5cf6; color: white;
  white-space: normal;
  line-height: 1.3;
  padding: 10px;
}
#cancelCsvDate, .modal-actions button.cancel, #cancelBatchDate {
  background: #64748b; color: white;
}

#importModeMergeBtn {
    background-color: #22c55e;
    color: white;
}
#importModeOverwriteBtn {
    background-color: #f59e0b;
    color: white;
}
#importModeDecideBtn {
    background-color: #8b5cf6;
    color: white;
}

#decideImportModal .modal-content {
    max-width: 600px;
}
.decide-list-header {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 10px;
    padding: 8px;
    font-weight: bold;
    border-bottom: 1px solid #e2e8f0;
}
.dark .decide-list-header {
    border-bottom-color: #475569;
}
#decideImportList {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    max-height: 40vh;
    overflow-y: auto;
}
#decideImportList li {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 6px;
}
#decideImportList li:nth-child(odd) {
    background-color: #f8fafc;
}
.dark #decideImportList li:nth-child(odd) {
    background-color: #334155;
}
.decide-project-info {
    display: flex;
    flex-direction: column;
}
.decide-project-info strong {
    font-size: 1rem;
}
.decide-project-info small {
    font-size: 0.8rem;
    color: #64748b;
}
.dark .decide-project-info small {
    color: #94a3b8;
}
.decide-actions {
    display: flex;
    gap: 5px;
}
.decide-actions label {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.dark .decide-actions label {
    border-color: #475569;
}
.decide-actions input[type="radio"] {
    display: none;
}
.decide-actions input[type="radio"]:checked + label {
    color: white;
    font-weight: bold;
}
.decide-actions input[type="radio"][value="merge"]:checked + label {
    background-color: #22c55e;
    border-color: #22c55e;
}
.decide-actions input[type="radio"][value="overwrite"]:checked + label {
    background-color: #f59e0b;
    border-color: #f59e0b;
}
.decide-actions input[type="radio"][value="skip"]:checked + label {
    background-color: #64748b;
    border-color: #64748b;
}


#filterInfoContent ul {
  list-style: none;
  padding-left: 0;
  margin-top: 10px;
}
#filterInfoContent li {
  margin-bottom: 14px;
  line-height: 1.5;
}
#filterInfoContent strong {
  color: #4f46e5;
  display: block;
  margin-bottom: 2px;
}
.dark #filterInfoContent strong {
  color: #818cf8;
}

#megaLoginModal .modal-content {
    max-width: 500px;
}
#megaLoginForm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#megaLoginForm input {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    margin-bottom: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #1e293b;
}
#megaLoginForm input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}
.dark #megaLoginForm input {
    background-color: #334155;
    border-color: #475569;
    color: #e2e8f0;
}
.dark #megaLoginForm input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

#megaLoginForm button,
#megaLoginBtnTab,
#megaLoginBtnTabFiles {
    background: linear-gradient(145deg, #f85757, #ef4444);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    padding: 12px;
    width: 100%;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease-out;
}
#megaLoginForm button:hover,
#megaLoginBtnTab:hover,
#megaLoginBtnTabFiles:hover,
#megaLoginForm button:focus,
#megaLoginBtnTab:focus,
#megaLoginBtnTabFiles:focus {
    background: linear-gradient(145deg, #ff6b6b, #f55353);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3);
    outline: none;
}
#megaLoginForm button:active,
#megaLoginBtnTab:active,
#megaLoginBtnTabFiles:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}
.mega-info-box {
    margin-top: 20px;
    padding: 12px 16px;
    background-color: rgba(245, 158, 11, 0.1);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
}
.mega-info-box.success {
    background-color: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}
.dark .mega-info-box {
    background-color: rgba(245, 158, 11, 0.15);
}
.dark .mega-info-box.success {
    background-color: rgba(16, 185, 129, 0.15);
}
.mega-info-box h4 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #b45309;
}
.mega-info-box.success h4 {
    color: #057a55;
}
.dark .mega-info-box h4 {
    color: #fcd34d;
}
.dark .mega-info-box.success h4 {
    color: #34d399;
}
.mega-info-box ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.5;
}
.dark .mega-info-box ul {
    color: #cbd5e1;
}
.mega-info-box li {
    padding-left: 1.2em;
    position: relative;
    margin-bottom: 6px;
}
.mega-info-box li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #f59e0b;
}
.mega-info-box.success li::before {
    color: #10b981;
}
.mega-info-box li:last-child {
    margin-bottom: 0;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 350px;
  height: 100%;
  background: #ffffff;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  border-radius: 0 12px 12px 0;
  padding: 20px;
  z-index: 1001;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
}
.dark .sidebar { background: #1e293b; }
.sidebar.open { transform: translateX(0); }
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.close-btn {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: #1e293b;
}
.dark .close-btn { color: #e2e8f0; }
#dataList { list-style: none; padding: 0; margin-top: 20px; }
#dataList li {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  background: #f1f5f9;
}
.dark #dataList li { background: #334155; }
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
}
.overlay.show { opacity: 1; visibility: visible; }

.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.popup-container.show {
    opacity: 1;
    visibility: visible;
}
.popup-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    padding: 20px;
    width: 90%;
    max-width: 800px;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.popup-container.show .popup-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.dark .popup-content {
  background: #1e293b;
  color: #e2e8f0;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.popup-header h2 {
  margin: 0;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 10px;
}
.dark .setting-item {
  border-bottom: 1px solid #475569;
}
.setting-item:last-child {
  border-bottom: none;
}
.settings-list strong {
  font-size: 16px;
  flex-shrink: 0;
}
.settings-list .setting-item button, 
.settings-list .setting-item select {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: #6366f1;
  color: #ffffff;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
}
.dark .settings-list .setting-item button, 
.dark .settings-list .setting-item select {
  background: #475569;
}
.settings-list .setting-item button:hover {
  background: #4f46e5;
}
.dark .settings-list .setting-item button:hover {
  background: #64748b;
}

.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dark .tab-nav {
  border-bottom-color: #475569;
}
.tab-btn {
  padding: 10px 16px;
  border: none;
  background-color: transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: #64748b;
  border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  flex-grow: 1;
  text-align: center;
}
.dark .tab-btn {
  color: #94a3b8;
}
.tab-btn:hover {
  background-color: #f1f5f9;
  color: #334155;
}
.dark .tab-btn:hover {
  background-color: #334155;
  color: #e2e8f0;
}
.tab-btn.active {
  color: #4f46e5;
  border-bottom: 2px solid #4f46e5;
}
.dark .tab-btn.active {
  color: #a5b4fc;
  border-bottom-color: #a5b4fc;
}
.tab-content {
  display: none;
  animation: fadeIn 0.4s;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.editor-search {
    flex-grow: 1;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    min-width: 150px;
}
.dark .editor-search {
  background: #1e293b;
  border: 1px solid #475569;
  color: #e2e8f0;
}
.editor-list-header {
    display: grid;
    grid-template-columns: 30px 2fr 1fr 1fr 1.5fr 80px;
    gap: 6px;
    align-items: center;
    font-weight: 600;
    padding: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 8px;
}
.dark .editor-list-header {
    border-bottom-color: #475569;
}
#editorList {
    list-style: none;
    padding: 0;
    margin: 0;
}
#editorList li {
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 6px;
  background: #f1f5f9;
  display: grid;
  grid-template-columns: 30px 2fr 1fr 1fr 1.5fr 80px;
  gap: 6px;
  align-items: center;
}
.dark #editorList li { background: #334155; }
#editorList input[type="text"],
#editorList input[type="number"] {
  width: 100%;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  min-width: 50px;
}
.dark #editorList input[type="text"],
.dark #editorList input[type="number"] {
  background: #1e293b;
  border: 1px solid #475569;
  color: #e2e8f0;
}
#editorList button {
  background: #ef4444; color: white; border: none; padding: 6px 10px;
  border-radius: 6px; cursor: pointer;
  width: 100%;
}
#editorList button:hover { background: #dc2626; }
.report-name-tag {
  background-color: #e0e7ff;
  color: #4338ca;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
}
.dark .report-name-tag {
  background-color: #3730a3;
  color: #e0e7ff;
}
.batch-action-container {
    padding: 10px;
    margin-bottom: 10px;
    background-color: #eef2ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.dark .batch-action-container {
    background-color: #312e81;
}

#dataForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}
#dataForm input {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  margin-bottom: 8px;
}
.dark #dataForm input {
  background: #1e293b;
  border: 1px solid #475569;
  color: #e2e8f0;
}
#dataForm button {
  background: #10b981; color: white; border: none; padding: 8px;
  border-radius: 6px; cursor: pointer; font-weight: bold;
}
#dataForm button:hover { background: #059669; }

.control-panel-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}
.dark .control-panel-section {
    background: #1e293b;
    border-color: #475569;
}
.control-panel-section h3 {
    margin-top: 0;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}
.dark .control-panel-section h3 {
    border-bottom-color: #475569;
}
.control-panel-section p {
    font-size: 0.9rem;
    color: #475569;
    margin-top: 0;
}
.dark .control-panel-section p {
    color: #94a3b8;
}
.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.button-grid button, .button-grid .import-label {
    padding: 10px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s;
}
.button-grid button:active, .button-grid .import-label:active {
    transform: scale(0.98);
}
.save-btn {
  background: #3b82f6; color: white;
}
.save-btn:hover { background: #2563eb; }
.load-btn {
  background: #f59e0b; color: white;
}
.load-btn:hover { background: #d97706; }
.clear-btn {
  background: #ef4444; color: white;
}
.clear-btn:hover { background: #dc2626; }
#loadSelect {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  margin-bottom: 12px;
}
.dark #loadSelect {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #475569;
}
.import-label {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #22c55e;
  color: white;
}
.import-label:hover {
    background: #16a34a;
}

#megaLoginStatus {
    margin-top: 10px;
    padding: 8px;
    border-radius: 6px;
    background-color: #f1f5f9;
}
.dark #megaLoginStatus {
    background-color: #334155;
}


#pieChartContainer {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 20px;
    gap: 20px;
    align-items: flex-start;
}
.pie-chart-wrapper {
    flex: 1;
    max-width: 50%;
    text-align: center;
    position: relative;
    height: 500px;
}
.chart-title {
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 600;
}

.sidebar-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.sidebar-controls #searchInput { flex: 1; }
.sort-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.sort-buttons button {
  padding: 6px 12px;
  border-radius: 6px;
  background: #60a5fa;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.sort-buttons button:hover { background: #3b82f6; }
.sidebar-controls input {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  flex: 1;
}
.dark .sidebar-controls input {
  background: #1e293b;
  border-color: #475569;
  color: #e2e8f0;
}
.dark .sort-buttons button {
  background: #334155;
  color: #e2e8f0;
  border: 1px solid #475569;
}
.dark .sort-buttons button:hover { background: #475569; }

.sort-indicator {
    display: inline-block;
    width: 1em;
    text-align: center;
}
.sort-indicator.asc::after {
    content: '▲';
    font-size: 0.7em;
}
.sort-indicator.desc::after {
    content: '▼';
    font-size: 0.7em;
}


.progress-bar-container {
  display: flex;
  width: 100%;
  height: 12px;
  margin-top: 8px;
  border-radius: 6px;
  overflow: hidden;
  background: #e2e8f0;
}
.dark .progress-bar-container { background: #475569; }
.progress-bar { height: 100%; transition: width 0.3s ease; }
.edit-bar { background: var(--edit-color); }
.review-bar { background: var(--review-color); }

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5000;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-weight: 500;
  opacity: 1;
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
  transform: translateX(0);
}
.toast.hide { opacity: 0; transform: translateX(100%); }
.toast-success { background-color: var(--toast-success-bg); color: var(--toast-success-color); }
.toast-info { background-color: var(--toast-info-bg); color: var(--toast-info-color); }
.toast-warning { background-color: var(--toast-warning-bg); color: var(--toast-warning-color); }
.toast-error { background-color: var(--toast-error-bg); color: var(--toast-error-color); }

.custom-scrollbar::-webkit-scrollbar { width: 10px; height: 10px; }
.custom-scrollbar::-webkit-scrollbar-track { background: var(--scrollbar-track-light); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb-light); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover-light); }
.dark .custom-scrollbar::-webkit-scrollbar-track { background: var(--scrollbar-track-dark); }
.dark .custom-scrollbar::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb-dark); }
.dark .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover-dark); }
.custom-scrollbar { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb-light) var(--scrollbar-track-light); }
.dark .custom-scrollbar { scrollbar-color: var(--scrollbar-thumb-dark) var(--scrollbar-track-dark); }

.toast.toast-undo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.toast.toast-undo button {
    padding: 5px 10px;
    border: 1px solid #ffffff;
    background: transparent;
    color: #ffffff;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.toast.toast-undo button:hover {
    background-color: #ffffff;
    color: var(--toast-warning-bg);
}

.print-area {
  display: none;
}

@media print {
  body > *:not(.print-area) {
    display: none !important;
  }

  .totals {
    display: none !important;
  }

  .print-area {
    display: block !important;
  }
  
  .print-area * {
    color: #000 !important;
  }

  #printTitle {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
  }

  #printCharts {
    text-align: center;
    margin-bottom: 30px;
  }

  #printCharts img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ccc;
    margin-bottom: 15px;
  }

  #printTableContainer table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 11pt;
    page-break-inside: auto;
  }
  
  #printTableContainer tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  #printTableContainer th, #printTableContainer td {
    border: 1px solid #000;
    padding: 6px;
    text-align: left;
  }

  #printTableContainer thead {
    display: table-row-group;
  }

  #printTableContainer th {
    background-color: #f2f2f2 !important;
    font-weight: bold;
    -webkit-print-color-adjust: exact; 
    color-adjust: exact;
  }
  
  #printTableContainer .total-row {
    background-color: #e8e8e8 !important;
    font-weight: bold;
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
  }

  #printTableContainer .total-label {
    text-align: right;
    padding-right: 1em;
  }

  @page {
    size: A4 portrait;
    margin: 1.5cm;
  }
}

.toast {
    position: relative;
    overflow: hidden;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    animation: shrink-width 10s linear forwards;
}

@keyframes shrink-width {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

#confirmLoadModal .modal-actions button {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  margin-bottom: 8px;
}

#confirmLoadModal .modal-actions button:last-child {
  margin-bottom: 0;
}

#confirmLoadBtn {
  background: #ef4444;
  color: white;
}
#confirmLoadBtn:hover {
  background: #dc2626;
}

#exportAndContinueBtn {
  background: #22c55e;
  color: white;
}

#exportAndContinueBtn:hover {
  background: #16a34a;
}

.shepherd-element {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
}
.shepherd-header {
    background: #6366f1;
    color: white;
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
}
.shepherd-title {
    font-size: 1.1rem;
    font-weight: 600;
}
.shepherd-cancel-icon {
    color: rgba(255, 255, 255, 0.8);
}
.shepherd-cancel-icon:hover {
    color: white;
}
.shepherd-text {
    padding: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
}
.shepherd-footer {
    padding: 0 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.shepherd-button {
    background: #6366f1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    transition: background-color 0.2s;
}
.shepherd-modal-overlay {
    z-index: 2500 !important;
}
.shepherd-button:not(:disabled):hover {
    background: #4f46e5;
}
.shepherd-button.shepherd-button-secondary {
    background: #e2e8f0;
    color: #475569;
}
.shepherd-button.shepherd-button-secondary:not(:disabled):hover {
    background: #cbd5e1;
}

.dark .shepherd-element {
    background: #1e293b;
}
.dark .shepherd-header {
    background: #4f46e5;
}
.dark .shepherd-text {
    color: #e2e8f0;
}
.dark .shepherd-button {
    background: #818cf8;
    color: #1e293b;
}
.dark .shepherd-button:not(:disabled):hover {
    background: #a5b4fc;
}
.dark .shepherd-button.shepherd-button-secondary {
    background: #475569;
    color: #e2e8f0;
}
.dark .shepherd-button.shepherd-button-secondary:not(:disabled):hover {
    background: #64748b;
}


@media (max-width: 768px) {
  body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }
  .container {
    margin: 10px;
    padding: 15px;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }
  .header h1 {
    font-size: 1.5rem;
  }
  .actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  #startTourBtn {
    grid-column: 1 / -1; 
  }
  .actions button {
    width: 100%;
    box-sizing: border-box;
  }
  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-group {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .filter-item {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-item div {
    display: flex;
    gap: 6px;
  }
  .filter-item select {
    flex-grow: 1;
  }
  .totals {
    flex-direction: column;
  }
  #pieChartContainer {
    flex-direction: column;
    height: auto;
  }
  .pie-chart-wrapper {
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.5;
  }
  .pie-chart-wrapper + .pie-chart-wrapper {
    margin-top: 20px;
  }
  .sidebar {
    width: 90%;
    max-width: 320px;
  }
  .button-grid {
    grid-template-columns: 1fr;
  }
  .toast-container {
    bottom: 10px;
    right: 10px;
    left: 10px;
    width: auto;
  }
  .popup-content {
    width: 95%;
    padding: 15px;
  }
  .editor-list-header {
    display: none;
  }
  #editorList li {
    grid-template-columns: 30px 1fr;
    grid-template-rows: auto auto auto auto;
    gap: 8px;
    padding: 12px;
    position: relative;
    padding-bottom: 50px;
  }
  #editorList li input[type="checkbox"] {
    grid-row: 1;
    grid-column: 1;
  }
  #editorList li input[type="text"] {
    grid-row: 1;
    grid-column: 2;
    font-weight: bold;
    font-size: 1.1rem;
  }
  #editorList li input[type="number"]:nth-of-type(1) {
    grid-row: 2;
    grid-column: 1 / span 2;
  }
  #editorList li input[type="number"]:nth-of-type(2) {
    grid-row: 3;
    grid-column: 1 / span 2;
  }
  #editorList li span {
    grid-row: 4;
    grid-column: 1 / span 2;
    text-align: center;
    padding: 4px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
  }
  .dark #editorList li span {
    background: rgba(255,255,255,0.08);
  }
  #editorList li button {
    grid-row: 5;
    grid-column: 1 / span 2;
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: calc(100% - 20px);
  }
  .pagination-controls {
    flex-wrap: wrap;
  }
  .list-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .shepherd-element {
    max-width: 90vw;
  }
  .shepherd-footer {
    flex-direction: column;
    gap: 10px;
  }
  .shepherd-button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

#deleteSelectedRowsBtn {
    background: linear-gradient(145deg, #f85757, #ef4444);
    color: white;
    border: none;
    border-radius: 8px;
    
    width: auto;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 0.9rem;
    
    cursor: pointer;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease-out;
}

#deleteSelectedRowsBtn:hover,
#deleteSelectedRowsBtn:focus {
    background: linear-gradient(145deg, #ff6b6b, #f55353);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3);
    outline: none;
}

#deleteSelectedRowsBtn:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.storage-warning-banner {
    background-color: #ef4444;
    color: white;
    text-align: center;
    padding: 10px;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 9999;
}

.batch-action-btn {
    color: white;
    border: none;
    border-radius: 8px;
    width: auto;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.25s ease-out;
}

.batch-action-btn:active {
    transform: translateY(0px) scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.batch-btn-danger {
    background: linear-gradient(145deg, #f85757, #ef4444);
}
.batch-btn-danger:hover,
.batch-btn-danger:focus {
    background: linear-gradient(145deg, #ff6b6b, #f55353);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(239, 68, 68, 0.3);
    outline: none;
}

.batch-btn-primary {
    background: linear-gradient(145deg, #60a5fa, #3b82f6);
}
.batch-btn-primary:hover,
.batch-btn-primary:focus {
    background: linear-gradient(145deg, #818cf8, #4f46e5);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(59, 130, 246, 0.3);
    outline: none;
}

/* Disabled dark theme */
#toggleTheme:disabled,
#toggleTheme:disabled:hover {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.dark #toggleTheme:disabled,
.dark #toggleTheme:disabled:hover {
  background: #334155;
  color: #94a3b8;
}
/* Disabled dark theme */

.toast.toast-undo span {
    flex-grow: 1;
    margin-right: 10px;
}

.toast-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-weight: bold;
}

.toast-close-btn:hover {
    opacity: 1;
}