/* ============================================================
   BE:KI Loop – styles.css
   Design: beki-design.css (Navy #1e3d73 / Teal #3a8c68)
   ============================================================ */
@import url('./beki-design.css');

/* ---- Variable-Mapping: lokale Namen → beki-design-Tokens ---- */
:root {
  --color-primary:        var(--beki-navy);
  --color-primary-dark:   var(--beki-navy-d);
  --color-primary-light:  var(--beki-navy-l);
  --color-primary-muted:  var(--beki-navy-bg);
  --color-secondary:      var(--beki-teal);
  --color-accent:         var(--beki-teal);

  --color-bg:             var(--beki-bg);
  --color-surface:        var(--beki-card);
  --color-surface-2:      var(--beki-soft);
  --color-border:         var(--beki-line);
  --color-border-light:   var(--beki-line-l);

  --color-text:           var(--beki-text);
  --color-text-muted:     var(--beki-text-muted);
  --color-text-light:     var(--beki-text-light);

  --color-warning:        var(--beki-warning);
  --color-warning-bg:     var(--beki-warning-bg);
  --color-warning-border: #ffd280;

  --color-success:        var(--beki-teal-d);
  --color-success-bg:     var(--beki-teal-bg);
  --color-success-border: #c8e8d8;

  --color-info:           var(--beki-navy);
  --color-info-bg:        var(--beki-navy-bg);
  --color-info-border:    #c8d4ea;

  --color-danger:         var(--beki-danger);
  --color-danger-bg:      var(--beki-danger-bg);
  --color-danger-border:  #e88080;

  --sidebar-text:         rgba(255, 255, 255, .7);
  --sidebar-text-hover:   #fff;
  --sidebar-active-bg:    rgba(255, 255, 255, .14);
  --sidebar-hover-bg:     rgba(255, 255, 255, .08);
  --sidebar-border:       rgba(255, 255, 255, .10);
  --sidebar-width:        var(--beki-sidebar-w);
  --topbar-height:        var(--beki-header-h);

  --shadow-xs:  var(--beki-shadow-s);
  --shadow-sm:  var(--beki-shadow-s);
  --shadow-md:  var(--beki-shadow);
  --shadow-lg:  var(--beki-shadow-l);

  --radius-xs:   4px;
  --radius-sm:   var(--beki-radius-s);
  --radius-md:   var(--beki-radius);
  --radius-lg:   var(--beki-radius-l);
  --radius-xl:   var(--beki-radius-xl);
  --radius-full: var(--beki-radius-full);

  --transition: 0.18s ease;
  --font:       var(--beki-font);
}

/* ============================================================
   Layout
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--beki-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 300;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
  box-shadow: 3px 0 20px rgba(13, 35, 71, .28);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 2rem 2.5rem;
  overflow-y: auto;
  background: var(--color-bg);
}

.topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-height);
  background: var(--beki-navy);
  border-bottom: 3px solid var(--beki-teal);
  z-index: 400;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  box-shadow: var(--shadow-sm);
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 50, .55);
  z-index: 250;
  backdrop-filter: blur(4px);
}

/* ============================================================
   Sidebar Components
   ============================================================ */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  background: rgba(255, 255, 255, .92);
}

.sidebar-logo {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--beki-navy);
  letter-spacing: -0.02em;
}

.logo-colon { color: var(--beki-teal); font-weight: 900; }

.logo-sub {
  font-size: 0.85rem;
  font-weight: 500;
  color: #3a6b8a;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topbar-logo .logo-text { color: #fff; }
.topbar-logo .logo-colon { color: var(--beki-teal-l); }
.topbar-logo .logo-sub { color: rgba(255,255,255,.7); }

.topbar-logo .logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
  display: block;
}
.sidebar-logo .logo-img {
  height: 56px;
  width: auto;
  object-fit: contain;
  display: block;
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
}

.sidebar-nav {
  flex: 1;
  padding: 6px 0 10px;
  overflow-y: auto;
}

.sidebar-nav ul { display: flex; flex-direction: column; gap: 2px; }

