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

/* :root {
  --bg: #081120;
  --card: #101b2f;
  --primary: #6366f1;
  --primary2: #8b5cf6;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f8fafc;
} */

:root {
  /* BASE */

  --bg: #081120;
  --card: #101b2f;

  --text: #f8fafc;
  --muted: #94a3b8;

  /* BRAND */

  --primary: #6366f1;
  --primary2: #8b5cf6;

  /* STATUS */

  --success: #10b981;
  --success-light: #34d399;

  --danger: #ef4444;
  --danger-light: #fb7185;

  --warning-bg: #fef3c7;
  --warning-text: #92400e;

  /* ACTIONS */

  --blue: #3b82f6;

  /* BORDERS */

  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.06);

  /* SURFACES */

  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-active: rgba(255, 255, 255, 0.08);

  /* MODAL */

  --modal-bg: #0f172a;
  --input-bg: #172033;

  /* OVERLAY */

  --overlay: rgba(0, 0, 0, 0.55);

  /* SHADOW */

  --shadow: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --card: #ffffff;

  --text: #0f172a;
  --muted: #64748b;

  --border: rgba(15, 23, 42, 0.08);
  --border-light: rgba(15, 23, 42, 0.05);

  --surface: rgba(15, 23, 42, 0.03);
  --surface-hover: rgba(15, 23, 42, 0.05);
  --surface-active: rgba(15, 23, 42, 0.08);

  --modal-bg: #ffffff;
  --input-bg: #f8fafc;

  --overlay: rgba(0, 0, 0, 0.35);
}

body {
  font-family: "Inter", sans-serif;
  background:
    radial-gradient(
      circle at top left,
      rgba(99, 102, 241, 0.18),
      transparent 30%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(14, 165, 233, 0.12),
      transparent 30%
    ),
    var(--bg);

  color: var(--text);
  min-height: 100vh;
  padding: 24px;
}

.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

.status {
  font-weight: 600;
}

.status--active {
  color: #22c55e;
}

.status--inactive {
  color: var(--danger);
}

/* LOGIN */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--modal-bg), #111827);
}

.login__card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.login__card h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  color: white;
}

.login__card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login__card input {
  height: 54px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  padding: 0 1rem;
  color: white;
  font-size: 1rem;
}

.login__card input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.login__card input:focus {
  outline: none;
  border-color: var(--blue);
}

