/* ======================================================
   IMPERIAL CHAMBERS APP LAYOUT
   File: public/assets/css/layouts/app.css
   Premium Upgrade • Staff Friendly • Minimal Luxury UI
   ====================================================== */

/* ======================================================
   BODY
   ====================================================== */
.app-body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #f8f8f8 0%, #f2f2f2 100%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  min-height: 100vh;
  position: relative;
}

/* ======================================================
   PAGE GRID
   ====================================================== */
.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

/* ======================================================
   SIDEBAR
   ====================================================== */
.page-sidebar {
  position: relative;
  z-index: 20;

  display: flex;
  flex-direction: column;
  gap: 1rem;

  padding: 1.1rem;

  background: linear-gradient(180deg, #0b0b0b 0%, #171717 100%);
  color: #fff;

  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 10px 0 28px rgba(0, 0, 0, 0.12);
}

/* ======================================================
   BRAND
   ====================================================== */
.page-brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;

  padding-bottom: 1rem;
  margin-bottom: 0.35rem;

  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.page-brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;

  display: grid;
  place-items: center;

  font-weight: 900;
  color: #fff;

  background: linear-gradient(
    135deg,
    var(--color-gold-500),
    var(--color-gold-700)
  );

  box-shadow: 0 12px 20px rgba(198, 147, 32, 0.22);
}

.page-brand-text {
  display: grid;
  gap: 0.1rem;
}

.page-brand-title {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
}

.page-brand-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.03em;
}

/* ======================================================
   SIDEBAR NAV
   ====================================================== */
.page-nav {
  display: grid;
  gap: 0.35rem;
}

.page-nav-link {
  min-height: 46px;

  display: flex;
  align-items: center;
  gap: 0.75rem;

  padding: 0 0.9rem;

  border-radius: 14px;

  color: rgba(255, 255, 255, 0.84);
  text-decoration: none;
  font-weight: 700;

  transition: all 0.18s ease;
}

.page-nav-link i,
.page-nav-link svg {
  width: 18px;
  height: 18px;
  color: var(--color-gold-400);
}

.page-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.page-nav-link.active {
  background: linear-gradient(
    135deg,
    rgba(198, 147, 32, 0.2),
    rgba(198, 147, 32, 0.08)
  );
  color: #fff;
  border: 1px solid rgba(198, 147, 32, 0.22);
}

/* ======================================================
   MAIN
   ====================================================== */
.page-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ======================================================
   TOPBAR
   ====================================================== */
.page-topbar {
  position: sticky;
  top: 0;
  z-index: 15;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  padding: 1rem 1.25rem;

  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);

  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.page-topbar-left,
.page-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ======================================================
   TOPBAR BUTTONS
   ====================================================== */
.page-icon-btn,
.page-user-btn {
  min-height: 44px;
  min-width: 44px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;

  padding: 0 0.95rem;

  border-radius: 14px;
  border: 1px solid #ececec;
  background: #fff;

  cursor: pointer;
  font-weight: 800;

  transition: all 0.18s ease;
}

.page-icon-btn:hover,
.page-user-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.06);
}

.page-user-btn {
  min-width: auto;
}

/* ======================================================
   CONTENT
   ====================================================== */
.page-content {
  flex: 1;
  padding: 1.25rem;
}

/* ======================================================
   SECTION CARD
   ====================================================== */
.page-card {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 24px;
  padding: 1rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.04);
}

/* ======================================================
   PAGE TITLE
   ====================================================== */
.page-title {
  font-size: 1.3rem;
  font-weight: 900;
  margin: 0;
}

.page-subtitle {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ======================================================
   TOASTS
   ====================================================== */
.toast-stack {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;

  width: min(24rem, 92vw);

  display: grid;
  gap: 0.75rem;
}

.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;

  padding: 1rem;

  border-radius: 18px;
  color: #fff;

  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.14);

  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: all 0.25s ease;
}

.toast-item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-success {
  background: linear-gradient(135deg, #198754, #157347);
}

.toast-error {
  background: linear-gradient(135deg, #dc3545, #b42332);
}

.toast-warning {
  background: linear-gradient(135deg, #ffb020, #d89400);
  color: #111;
}

.toast-info {
  background: linear-gradient(135deg, #111, #2a2a2a);
}

.toast-message {
  flex: 1;
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.45;
}

.toast-close {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

/* ======================================================
   TABLET
   ====================================================== */
@media (max-width: 992px) {
  .page-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .page-sidebar {
    padding: 0.9rem 0.65rem;
  }

  .page-brand-text,
  .page-nav-link span {
    display: none;
  }

  .page-nav-link {
    justify-content: center;
    padding: 0;
  }
}

/* ======================================================
   MOBILE
   ====================================================== */
@media (max-width: 768px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .page-sidebar {
    display: none;
  }

  .page-topbar,
  .page-content {
    padding: 1rem;
  }

  .page-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .page-topbar-left,
  .page-topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .page-user-btn,
  .page-icon-btn {
    flex: 1;
  }

  .toast-stack {
    left: 1rem;
    right: 1rem;
    width: auto;
  }
}

/* ======================================================
   SMALL MOBILE
   ====================================================== */
@media (max-width: 480px) {
  .page-content,
  .page-topbar {
    padding: 0.85rem;
  }

  .page-card {
    padding: 0.9rem;
    border-radius: 20px;
  }

  .page-title {
    font-size: 1.08rem;
  }

  .page-subtitle {
    font-size: 0.82rem;
  }

  .toast-item {
    padding: 0.9rem;
  }
}

/* ======================================================
   TOUCH DEVICES
   ====================================================== */
@media (hover: none) {
  .page-icon-btn:hover,
  .page-user-btn:hover,
  .page-nav-link:hover {
    transform: none;
    box-shadow: none;
  }
}
