@charset "UTF-8";

:root {
  --primary-color: #13455e;
  --secondary-color: #ebf2f7;
  --text-color: #343434;
  --accent-color: #1e84b5;
  --white-color: #ffffff;
  --divider-color: #0e384c1a;
  --sidebar-color: #123d54;
  --sidebar-active: #1e84b5;
  --success-color: #25a244;
  --warning-color: #f59e0b;
  --default-font: "Poppins", sans-serif;
}

* {
  box-sizing: border-box;
}

body.backend-body {
  font-family: var(--default-font);
  background: var(--secondary-color);
  color: var(--text-color);
  margin: 0;
}

.backend-layout {
  display: flex;
  min-height: 100vh;
}

.backend-sidebar {
  width: 88px;
  background: var(--sidebar-color);
  color: var(--white-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0;
  gap: 18px;
}

.backend-sidebar .logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--white-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.backend-sidebar .logo img {
  max-width: 36px;
}

.backend-sidebar a {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white-color);
  text-decoration: none;
  transition: background 0.2s ease;
}

.backend-sidebar a.active,
.backend-sidebar a:hover {
  background: var(--sidebar-active);
}

.backend-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.backend-topbar {
  background: var(--white-color);
  border-bottom: 1px solid var(--divider-color);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.backend-topbar h1 {
  font-size: 22px;
  margin: 0;
  color: var(--primary-color);
}

.backend-topbar .meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: #6b7280;
  font-size: 14px;
}

.backend-topbar .btn-refresh {
  background: var(--accent-color);
  color: var(--white-color);
  border: none;
  padding: 8px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.backend-content {
  padding: 28px;
  display: grid;
  gap: 24px;
}

.text-muted {
  color: #6b7280;
  margin: 6px 0 0;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--white-color);
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--divider-color);
  color: var(--primary-color);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
}

.card {
  background: var(--white-color);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(14, 56, 76, 0.08);
  padding: 22px;
}

.card h2 {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--primary-color);
}

.users-table-card + .users-table-card {
  margin-top: 22px;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.table-card-header h3 {
  margin: 0;
  font-size: 17px;
  color: var(--primary-color);
}

.role-badge {
  background: var(--secondary-color);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.users-table th,
.users-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--divider-color);
  font-size: 14px;
}

.users-table th {
  color: #6b7280;
  font-weight: 600;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.active {
  background: rgba(37, 162, 68, 0.15);
  color: var(--success-color);
}

.status-pill.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-color);
}

.status-pill.published {
  background: rgba(37, 162, 68, 0.15);
  color: var(--success-color);
}

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--secondary-color);
  padding: 40px 20px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--white-color);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(14, 56, 76, 0.12);
  padding: 32px;
  text-align: center;
}

.login-card img {
  max-width: 160px;
  margin-bottom: 16px;
}

.login-card h2 {
  margin-bottom: 8px;
  color: var(--primary-color);
}

.login-card p {
  margin: 0 0 24px;
  color: #6b7280;
}

.login-card .form-control {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid var(--divider-color);
  font-size: 14px;
}

.login-card .btn-login {
  width: 100%;
  margin-top: 14px;
  background: var(--accent-color);
  color: var(--white-color);
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

.login-error {
  margin: 8px 0 12px;
  background: rgba(230, 87, 87, 0.12);
  color: #e65757;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  text-align: left;
}

.form-message {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 14px;
}

.form-message.error {
  background: rgba(230, 87, 87, 0.12);
  color: #e65757;
}

.form-message.success {
  background: rgba(37, 162, 68, 0.12);
  color: var(--success-color);
}

.user-form .form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.user-form label {
  font-weight: 600;
  margin-bottom: 6px;
  display: inline-block;
}

.form-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.crm-topbar {
  background: var(--white-color);
  border-bottom: 1px solid var(--divider-color);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.crm-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--secondary-color);
  padding: 10px 14px;
  border-radius: 14px;
  min-width: 280px;
  color: #6b7280;
}

.crm-search input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
}

.crm-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-user-chip {
  background: var(--secondary-color);
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--primary-color);
}

.chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-color);
  color: var(--white-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.crm-content {
  padding: 28px;
  display: grid;
  gap: 24px;
}

.crm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.crm-header h1 {
  margin: 10px 0 6px;
  color: var(--primary-color);
}

.crm-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.crm-back-link {
  color: #6b7280;
  text-decoration: none;
  font-size: 14px;
}

.crm-metrics {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.metric-card {
  background: var(--white-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(14, 56, 76, 0.08);
}

.metric-card h3 {
  margin: 0;
  font-size: 22px;
}

.metric-card p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.metric-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white-color);
}

.metric-icon.purple {
  background: #6366f1;
}

.metric-icon.green {
  background: #22c55e;
}

.metric-icon.lime {
  background: #4ade80;
}

.metric-icon.violet {
  background: #8b5cf6;
}

.crm-card {
  background: var(--white-color);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(14, 56, 76, 0.08);
}

.crm-card h2 {
  margin-top: 0;
}

.crm-team {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.crm-chip {
  background: var(--secondary-color);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
}

.crm-chip.add {
  color: var(--accent-color);
}

.crm-section h2 {
  margin-bottom: 12px;
}

.crm-task-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.crm-task-card {
  background: var(--white-color);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(14, 56, 76, 0.08);
}

.task-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.tag {
  background: var(--secondary-color);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.task-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #6b7280;
}

.task-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-success {
  background: #22c55e;
  color: var(--white-color);
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
}

.btn-danger {
  background: #ef4444;
  color: var(--white-color);
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
}

/* Sidebar Toggle Styles */
#backend-sidebar.backend-sidebar-toggle {
  width: 88px;
  transition: width 0.25s ease;
  position: relative;
}

#backend-sidebar.backend-sidebar-toggle.expanded {
  width: 220px;
  align-items: flex-start;
}

#backend-sidebar.backend-sidebar-toggle .sidebar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  transition: all 0.2s ease;
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

#backend-sidebar.backend-sidebar-toggle.compact .sidebar-link {
  width: 44px !important;
  height: 44px !important;
  margin: 0 auto;
  gap: 0 !important;
  padding: 0 !important;
}

#backend-sidebar.backend-sidebar-toggle .sidebar-link i {
  display: block !important;
  line-height: 1 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  text-align: center;
  width: 1em;
  height: 1em;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

#backend-sidebar.backend-sidebar-toggle .sidebar-link i::before {
  display: block;
  line-height: 1;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#backend-sidebar.backend-sidebar-toggle.compact .sidebar-link i {
  font-size: 1.125rem;
}

#backend-sidebar.backend-sidebar-toggle .sidebar-label {
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.25s ease, max-width 0.25s ease;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
}

#backend-sidebar.backend-sidebar-toggle.expanded .sidebar-link {
  width: calc(100% - 1.5rem);
  justify-content: flex-start;
  padding: 0 0.75rem;
  margin-left: 0.75rem;
  margin-right: 0.75rem;
  height: 44px;
  gap: 12px;
}

#backend-sidebar.backend-sidebar-toggle.expanded .sidebar-link i {
  flex-shrink: 0;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  margin: 0 !important;
}

#backend-sidebar.backend-sidebar-toggle.expanded .sidebar-label {
  opacity: 1;
  max-width: 150px;
}

#backend-sidebar.backend-sidebar-toggle .toggle-btn {
  cursor: pointer;
  border: none;
  background: var(--sidebar-active);
  transition: all 0.25s ease;
}

#backend-sidebar.backend-sidebar-toggle .toggle-btn:hover {
  background: #1875a0;
  transform: scale(1.05);
}

#backend-sidebar.backend-sidebar-toggle .toggle-btn i {
  transition: transform 0.25s ease;
}

#backend-sidebar.backend-sidebar-toggle.expanded .toggle-btn {
  width: calc(100% - 1.5rem);
  margin-left: 0.75rem;
  margin-right: 0.75rem;
}

#backend-sidebar.backend-sidebar-toggle.expanded .toggle-btn i {
  transform: rotate(180deg);
}

@media (max-width: 992px) {
  .backend-layout {
    flex-direction: column;
  }

  .backend-sidebar {
    flex-direction: row;
    width: 100%;
    height: 72px;
    justify-content: center;
  }

  .backend-sidebar .logo {
    margin-bottom: 0;
  }

  #backend-sidebar.backend-sidebar-toggle.expanded {
    width: 100%;
  }
}