.login__card button {
  height: 54px;
  border-radius: 14px;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.login__error {
  color: #f87171;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
  margin-top: 8px;
}

/* SIDEBAR */

.sidebar {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px;
  backdrop-filter: blur(12px);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.sidebar__logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.sidebar__logo p,
.sidebar__section-title,
.header__content p,
.panel__description {
  color: var(--muted);
}

.sidebar__section-title {
  font-size: 13px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.sidebar__menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.sidebar__button {
  border: none;
  background: rgba(255, 255, 255, 0.04);
  color: white;
  padding: 15px;
  border-radius: 16px;
  text-align: left;
  cursor: pointer;
  transition: 0.25s;
}

.sidebar__button--active {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
}

.sidebar__button--add {
  background: rgba(16, 185, 129, 0.15);
  border: 1px dashed rgba(16, 185, 129, 0.35);
}

.sidebar__organization {
  margin: 16px 0;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.sidebar__organization div {
  opacity: 0.9;
}
/* MAIN */

.main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* HEADER */

.header,
.calendar__top,
.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.header__actions,
.calendar__views,
.calendar__actions,
.filter,
.admin__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* BUTTON */

button {
  cursor: pointer;
}

.button {
  border: none;
  padding: 12px 18px;
  border-radius: 16px;
  color: white;
}

.button--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
}

.button--dark {
  background: rgba(255, 255, 255, 0.06);

  border: 1px solid var(--border);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button:hover,
.admin-slot__button:hover,
.admin__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.button:active,
.admin-slot__button:active,
.admin__button:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* CARD */

.calendar,
.panel {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px;
  backdrop-filter: blur(12px);
}

.calendar__empty {
  min-height: 80px;
}

/* FILTER */

.filter__button {
  border: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: white;
  padding: 12px 18px;
  border-radius: 16px;
  cursor: pointer;
}

.filter__button--active {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
}

/* INFO */

.info {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.info__card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 16px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info__card span {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.info__card strong {
  font-size: 15px;
  line-height: 1.4;
}

/* CALENDAR */

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.calendar__weekday {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.calendar__day {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  min-height: 92px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.25s;
}

.calendar__day:hover {
  transform: translateY(-2px);
}

.calendar__day--active {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
}

.calendar__day-date {
  font-size: 22px;
  font-weight: 700;
}

.calendar__day-badge {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}

/* CONTENT */
.app--admin .content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.app--user .content {
  display: grid;
  grid-template-columns: 1fr;
}

.panel__description {
  margin-top: 10px;
  line-height: 1.7;
  max-width: 720px;
}

/* SLOTS */

#slotsContainer {
  display: flex;
  flex-direction: column;
  gap: 34px;
  margin-top: 24px;
}

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.slot {
  border: none;
  border-radius: 22px;
  padding: 20px;
  min-height: 120px;
  color: white;
  text-align: left;
  position: relative;
}

.slot--free {
  background: linear-gradient(135deg, var(--success), var(--success-light));
}

.slot--booked {
  background: linear-gradient(135deg, var(--danger), var(--danger-light));
}

.slot--disabled {
  background: #1e293b;
}

.slot__duration {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: rgba(255, 255, 255, 0.14);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
}

/* ADMIN */

.admin {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin__card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 22px;
  padding: 20px;
}

.admin__card p {
  color: var(--muted);
  margin: 12px 0 16px;
  line-height: 1.6;
}

.admin__button {
  border: none;
  padding: 12px 16px;
  border-radius: 14px;
  color: white;
}

.admin__button--green {
  background: var(--success);
}

.admin__button--red {
  background: var(--danger);
}

.admin__button--blue {
  background: var(--blue);
}

/* NAV */

.calendar__nav {
  display: flex;
  gap: 10px;
}

.calendar__nav button {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

/* MODAL */

/* =========================
   MODAL
========================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal__content {
  width: 100%;
  max-width: 760px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--modal-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 24px;
}

.modal__content::-webkit-scrollbar {
  width: 8px;
}

.modal__content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);

  border-radius: 999px;
}

.modal__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal__close {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  cursor: pointer;
  font-size: 18px;
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* INPUTS */

.modal__form input,
.modal__form textarea,
.modal__form select {
  width: 100%;
  border: none;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  padding: 16px;
  border-radius: 16px;
  font-family: inherit;
}

.modal__form textarea {
  resize: none;
  min-height: 120px;
}

.modal__form option {
  background: var(--input-bg);
  color: white;
}

.modal__text {
  color: var(--muted);
  margin: 20px 0;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}

.button--danger {
  background: var(--danger);
}

/* LABEL */

.modal__form label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted);
}

/* ROWS */

.modal__triple-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.modal__time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.modal__content--small {
  max-width: 600px;
}

.delete-departments {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delete-department {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.delete-department__name {
  font-size: 15px;
  font-weight: 500;
}

.delete-department__button {
  border: none;
  background: var(--danger);
  color: white;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* WORKDAYS */

.workdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.workdays::-webkit-scrollbar {
  height: 6px;
}

.workdays::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.workday {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
}

.workday:hover {
  background: rgba(255, 255, 255, 0.08);
}

.workday input {
  accent-color: #6366f1;
}

/* ACTIVE DAY HEADER */

.slots-day {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.slots-day__header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.slots-day__header h3 {
  font-size: 22px;
  margin: 0;
}

.slots-day__badge {
  background: var(--success);
  color: white;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
}

.slot--booked {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.admin-slots {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  padding: 20px;
}

.admin-slots__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
  max-height: 720px;
  overflow-y: auto;
}

.admin-slot {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-slot__title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.admin-slot__info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.admin-slot__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.admin-slot__button {
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  color: white;
  font-weight: 600;
}

.admin-slot__button--edit {
  background: #6366f1;
}

.admin-slot__button--delete {
  background: var(--danger);
}

.booking-user {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.booking-user__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #6366f1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 22px;
  font-weight: 700;
}

.booking-user h3 {
  color: white;
  margin-bottom: 4px;
}

.booking-user span {
  color: var(--muted);
  font-size: 14px;
}

.booking-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.booking-detail-card {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.booking-detail-card strong {
  display: block;
  margin-bottom: 10px;
  color: white;
  font-size: 14px;
}

.booking-detail-card p {
  color: var(--muted);
  line-height: 1.5;
}

.booking-detail-card--full {
  grid-column: 1/-1;
}

.booking__success {
  color: var(--success-light);
  font-size: 14px;
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
}

/* ORGANIZATION */

#organizationsList,
#usersList {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.organization-card--active {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}

.modal__button--cancel {
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
}

.modal__button--cancel:hover {
  background: #f5f5f5;
}

.modal__button--delete {
  background: #dc2626;
  color: white;
}

.modal__button--delete:hover {
  opacity: 0.9;
}

/* RESPONSIVE */

@media (max-width: 1200px) {
  .app,
  .content {
    grid-template-columns: 1fr;
  }

  .info {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 700px) {
  body {
    padding: 16px;
  }

  .calendar__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .info {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal__triple-row,
  .modal__time-row {
    grid-template-columns: 1fr;
  }
  .workdays {
    grid-template-columns: repeat(4, 1fr);
  }

  .slots {
    grid-template-columns: 1fr;
  }
}