.nav-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 0.5rem 1.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  color: var(--sidebar-text);
  transition: background var(--transition), color var(--transition);
  position: relative;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  font-family: var(--font);
}

.nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-hover);
  border-left-color: rgba(122, 220, 176, .55);
}

.nav-link.active {
  background: var(--sidebar-active-bg);
  color: #fff;
  border-left-color: rgba(122, 220, 176, .78);
}

.nav-link.active::before { display: none; }

.nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; opacity: 0.85; }
.nav-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.nav-link.active .nav-icon { opacity: 1; }

.nav-label { flex: 1; }

.nav-badge {
  background: var(--color-danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  line-height: 1.5;
}

.nav-badge-accent { background: var(--beki-warning); }
.nav-badge[style*="display: none"],
.nav-badge:empty { display: none !important; }

.sidebar-footer {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-user { display: flex; align-items: center; gap: 0.75rem; }

.user-avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--beki-navy), var(--beki-teal));
  color: #fff;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { color: #fff; font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--sidebar-text); font-size: 0.75rem; opacity: 0.75; }

/* Mobile Menu Button */
.menu-btn {
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

.hamburger-line {
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
  display: block;
}

.menu-btn.open .hamburger-line:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open .hamburger-line:nth-child(2) { opacity: 0; }
.menu-btn.open .hamburger-line:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  gap: 1rem;
  color: var(--color-text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--beki-navy);
  border-radius: 50%;
  animation: beki-spin .9s linear infinite;
}

/* ============================================================
   Section Layout
   ============================================================ */
.section-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
}

.section-header h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--beki-navy);
  line-height: 1.3;
}

.section-subtitle {
  margin-top: 0.35rem;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--beki-navy);
  margin-bottom: 1rem;
  margin-top: 1.75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.section-title:first-of-type { margin-top: 0; }

.header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.header-actions h1 { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  overflow: hidden;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-body { padding: 1.25rem; }

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--beki-navy);
}

.card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--color-surface-2);
}

