* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  background: #0f1015;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
}

/* =========================
   LAYOUT BASE
========================= */

.container-scroller {
  display: flex;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

.sidebar {
  width: 245px;
  min-width: 245px;
  background: linear-gradient(180deg, #10131d 0%, #111827 100%);
  padding: 24px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand h1 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 30px;
}

.profile-box {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.profile-avatar,
.topbar-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.profile-info h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.profile-info p {
  color: #8a93a6;
  font-size: 14px;
}

.nav-section-title {
  color: #8a93a6;
  margin-bottom: 14px;
  font-size: 14px;
}

/* =========================
   SIDEBAR MENU
========================= */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item {
  text-decoration: none;
  color: #9aa4b8;
  padding: 12px 16px;
  border-radius: 14px;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item span {
  flex: 1;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item-logout {
  margin-top: 10px;
  color: #fca5a5;
}

.nav-item-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fff;
}

/* =========================
   HEADER / TOPBAR
========================= */

.page-body-wrapper {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.topbar,
.navbar {
  height: 72px;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.topbar-left,
.topbar-right,
.navbar-left,
.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.menu-button {
  background: transparent;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
}

.search-input {
  width: 320px;
  max-width: 100%;
  background: #0f172a;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
}

.action-button {
  background: #16c95b;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.green {
  background: #00d25b;
}

.status-dot.red {
  background: #fc424a;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-select,
.context-select {
  min-width: 150px;
  background: #0f172a;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 12px;
}

/* =========================
   MAIN
========================= */

.main-panel {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: #000814;
  overflow-x: hidden;
}

.content-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 24px;
}

.card {
  background: #191c24;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  min-width: 0;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}

.empty-state {
  color: #8a93a6;
}

.footer {
  padding: 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #8a93a6;
}

/* =========================
   CONTEXT BOX
========================= */

.context-box {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.context-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.context-label {
  font-size: 12px;
  color: #94a3b8;
}

.context-value {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

/* =========================
   TABLES
========================= */

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 14px;
}

.data-table th {
  color: #8a93a6;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* =========================
   REPORT TABLE FIX
========================= */

.page-body-wrapper,
.main-panel,
.content-wrapper,
.card {
  min-width: 0;
}

#report-table {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  overflow-y: hidden;
  display: block;
}

#report-table table {
  min-width: 1600px;
  width: max-content;
  border-collapse: collapse;
}

#report-table th,
#report-table td {
  white-space: nowrap;
}

/* =========================
   BUTTONS / ALERTS
========================= */

.btn-primary,
.btn-secondary {
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: white;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 8px 12px;
  font-size: 13px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.alert-error {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

/* =========================
   BADGES
========================= */

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background: rgba(34, 197, 94, 0.14);
  color: #bbf7d0;
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fecaca;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

/* =========================
   LOGIN PAGE
========================= */

.login-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 28%),
    radial-gradient(circle at bottom right, rgba(6, 182, 212, 0.18), transparent 25%),
    #0b1020;
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 34px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.login-brand {
  font-size: 14px;
  font-weight: 700;
  color: #7dd3fc;
  letter-spacing: 1px;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.login-card h1 {
  font-size: 30px;
  margin-bottom: 8px;
}

.login-subtitle {
  color: #9aa4b8;
  margin-bottom: 24px;
}

.login-form .form-group {
  margin-bottom: 18px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-size: 14px;
}

.login-form input {
  width: 100%;
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 13px 14px;
}

/* =========================
   ADMIN FORMS
========================= */

.admin-form .form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-form .form-group {
  min-width: 0;
}

.admin-form .form-group-full {
  grid-column: 1 / -1;
}

.admin-form label {
  display: block;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-size: 14px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 14px;
}

.admin-form textarea {
  resize: vertical;
}

.form-checkbox label,
.checkbox-inline {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.form-checkbox input[type="checkbox"],
.checkbox-inline input {
  width: auto;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.form-actions a {
  text-decoration: none;
}

/* =========================
   PROJECT LISTS
========================= */

.projects-checkbox-list {
  display: block;
  max-height: 250px;
  overflow-y: auto;
  background: #0f172a;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.project-checkbox-row {
  display: block;
  margin-bottom: 10px;
}

.project-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}

.project-checkbox input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.users-edit-card {
  padding: 28px;
}

.projects-edit-list {
  display: block;
  max-height: 320px;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
}

.projects-group-title {
  margin-top: 10px;
  margin-bottom: 10px;
  color: #7dd3fc;
  font-weight: 700;
  font-size: 14px;
}

.projects-group-title:first-child {
  margin-top: 0;
}

.project-edit-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: #fff;
  margin-bottom: 10px;
  cursor: pointer;
}

.project-edit-item input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

/* =========================
   USERS PAGE
========================= */

.users-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.users-toolbar-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px) {
  .search-input {
    width: 220px;
  }
}

@media (max-width: 900px) {
  .container-scroller {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
  }

  .topbar,
  .navbar {
    height: auto;
    padding: 16px;
    flex-wrap: wrap;
  }

  .topbar-left,
  .topbar-right,
  .navbar-left,
  .navbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .content-wrapper {
    padding: 18px;
  }

  .admin-form .form-grid {
    grid-template-columns: 1fr;
  }
}
.badge-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
}

.language-flag {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: 0.2s ease;
}

.language-flag:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.18);
}

.language-flag.active {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18);
}
.language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
}

.language-flag {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}

.language-flag.active {
  border-color: #38bdf8;
}