:root {
  --primary: #5a2e2f;
  --accent: #d4af37;
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.1);
  --bg-dark: #120b0b;
  --sidebar-width: 240px;
  --sidebar-collapsed: 78px;
}

/* --- Base Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at top left, #2b1414, #1c0d0d, var(--bg-dark));
  color: white; 
  height: 100vh; 
  width: 100vw;
  overflow: hidden; 
}

.main-container {
  display: flex;
  width: 100%;
  height: 100%;
}

/* --- Centered Login Layout --- */
.centered-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at top left, #2b1414, #1c0d0d, var(--bg-dark));
}

.glass-box {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  padding: 40px;
  border-radius: 24px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.glass-box h2 { font-size: 1.5rem; margin-bottom: 8px; font-weight: 800; }
.glass-box p { color: var(--accent); font-size: 0.8rem; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 1px; }

/* --- Themed Inputs --- */
.glass-box input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  width: 100%;
  outline: none;
  transition: 0.2s;
}

.glass-box input:focus { border-color: var(--primary); background: rgba(255,255,255,0.1); }

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  width: 100%;
  transition: 0.2s;
}

.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); }

.error-text { color: #ff4b2b; font-size: 0.8rem; margin-top: 15px; display: none; }

/* --- Sidebar --- */
.tabs-nav {
  width: var(--sidebar-width);
  height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  padding: 32px 16px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0; 
  z-index: 100;
}

.tabs-nav.collapsed { width: var(--sidebar-collapsed); padding: 32px 12px; }

.nav-links { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
  flex: 1; 
  overflow-y: auto; 
  overflow-x: hidden; 
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.nav-links::-webkit-scrollbar { width: 4px; }
.nav-links::-webkit-scrollbar-track { background: transparent; }
.nav-links::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.nav-links::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.tab-btn {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  background: transparent; border: none; border-radius: 16px;
  cursor: pointer; color: rgba(255, 255, 255, 0.4); transition: 0.3s;
  width: 100%;
}
.tab-btn.active { background: rgba(255, 255, 255, 0.08); color: white; }

.tabs-nav.collapsed .tab-title, 
.tabs-nav.collapsed .nav-header h2,
.tabs-nav.collapsed .nav-header p,
.tabs-nav.collapsed .status-mini span { 
  opacity: 0; visibility: hidden; position: absolute;
}

/* --- Burger Menu Fix --- */
.hamburger-btn {
  background: transparent !important;
  border: 1px solid var(--glass-border) !important;
  color: white !important;
}

/* --- Content Area --- */
.tabs-content { 
  flex: 1; 
  height: 100%;
  padding: 32px; 
  display: flex; 
  flex-direction: column; 
  min-width: 0; 
  overflow-y: auto; /* Allows vertical scrolling for the whole right pane if needed */
}

/* --- Table & Scroll Fix --- */
.table-container { 
  background: rgba(255, 255, 255, 0.01); 
  border: 1px solid var(--glass-border); 
  border-radius: 20px; 
  flex: 1; 
  overflow: auto; 
  margin-top: 10px;
  position: relative;
}

.table-container::-webkit-scrollbar { width: 8px; height: 8px; }
.table-container::-webkit-scrollbar-track { background: transparent; }
.table-container::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.3); 
  border-radius: 10px;
}
.table-container::-webkit-scrollbar-thumb:hover { background: var(--accent); }

table { width: 100%; border-collapse: collapse; min-width: 2400px; }

th { 
  position: sticky; top: 0; background: #0d121f; 
  color: var(--accent); padding: 16px 20px; 
  z-index: 20; text-align: left; font-size: 0.7rem; 
  text-transform: uppercase; border-bottom: 1px solid var(--glass-border);
}

td { padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.85rem; white-space: nowrap; color: rgba(255,255,255,0.8); }

td.title-cell { white-space: normal; min-width: 400px; font-weight: 500; line-height: 1.5; color: white; }
td.notes-cell { white-space: normal; min-width: 450px; font-size: 0.8rem; opacity: 0.6; }

/* --- Specific Sticky Topic Logic Removed --- */

/* --- Reporting Dashboard Styles --- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  transition: transform 0.2s, background 0.2s;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.stat-header h3 {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .value {
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
}

.chart-container {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 32px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
}

/* --- Calendar Styles --- */
.calendar-wrapper {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 600px;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--glass-border);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: minmax(100px, 1fr);
  gap: 8px;
  flex: 1;
}

.calendar-day {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: 0.2s;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--primary);
}

.calendar-day.empty {
  background: transparent;
  border: none;
  cursor: default;
}

.calendar-day.has-articles {
  cursor: pointer;
}

.day-number {
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.8);
}

.region-indicator {
  display: inline-block;
  background: rgba(99, 102, 241, 0.2);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin: 2px 2px 0 0;
  text-transform: uppercase;
}

/* --- Modal Styles --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.article-card h4 { margin-bottom: 8px; color: white; font-size: 1rem; }
.article-card p { margin-bottom: 4px; color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.article-card a { color: var(--primary); text-decoration: none; font-weight: bold; font-size: 0.85rem;}
.article-card a:hover { text-decoration: underline; }
\n/* --- Unified Board Components --- */
.topics-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}

.btn-create {
  background: rgba(99, 102, 241, 0.2); border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--accent); padding: 10px 20px; border-radius: 12px; cursor: pointer;
  font-weight: 700; display: flex; align-items: center; gap: 8px; transition: all 0.2s;
}
.btn-create:hover { background: rgba(99, 102, 241, 0.4); transform: translateY(-2px); color: white; }

/* Modifier classes for btn-create */
.btn-create.emerald { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.4); color: #10b981; }
.btn-create.emerald:hover { background: rgba(16, 185, 129, 0.4); }