.card-list { display: flex; flex-direction: column; gap: 0.875rem; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:active  { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-primary  { background: var(--beki-navy); color: #fff; border-color: var(--beki-navy); }
.btn-primary:hover { background: #16306a; border-color: #16306a; }

.btn-secondary { background: var(--beki-teal); color: #fff; border-color: var(--beki-teal); }
.btn-secondary:hover { background: var(--beki-teal-d); border-color: var(--beki-teal-d); }

.btn-outline { background: transparent; color: var(--beki-navy); border-color: var(--beki-navy); }
.btn-outline:hover { background: var(--beki-navy-bg); }

.btn-ghost { background: transparent; color: var(--color-text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--color-surface-2); color: var(--color-text); border-color: var(--color-border); }

.btn-danger { background: var(--beki-danger); color: #fff; border-color: var(--beki-danger); }
.btn-danger:hover { background: #9a1818; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-icon { padding: 0.5rem; width: 36px; height: 36px; border-radius: var(--radius-sm); }

.btn svg { width: 15px; height: 15px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================
   Badges & Status Labels
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-primary   { background: var(--beki-navy-bg);    color: var(--beki-navy);    }
.badge-secondary { background: var(--beki-teal-bg);    color: var(--beki-teal-d);  }
.badge-success   { background: var(--beki-teal-bg);    color: var(--beki-teal-d);  }
.badge-warning   { background: var(--beki-warning-bg); color: var(--beki-warning); }
.badge-danger    { background: var(--beki-danger-bg);  color: var(--beki-danger);  }
.badge-info      { background: var(--beki-navy-bg);    color: var(--beki-navy);    }
.badge-muted     { background: var(--color-border);    color: var(--color-text-muted); }

.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot-success { background: var(--beki-teal); }
.status-dot-warning { background: var(--beki-warning); }
.status-dot-muted   { background: var(--color-text-light); }

/* ============================================================
   Filter Bars
   ============================================================ */
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  white-space: nowrap;
}

.filter-pill:hover { border-color: var(--beki-navy); color: var(--beki-navy); background: var(--beki-navy-bg); }
.filter-pill.active { background: var(--beki-navy); border-color: var(--beki-navy); color: #fff; }

/* ============================================================
   Search
   ============================================================ */
.search-wrap { position: relative; max-width: 400px; }

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  font-size: 0.9rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font);
  outline: none;
}

.search-input:focus {
  border-color: var(--beki-navy);
  box-shadow: 0 0 0 3px var(--beki-navy-bg);
}

.search-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--color-text-muted); pointer-events: none; }
.search-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ============================================================
   Forms
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }

.form-label { font-size: 13px; font-weight: 600; color: #475569; }

.form-control {
  padding: 10px 14px;
  font-size: 14px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: var(--font);
  outline: none;
}

.form-control:focus {
  border-color: var(--beki-teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(58, 140, 104, .14);
}

.form-control:disabled { background: var(--color-surface-2); color: var(--color-text-muted); cursor: not-allowed; }

textarea.form-control { resize: vertical; min-height: 80px; line-height: 1.65; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7a8d' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}

.form-hint { font-size: 0.78rem; color: var(--color-text-muted); }

/* ============================================================
   Toast Notifications
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.1rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  max-width: 340px;
  pointer-events: auto;
  animation: toast-in 0.25s ease;
  border-left: 4px solid var(--beki-navy);
}

.toast.toast-success { border-left-color: var(--beki-teal); }
.toast.toast-warning { border-left-color: var(--beki-warning); }
.toast.toast-error   { border-left-color: var(--beki-danger); }
.toast.toast-info    { border-left-color: var(--beki-navy); }
.toast.toast-out { animation: toast-out 0.25s ease forwards; }

@keyframes toast-in  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); }   to { opacity: 0; transform: translateX(20px); } }

.toast-icon  { font-size: 1rem; flex-shrink: 0; }
.toast-text  { flex: 1; line-height: 1.4; }
.toast-close { background: transparent; border: none; color: var(--color-text-muted); cursor: pointer; padding: 0; font-size: 1rem; flex-shrink: 0; }

/* ============================================================
   Dashboard
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); border-color: var(--beki-navy); }

.stat-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--beki-navy-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.stat-icon-wrap svg { width: 20px; height: 20px; stroke: var(--beki-navy); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.stat-value { font-size: 2rem; font-weight: 800; color: var(--beki-navy); line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--color-text-muted); font-weight: 500; }

/* Quick Access */
.quick-access-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.quick-tile {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  color: var(--color-text);
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.quick-tile:hover {
  background: var(--beki-navy-bg);
  border-color: var(--beki-navy);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.tile-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; }
.tile-icon svg { width: 22px; height: 22px; stroke: var(--beki-navy); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tile-label { font-size: 0.78rem; font-weight: 600; color: var(--color-text-muted); line-height: 1.3; }
.quick-tile:hover .tile-label { color: var(--beki-navy); }

/* Info Tile */
.info-tile {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.75rem;
  box-shadow: var(--shadow-xs);
  border-left: 4px solid var(--beki-navy);
}

.info-tile h3 { font-size: 14px; font-weight: 700; color: var(--beki-navy); margin-bottom: 1rem; }

.info-tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }

.info-item strong { display: block; color: var(--beki-navy); font-size: 0.875rem; margin-bottom: 0.25rem; }
.info-item p { font-size: 0.825rem; color: var(--color-text-muted); line-height: 1.5; }

/* ============================================================
   News
   ============================================================ */
.news-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  position: relative;
}

.news-card:hover { box-shadow: var(--shadow-md); border-color: var(--beki-navy); }

.news-card.unread::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--beki-navy);
  border-radius: 3px 0 0 3px;
}

.news-card.important::before { background: var(--beki-warning); }

.news-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }

.news-title { font-size: 0.95rem; font-weight: 700; color: var(--color-text); line-height: 1.4; }
.news-card.read .news-title { color: var(--color-text-muted); font-weight: 500; }

.news-excerpt { font-size: 0.855rem; color: var(--color-text-muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.news-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.news-reactions { display: flex; gap: 0.4rem; }

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}

.reaction-btn:hover { background: var(--beki-navy-bg); border-color: var(--beki-navy); color: var(--beki-navy); }

/* ============================================================
   Participation
   ============================================================ */
.participation-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
}

.participation-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.participation-title { font-size: 1rem; font-weight: 700; color: var(--beki-navy); line-height: 1.4; }
.participation-description { font-size: 0.875rem; color: var(--color-text-muted); line-height: 1.55; }

.survey-options { display: flex; flex-direction: column; gap: 0.5rem; }

.survey-option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--color-text);
  text-align: left;
  transition: all var(--transition);
}

.survey-option:hover { border-color: var(--beki-navy); background: var(--beki-navy-bg); color: var(--beki-navy); }
.survey-option.voted { border-color: var(--beki-teal); background: var(--beki-teal-bg); color: var(--beki-teal-d); font-weight: 700; cursor: default; }

.vote-results { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.25rem; }
.vote-result-row { display: flex; flex-direction: column; gap: 0.25rem; }
.vote-result-label { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--color-text-muted); }
.vote-result-label .voted-label { color: var(--beki-teal-d); font-weight: 700; }

