/* ========================================
   Topbar / Navigation
   ======================================== */
.topbar {
  align-items: center;
  background: rgba(255, 252, 247, 0.88);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 clamp(16px, 6vw, 120px);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  transition: opacity var(--transition);
}
.brand:hover {
  opacity: 0.85;
}

.brand-name {
  display: grid;
  line-height: 1;
  gap: 1px;
}

.brand-name strong {
  color: var(--gold-dark);
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.brand-name em {
  color: var(--ink-secondary);
  font-size: 9.5px;
  font-style: normal;
  letter-spacing: 0.45em;
  text-transform: uppercase;
}

.brand-mark {
  align-items: center;
  background: var(--gold-gradient);
  border-radius: 10px;
  display: flex;
  height: 34px;
  justify-content: center;
  position: relative;
  width: 34px;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 2px 8px rgba(194, 143, 43, 0.3);
}
.brand:hover .brand-mark {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(194, 143, 43, 0.45);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../img/logo/logo-mark.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 58%;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ========================================
   Top Nav (menu desktop) — elegan
   ======================================== */
.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  text-decoration: none;
  position: relative;
  transition: color var(--transition), background var(--transition);
}
.top-nav a i {
  font-size: 14px;
  opacity: 0.85;
}
.top-nav a:hover {
  color: var(--gold-dark);
  background: var(--gold-glow);
}
.top-nav a.active {
  color: var(--gold-dark);
  background: var(--gold-glow);
}
.top-nav a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-gradient);
}
.top-actions .btn-icon-only {
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1;
}

/* ========================================
   Hamburger Menu (Mobile)
   ======================================== */
.hamburger {
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  display: none;
  flex-direction: column;
  gap: 5px;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
  z-index: 60;
}
.hamburger-line {
  background: var(--ink-secondary);
  border-radius: 2px;
  display: block;
  height: 2.5px;
  transition: all 260ms var(--ease-out);
  width: 22px;
}
.hamburger.open .hamburger-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger.open .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open .hamburger-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ========================================
   Sidebar Drawer (Mobile)
   ======================================== */
.sidebar-overlay {
  background: rgba(0, 0, 0, 0.4);
  display: none;
  height: 100%;
  left: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 70;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.open {
  display: block;
}

.sidebar {
  background: var(--paper);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 320px;
  position: fixed;
  right: -100%;
  top: 0;
  transition: right 320ms var(--ease-out);
  width: 80vw;
  z-index: 80;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}
.sidebar.open {
  right: 0;
}

.sidebar-header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  padding: 20px 20px 16px;
}
.sidebar-header .brand-mark {
  flex-shrink: 0;
}
.sidebar-title {
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  flex: 1;
}
.sidebar-close {
  align-items: center;
  background: none;
  border: none;
  color: var(--ink-secondary);
  cursor: pointer;
  display: flex;
  font-size: 28px;
  height: 44px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 44px;
}
.sidebar-close:hover {
  color: var(--ink);
}

.sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  overflow-y: auto;
  flex: 1;
}
.sidebar-link {
  align-items: center;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 15px;
  font-weight: 500;
  gap: 12px;
  padding: 14px 20px;
  text-align: left;
  text-decoration: none;
  transition: background 180ms var(--ease-out);
  width: 100%;
}
.sidebar-link i {
  color: var(--gold-dark);
  font-size: 16px;
  width: 20px;
  text-align: center;
}
.sidebar-link:hover {
  background: rgba(194, 143, 43, 0.06);
}
.sidebar-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 8px 20px;
}

[data-theme="dark"] .sidebar { background: #1e1a16; border-left-color: var(--line); }
[data-theme="dark"] .sidebar-close { color: #8a7e72; }
[data-theme="dark"] .sidebar-link:hover { background: rgba(212, 164, 58, 0.06); }
[data-theme="dark"] .sidebar-overlay { background: rgba(0, 0, 0, 0.6); }

/* ========================================
   Buttons
   ======================================== */
.primary-button,
.outline-button,
.ghost-button,
.danger-button,
.success-button,
.text-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  font-size: 14px;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  transition: transform 180ms var(--ease-out),
              box-shadow 180ms var(--ease-out),
              background 180ms var(--ease-out),
              border-color 180ms var(--ease-out),
              color 180ms var(--ease-out);
  white-space: nowrap;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.primary-button {
  background: var(--gold-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(194, 143, 43, 0.3);
}
.primary-button:hover {
  box-shadow: 0 6px 24px rgba(194, 143, 43, 0.4);
  transform: translateY(-1.5px);
}
.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(194, 143, 43, 0.3);
}

.outline-button {
  background: var(--paper);
  border-color: var(--brown);
  color: var(--brown);
}
.outline-button:hover {
  background: #f8f2ea;
  border-color: var(--gold-dark);
  color: var(--gold-dark);
}

.ghost-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-secondary);
}
.ghost-button:hover {
  background: rgba(107, 68, 38, 0.06);
  border-color: var(--muted);
}