.btn-create.pink { background: rgba(236, 72, 153, 0.2); border-color: rgba(236, 72, 153, 0.4); color: #ec4899; }
.btn-create.pink:hover { background: rgba(236, 72, 153, 0.4); }

.topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }

.topic-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px;
  padding: 24px; display: flex; flex-direction: column; cursor: pointer; transition: transform 0.2s, background 0.2s;
}
.topic-card:hover { background: rgba(255, 255, 255, 0.05); transform: translateY(-4px); }
.topic-card .status-pill {
  align-self: flex-start; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; margin-bottom: 12px;
}
.topic-card h3 { font-size: 1.25rem; margin-bottom: 12px; color: white; }
.topic-card .meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.topic-card .meta span {
  background: rgba(0, 0, 0, 0.3); padding: 4px 8px; border-radius: 6px; font-size: 0.8rem; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 4px;
}
.topic-card p.notes {
  color: rgba(255,255,255,0.5); font-size: 0.9rem; flex-grow: 1; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 16px;
}

.status-proposed { background: rgba(99, 102, 241, 0.2); color: #6366f1; border: 1px solid rgba(99, 102, 241, 0.3); }
.status-archived { background: rgba(107, 114, 128, 0.2); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }

.card-placeholder {
  background: rgba(255,255,255,0.02); border: 1px dashed rgba(255,255,255,0.1); border-radius: 16px;
  padding: 40px; text-align: center; color: rgba(255,255,255,0.4); grid-column: 1 / -1;
}

/* Modals */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-content {
  background: #111; border: 1px solid var(--glass-border); border-radius: 24px;
  width: 100%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-header { padding: 20px; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer { padding: 20px; border-top: 1px solid var(--glass-border); display: flex; justify-content: flex-end; gap: 12px; background: rgba(0,0,0,0.2); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 8px; color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.form-row { display: flex; gap: 16px; }
.form-row > * { flex: 1; }
.input-field { width: 100%; padding: 12px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); border-radius: 12px; color: white; outline: none; }
.input-field:focus { border-color: var(--accent); }

.comments-section { background: rgba(0,0,0,0.2); border-radius: 12px; padding: 16px; margin-top: 24px; }
.comment { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.comment-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: rgba(255,255,255,0.4); margin-bottom: 6px; }
.comment-meta strong { color: var(--accent); }
.add-comment-box { display: flex; gap: 8px; margin-top: 16px; }
.btn-secondary { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 10px 16px; border-radius: 12px; cursor: pointer; font-weight: 600; }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-success { background: rgba(16, 185, 129, 0.2); border: 1px solid rgba(16, 185, 129, 0.4); color: #10b981; }
.btn-success:hover { background: rgba(16, 185, 129, 0.4); color: white; }

.backlog-accordion { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); border-radius: 16px; padding: 16px 24px; color: white; }
.backlog-accordion summary { cursor: pointer; font-size: 1.1rem; font-weight: 600; color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: 10px; list-style: none; }
.backlog-accordion summary::-webkit-details-marker { display: none; }
.backlog-accordion[open] summary { margin-bottom: 20px; color: white; }

/* --- Index Hub Styles --- */
.hub-container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; text-align: center; }
.hub-header { margin-bottom: 40px; }
.hub-header h1 { font-size: 3rem; font-weight: 800; background: linear-gradient(135deg, #fff, rgba(255,255,255,0.5)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 10px; }
.hub-header p { color: rgba(255, 255, 255, 0.6); font-size: 1.2rem; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; width: 100%; max-width: 900px; }
.hub-card { background: var(--glass-bg, rgba(255,255,255,0.02)); border: 1px solid var(--glass-border); border-radius: 20px; padding: 30px; text-align: left; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); position: relative; overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: white; }
.hub-card:hover { transform: translateY(-5px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); border-color: rgba(255, 255, 255, 0.2); }
.hub-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent); z-index: 0; opacity: 0; transition: opacity 0.3s; }
.hub-card:hover::before { opacity: 1; }
.hub-card > * { position: relative; z-index: 1; }
.card-icon-wrapper { width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.card-icon-wrapper.dashboard { background: rgba(99, 102, 241, 0.1); color: #6366f1; border: 1px solid rgba(99, 102, 241, 0.3); }
.card-icon-wrapper.topics { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.hub-card h2 { font-size: 1.5rem; margin-bottom: 8px; }
.hub-card p { color: rgba(255, 255, 255, 0.6); font-size: 0.95rem; flex-grow: 1; }
.hub-card .go-arrow { margin-top: 20px; align-self: flex-end; color: rgba(255,255,255,0.4); transition: all 0.3s; }
.hub-card:hover .go-arrow { color: white; transform: translateX(5px); }
.logout-btn-hub { position: absolute; top: 20px; right: 20px; background: transparent; border: 1px solid var(--glass-border); color: rgba(255,255,255,0.6); padding: 10px 16px; border-radius: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.logout-btn-hub:hover { background: rgba(255, 75, 43, 0.1); border-color: rgba(255, 75, 43, 0.3); color: #ff4b2b; }

/* -- Users specifically -- */
.glass-select { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--glass-border); color: white; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; width: 100%; outline: none; appearance: none; }
.glass-select option { background: var(--bg-dark); color: white; }

/* --- Premium Custom Checkbox --- */
.glass-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  vertical-align: middle;
}

.glass-checkbox:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.glass-checkbox:checked {
  background-color: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
}

.glass-checkbox.pink:checked {
  background-color: #ec4899;
  border-color: #ec4899;
}
.glass-checkbox.pink:hover {
  border-color: #ec4899;
}