.progress-bar { height: 8px; background: var(--color-border); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: var(--beki-navy); border-radius: var(--radius-full); transition: width 0.6s ease; }
.progress-fill.top { background: var(--beki-teal); }

.idea-list { display: flex; flex-direction: column; gap: 0.5rem; }

.idea-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: var(--color-surface-2);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  gap: 1rem;
}

.idea-text { font-size: 0.875rem; color: var(--color-text); flex: 1; }
.idea-votes { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; color: var(--color-text-muted); }

/* ============================================================
   Wiki
   ============================================================ */
.wiki-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items: start; }

.wiki-sidebar {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 1rem;
}

.wiki-sidebar h3 { font-size: 11px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 0.75rem; }

.wiki-cat-list { display: flex; flex-direction: column; gap: 2px; }

.wiki-cat-btn {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.wiki-cat-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
.wiki-cat-btn.active { background: var(--beki-navy-bg); color: var(--beki-navy); font-weight: 700; }

.wiki-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}

.wiki-card:hover { box-shadow: var(--shadow-md); border-color: var(--beki-navy); }

.wiki-title { font-size: 0.95rem; font-weight: 700; color: var(--beki-navy); margin-bottom: 0.4rem; }
.wiki-excerpt { font-size: 0.85rem; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 0.75rem; }

.wiki-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.wiki-tag { display: inline-flex; padding: 0.15rem 0.55rem; font-size: 11px; background: var(--beki-navy-bg); border: 1px solid #c8d4ea; border-radius: var(--radius-full); color: var(--beki-navy); font-weight: 600; }

.wiki-expanded { background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow-sm); display: none; }
.wiki-expanded.open { display: block; }

.wiki-content { font-size: 0.9rem; line-height: 1.7; color: var(--color-text); margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }

/* ============================================================
   People
   ============================================================ */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

.person-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.person-card:hover { box-shadow: var(--shadow-md); border-color: var(--beki-navy); }

.person-avatar-wrap { display: flex; align-items: center; gap: 0.9rem; }

.person-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  flex-shrink: 0;
}

.person-name  { font-size: 0.95rem; font-weight: 700; color: var(--beki-navy); line-height: 1.3; }
.person-role  { font-size: 0.82rem; color: var(--color-text-muted); }
.person-responsibility { font-size: 0.82rem; color: var(--color-text-muted); line-height: 1.5; padding-top: 0.25rem; border-top: 1px solid var(--color-border-light); }

/* ============================================================
   Files
   ============================================================ */
.category-tabs { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--color-border); margin-bottom: 1.25rem; overflow-x: auto; }

.cat-tab {
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
  transition: all var(--transition);
}