.danger-button {
  background: var(--red-soft);
  border-color: #e8b4b2;
  color: var(--red);
}
.danger-button:hover {
  background: #fadcd9;
  border-color: var(--red);
  box-shadow: 0 4px 16px rgba(201, 59, 55, 0.15);
}

.success-button {
  background: var(--green-soft);
  border-color: #a4dbaa;
  color: #2a7a35;
}
.success-button:hover {
  background: #cfeecf;
  border-color: var(--green);
  box-shadow: 0 4px 16px rgba(59, 163, 74, 0.18);
}

.text-button {
  background: transparent;
  border: none;
  color: var(--gold-dark);
  font-weight: 700;
  min-height: auto;
  padding: 4px 8px;
  position: relative;
}
.text-button::after {
  background: var(--gold);
  bottom: 2px;
  content: "";
  height: 2px;
  left: 8px;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
  width: calc(100% - 16px);
}
.text-button:hover::after {
  transform: scaleX(1);
}

/* --- Premium Detail Action Buttons --- */
.btn-toggle {
  align-items: center;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  font-size: 14px;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  transition: all 220ms var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn-toggle .btn-icon {
  align-items: center;
  border-radius: 6px;
  display: flex;
  font-size: 13px;
  height: 24px;
  justify-content: center;
  width: 24px;
  transition: all 220ms var(--ease-out);
}
.btn-toggle.green {
  background: linear-gradient(135deg, #3ba34a 0%, #2d8a3a 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 163, 74, 0.35);
}
.btn-toggle.green .btn-icon {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.btn-toggle.green:hover {
  box-shadow: 0 6px 24px rgba(59, 163, 74, 0.45);
  transform: translateY(-1.5px);
}
.btn-toggle.green:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(59, 163, 74, 0.35);
}
.btn-toggle.red {
  background: linear-gradient(135deg, #c93b37 0%, #b02e2a 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(201, 59, 55, 0.3);
}
.btn-toggle.red .btn-icon {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.btn-toggle.red:hover {
  box-shadow: 0 6px 24px rgba(201, 59, 55, 0.4);
  transform: translateY(-1.5px);
}
.btn-toggle.red:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(201, 59, 55, 0.3);
}

.btn-icon-only {
  align-items: center;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  transition: all 220ms var(--ease-out);
  width: 44px;
  position: relative;
}
.btn-icon-only .btn-icon {
  font-size: 18px;
  line-height: 1;
  transition: transform 220ms var(--ease-out);
}
.btn-icon-only:hover {
  border-color: var(--gold);
  background: rgba(194, 143, 43, 0.05);
  box-shadow: 0 4px 16px rgba(194, 143, 43, 0.15);
  transform: translateY(-1px);
}
.btn-icon-only:hover .btn-icon {
  transform: scale(1.1);
}
.btn-icon-only:active {
  transform: scale(0.92) !important;
}
.btn-icon-only.danger:hover {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 4px 16px rgba(201, 59, 55, 0.15);
}
.btn-icon-only.danger:hover .btn-icon {
  color: var(--red);
}
.btn-icon-only.wa:hover {
  border-color: #25D366;
  background: rgba(37, 211, 102, 0.06);
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.18);
}
.btn-icon-only.wa:hover .btn-icon {
  color: #25D366;
}

/* Tooltip on hover for icon-only buttons */
.detail-actions {
  position: relative;
  z-index: 5;
}
.btn-icon-only::after {
  background: var(--ink);
  border-radius: 6px;
  color: white;
  content: attr(title);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  padding: 6px 10px;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 8px);
  transform: translateY(-4px);
  transition: all 180ms var(--ease-out);
  white-space: nowrap;
  z-index: 100;
}
.btn-icon-only:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   App Shell
   ======================================== */
.app-shell {
  margin: 0 auto;
  max-width: 1440px;
  padding: 56px clamp(16px, 6vw, 120px) 80px;
  animation: fadeSlideUp 450ms var(--ease-out) both;
}

.page-enter {
  animation: fadeSlideUp 400ms var(--ease-out) both;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