.cat-tab:hover { color: var(--beki-navy); }
.cat-tab.active { color: var(--beki-navy); border-bottom-color: var(--beki-navy); }

.files-list { display: flex; flex-direction: column; gap: 0.5rem; }

.file-row {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition);
}

.file-row:hover { border-color: var(--beki-navy); }

.file-icon-wrap { width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; background: var(--color-surface-2); border: 1px solid var(--color-border); }

.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 0.9rem; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta-row { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.15rem; display: flex; gap: 0.5rem; }
.file-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }

/* ============================================================
   Events
   ============================================================ */
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }

.event-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), border-color var(--transition);
  display: flex;
}

.event-card:hover { box-shadow: var(--shadow-md); border-color: var(--beki-navy); }

.event-date-stripe {
  width: 58px;
  background: linear-gradient(160deg, var(--beki-navy-d), var(--beki-navy));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  flex-shrink: 0;
  color: #fff;
  text-align: center;
}

.event-day   { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.event-month { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.85; margin-top: 0.2rem; }

.event-body { flex: 1; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.event-title { font-size: 0.92rem; font-weight: 700; color: var(--beki-navy); line-height: 1.4; }
.event-details { font-size: 0.8rem; color: var(--color-text-muted); display: flex; flex-direction: column; gap: 0.2rem; }
.event-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }

.attend-btn { font-size: 0.8rem; padding: 0.35rem 0.75rem; }
.attend-btn.attending { background: var(--beki-teal-bg); border-color: #a0d0b8; color: var(--beki-teal-d); }

.capacity-label { font-size: 0.78rem; color: var(--color-text-light); }

/* ============================================================
   Chat
   ============================================================ */
.chat-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; height: calc(100vh - 200px); min-height: 400px; }

.channel-list { background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); overflow-y: auto; box-shadow: var(--shadow-xs); }

.channel-list-header { padding: 0.85rem 1rem; font-size: 11px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .1em; border-bottom: 1px solid var(--color-border); }

.channel-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  transition: all var(--transition);
}

.channel-item:hover { background: var(--color-surface-2); color: var(--color-text); }
.channel-item.active { background: var(--beki-navy-bg); color: var(--beki-navy); font-weight: 700; }

.channel-icon { font-size: 0.9rem; flex-shrink: 0; }

.chat-area { background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-xs); }

.chat-header { padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; background: var(--color-surface-2); }
.chat-header-title { font-size: 0.95rem; font-weight: 700; color: var(--beki-navy); }
.chat-header-desc  { font-size: 0.78rem; color: var(--color-text-muted); }

.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 0.85rem; scroll-behavior: smooth; }

.message { display: flex; flex-direction: column; max-width: 72%; gap: 0.2rem; }
.message.mine { align-self: flex-end; align-items: flex-end; }
.message:not(.mine) { align-self: flex-start; }

.message-bubble { padding: 0.6rem 0.9rem; border-radius: var(--radius-md); font-size: 0.875rem; line-height: 1.5; color: var(--color-text); background: var(--color-surface-2); border: 1.5px solid var(--color-border); }
.message.mine .message-bubble { background: var(--beki-navy); color: #fff; border-color: var(--beki-navy); }

.message-meta { display: flex; gap: 0.4rem; align-items: center; font-size: 0.72rem; color: var(--color-text-light); padding: 0 0.25rem; }
.message-sender { font-weight: 600; color: var(--color-text-muted); }

.chat-input { padding: 0.85rem 1.25rem; border-top: 1px solid var(--color-border); background: var(--color-surface-2); flex-shrink: 0; }
.chat-input-form { display: flex; gap: 0.6rem; align-items: flex-end; }

.chat-input-field {
  flex: 1;
  padding: 0.6rem 0.9rem;
  font-size: 0.875rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font);
  resize: none;
  outline: none;
  transition: border-color var(--transition);
}

.chat-input-field:focus { border-color: var(--beki-teal); box-shadow: 0 0 0 3px rgba(58,140,104,.14); }

/* ============================================================
   Admin
   ============================================================ */
.demo-banner {
  background: var(--beki-warning-bg);
  border: 1.5px solid #ffd280;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--beki-warning);
}

.demo-banner-icon { font-size: 1.2rem; flex-shrink: 0; }
.demo-banner strong { color: var(--beki-warning); }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.admin-section-card { background: var(--color-surface); border: 1.5px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-xs); opacity: 0.75; }
.admin-section-card .card-header { background: var(--color-surface-2); }
.admin-section-card .card-body { padding: 1rem 1.25rem; }

.admin-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.admin-field:last-child { margin-bottom: 0; }
.admin-field label { font-size: 0.78rem; font-weight: 600; color: var(--color-text-muted); }

.admin-field input,
.admin-field select { padding: 0.5rem 0.75rem; font-size: 0.85rem; border: 1px solid var(--color-border); border-radius: var(--radius-xs); background: var(--color-surface-2); color: var(--color-text-muted); font-family: var(--font); cursor: not-allowed; }

/* ============================================================
   Utilities
   ============================================================ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem; text-align: center; gap: 0.75rem; color: var(--color-text-muted); }
.empty-state-icon { font-size: 2.5rem; opacity: 0.5; }
.empty-state h3 { font-size: 0.95rem; font-weight: 700; color: var(--color-text); }
.empty-state p { font-size: 0.85rem; max-width: 280px; line-height: 1.55; }

.divider { height: 1px; background: var(--color-border); margin: 1.25rem 0; }

.text-muted    { color: var(--color-text-muted); }
.text-primary  { color: var(--beki-navy); }
.text-success  { color: var(--beki-teal-d); }
.text-warning  { color: var(--beki-warning); }
.text-danger   { color: var(--beki-danger); }
.text-sm       { font-size: 0.825rem; }
.text-xs       { font-size: 0.75rem; }
.font-bold     { font-weight: 700; }
.font-medium   { font-weight: 500; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.mt-sm { margin-top: 0.5rem; }
.mt-md { margin-top: 1rem; }

/* ============================================================
   Responsive – Tablet (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .stats-grid         { grid-template-columns: repeat(2, 1fr); }
  .quick-access-grid  { grid-template-columns: repeat(3, 1fr); }
  .info-tile-grid     { grid-template-columns: 1fr; }
  .wiki-layout        { grid-template-columns: 1fr; }
  .wiki-sidebar       { position: static; }
  .wiki-cat-list      { flex-direction: row; flex-wrap: wrap; gap: 0.4rem; }
  .wiki-cat-btn       { width: auto; }
  .chat-layout        { grid-template-columns: 1fr; height: auto; }
  .channel-list       { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem; border-radius: var(--radius-md); }
  .channel-list-header { display: none; }
  .channel-item       { width: auto; border-radius: var(--radius-sm); padding: 0.4rem 0.85rem; }
}

/* ============================================================
   Responsive – Mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  .topbar  { display: flex; }
  .overlay { display: none; }
  .overlay.active { display: block; }

  .sidebar { transform: translateX(-100%); top: 0; z-index: 350; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }

  .main-content { margin-left: 0; padding: 1rem; padding-top: calc(var(--topbar-height) + 1rem); }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .quick-access-grid { grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
  .events-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: 1fr; }
  .file-row { flex-wrap: wrap; }
  .file-actions { width: 100%; justify-content: flex-end; }
  .chat-layout { grid-template-columns: 1fr; }
  .channel-list { display: flex; overflow-x: auto; flex-wrap: nowrap; gap: 0; padding: 0; }
  .channel-item { flex-shrink: 0; }
  .section-header h1 { font-size: 1.3rem; }
  .toast-container { bottom: 1rem; right: 1rem; left: 1rem; }
  .toast { max-width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Responsive – Small Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-access-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { gap: 0.35rem; }
  .filter-pill { font-size: 0.78rem; padding: 0.3rem 0.65rem; }
  .news-card-top { flex-direction: column; gap: 0.5rem; }
  .news-reactions { flex-wrap: wrap; }
}
