/* =========================================================
   COFFEESHOP MODERN DESIGN SYSTEM & GLASSMORPHISM AESTHETICS
   ========================================================= */

:root {
  --primary: #c26928;
  --primary-hover: #a85419;
  --primary-light: #fef3eb;
  --primary-glow: rgba(194, 105, 40, 0.25);
  --dark-bg: #0f172a;
  --sidebar-bg: #111827;
  --card-bg: rgba(255, 255, 255, 0.92);
  --card-border: rgba(226, 232, 240, 0.8);
  --text-main: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(255, 255, 255, 0.6);
}

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

body {
  font-family: var(--font-sans);
  background: #f8fafc;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ================= Layout Structure ================= */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f8fafc;
  width: 100%;
  overflow-x: hidden;
}

/* ================= Top Horizontal Navigation Bar ================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  width: 100%;
}

.header-main-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
}

/* Brand */
.header-brand-wrap {
  flex-shrink: 0;
}

.header-brand-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #c26928);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(194, 105, 40, 0.4);
}

.header-brand-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #ffffff;
}

/* Horizontal Nav */
.header-nav {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  margin: 0 8px;
  overflow: visible;
}

.top-nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.top-nav-item {
  position: relative;
  list-style: none;
  padding: 2px 0;
}

.top-nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.top-nav-link i {
  font-size: 14px;
}

.top-nav-link .dropdown-arrow {
  font-size: 10px;
  margin-left: 1px;
  transition: transform 0.25s ease;
}

.top-nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.top-nav-item.active > .top-nav-link,
.top-nav-link.active {
  background: linear-gradient(135deg, rgba(194, 105, 40, 0.9), rgba(168, 84, 25, 0.95));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(194, 105, 40, 0.35);
}

.top-nav-item.open > .top-nav-dropdown-toggle .dropdown-arrow {
  transform: rotate(180deg);
}

/* Top Nav Dropdown Menu */
.top-nav-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 210px;
  background: rgba(24, 32, 47, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 10050;
  animation: fadeInDown 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Cầu nối tàng hình giúp giữ vùng hover khi chuột di chuyển xuống dropdown */
.top-nav-dropdown::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

.top-nav-item.open > .top-nav-dropdown {
  display: flex !important;
}

@media (min-width: 992px) {
  .top-nav-item.has-dropdown:hover > .top-nav-dropdown {
    display: flex !important;
  }
  .top-nav-item.has-dropdown:hover > .top-nav-dropdown-toggle .dropdown-arrow {
    transform: rotate(180deg);
  }
}

.top-nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.top-nav-dropdown-item i {
  font-size: 14px;
  width: 16px;
  color: #94a3b8;
  text-align: center;
  transition: color 0.2s ease;
}

.top-nav-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.top-nav-dropdown-item:hover i {
  color: var(--primary);
}

.top-nav-dropdown-item.active {
  background: linear-gradient(135deg, rgba(194, 105, 40, 0.9), rgba(168, 84, 25, 0.95));
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(194, 105, 40, 0.35);
}

.top-nav-dropdown-item.active i {
  color: #ffffff;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Header Branch Dropdown */
.branch-dropdown-wrapper {
  position: relative;
  z-index: 1002;
}

.header-branch-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  user-select: none;
  transition: all 0.2s ease;
}

.header-branch-pill.has-dropdown {
  cursor: pointer;
}

.header-branch-pill.has-dropdown:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.header-branch-pill .branch-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

.header-branch-pill i {
  color: #f59e0b;
  font-size: 13px;
}

.branch-count-badge {
  background: linear-gradient(135deg, #f59e0b, #c26928);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 2px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.branch-arrow {
  font-size: 9px;
  color: #94a3b8;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.branch-dropdown-wrapper.open .branch-arrow {
  transform: rotate(180deg);
}

.branch-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  max-width: 90vw;
  background: rgba(24, 32, 47, 0.98);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 158, 11, 0.2);
  padding: 10px;
  display: none;
  z-index: 10050;
  animation: fadeInDown 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.branch-dropdown-menu.show {
  display: block;
}

.branch-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: #94a3b8;
  padding: 6px 8px 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.branch-count-tag {
  color: #f59e0b;
  font-weight: 700;
}

.branch-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.branch-dropdown-item {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.branch-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transform: translateX(2px);
}

.branch-dropdown-item.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #ffffff;
}

.branch-dropdown-item .item-icon {
  font-size: 15px;
  color: #f59e0b;
  flex-shrink: 0;
}

.branch-dropdown-item.active .item-icon {
  color: #10b981;
}

.branch-dropdown-item .item-content {
  flex: 1;
  min-width: 0;
}

.branch-dropdown-item .item-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
}

.branch-dropdown-item .item-status {
  font-size: 10.5px;
  color: #10b981;
  font-weight: 700;
  margin-top: 1px;
}

.branch-dropdown-item .item-sub {
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97706, #78350f);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-label {
  font-size: 10px;
  color: #94a3b8;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout-header {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-logout-header:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.mobile-nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 20px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--primary);
}

/* ================= Mobile Navigation Drawer ================= */
.mobile-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-drawer-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: #111827;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.6);
  z-index: 10001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-drawer-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-drawer-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.mobile-drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mobile-branch-tag {
  font-size: 11.5px;
  color: #f59e0b;
  font-weight: 500;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.mobile-branch-tag.has-dropdown {
  cursor: pointer;
  padding: 3px 8px;
  background: rgba(245, 158, 11, 0.12);
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.25);
  transition: background 0.15s ease;
}

.mobile-branch-tag.has-dropdown:hover {
  background: rgba(245, 158, 11, 0.2);
}

.mobile-branch-arrow {
  margin-left: auto;
  font-size: 10px;
  color: #f59e0b;
  transition: transform 0.2s ease;
}

.mobile-branch-arrow.open {
  transform: rotate(180deg);
}

.mobile-branch-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 180px;
  overflow-y: auto;
}

.mobile-branch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-branch-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.mobile-branch-item.active {
  background: rgba(245, 158, 11, 0.15);
  color: #fff;
  font-weight: 600;
}

.mobile-branch-item .item-icon {
  font-size: 13px;
  color: #f59e0b;
}

.mobile-branch-item.active .item-icon {
  color: #10b981;
}

.mobile-branch-item .item-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-branch-item .active-badge {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  font-weight: 700;
}

.mobile-drawer-nav {
  flex-grow: 1;
  overflow-y: auto;
  padding: 14px 10px;
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-group {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.mobile-nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.mobile-nav-link .mobile-submenu-arrow {
  margin-left: auto;
  font-size: 11px;
  transition: transform 0.25s ease;
}

.mobile-nav-group.open > .mobile-dropdown-toggle .mobile-submenu-arrow {
  transform: rotate(180deg);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: linear-gradient(135deg, rgba(194, 105, 40, 0.9), rgba(168, 84, 25, 0.95));
  color: #fff;
  font-weight: 600;
}

.mobile-dropdown-toggle.parent-active {
  color: #fed7aa;
  background: rgba(194, 105, 40, 0.15);
}

.mobile-submenu {
  list-style: none;
  padding: 0;
  margin: 4px 0 6px 16px;
  border-left: 1.5px dashed rgba(255, 255, 255, 0.15);
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 8px;
}

.mobile-nav-group.open > .mobile-submenu {
  display: flex;
}

.mobile-sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.mobile-sublink:hover,
.mobile-sublink.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.mobile-sublink.active {
  color: #fed7aa;
  font-weight: 600;
}

.mobile-drawer-footer {
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.btn-logout-mobile {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout-mobile:hover {
  background: #ef4444;
  color: #fff;
}

/* ================= Responsive Breakpoints ================= */
@media (min-width: 992px) {
  .mobile-nav-toggle,
  .mobile-drawer,
  .mobile-drawer-backdrop {
    display: none !important;
  }
}

@media (max-width: 991px) {
  .desktop-nav {
    display: none !important;
  }

  .mobile-nav-toggle {
    display: inline-flex !important;
  }

  .header-main-bar {
    height: 54px;
    padding: 0 14px;
  }

  .user-info-text,
  .logout-label {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-branch-pill {
    display: none;
  }

  .btn-logout-header {
    display: none;
  }

  .app-content {
    padding: 14px;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= UI Components ================= */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  box-shadow: var(--shadow-lg);
}

.btn-coffee {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-coffee:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(194, 105, 40, 0.4);
  color: #fff;
}

.btn-outline-coffee {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline-coffee:hover {
  background: var(--primary);
  color: #fff;
}

/* ================= Currency Input Masking ================= */
.currency-input {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.input-currency-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-currency-wrapper input {
  padding-right: 48px;
}

.input-currency-wrapper .currency-suffix {
  position: absolute;
  right: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

/* ================= Global Loading Overlay ================= */
#globalLoadingOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#globalLoadingOverlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-coffee-cup {
  width: 68px;
  height: 68px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spinCup 0.9s linear infinite;
}

.loading-text {
  margin-top: 18px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes spinCup {
  to { transform: rotate(360deg); }
}

/* ================= Toast Notification Glassmorphism ================= */
#toastContainer {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.coffee-toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  opacity: 0;
}

.coffee-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.coffee-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.toast-success .coffee-toast-icon { background: #dcfce7; color: var(--success); }
.toast-error .coffee-toast-icon { background: #fee2e2; color: var(--danger); }
.toast-warning .coffee-toast-icon { background: #fef3c7; color: var(--warning); }
.toast-info .coffee-toast-icon { background: #e0f2fe; color: var(--info); }

.coffee-toast-message {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
  flex-grow: 1;
}

/* ================= Confirm Modal Glassmorphism ================= */
#confirmModalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#confirmModalOverlay.active {
  opacity: 1;
  visibility: visible;
}

.confirm-modal-box {
  width: 440px;
  max-width: 90vw;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

#confirmModalOverlay.active .confirm-modal-box {
  transform: scale(1);
}

.confirm-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fef3c7;
  color: var(--warning);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.confirm-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.confirm-modal-message {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ================= Text Utilities ================= */
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }

/* ================= Form Controls & Inputs ================= */
.form-group {
  margin-bottom: 16px;
}

.form-group.mb-3 {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.form-control-custom {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.form-control-custom:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3.5px var(--primary-glow);
  background: #fff;
}

.form-control-custom::placeholder {
  color: #94a3b8;
  font-size: 13.5px;
}

.form-control-custom:disabled,
.form-control-custom[readonly] {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

select.form-control-custom {
  appearance: auto;
  cursor: pointer;
}

/* ================= Searchable Select Component ================= */
.searchable-select-wrapper {
  position: relative;
  width: 100%;
  user-select: none;
}

.searchable-select-wrapper select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.searchable-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 8px 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
  text-align: left;
}

.searchable-select-trigger:hover {
  border-color: #94a3b8;
}

.searchable-select-wrapper.open .searchable-select-trigger,
.searchable-select-trigger:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

.searchable-select-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.searchable-select-placeholder {
  color: #94a3b8;
}

.searchable-select-arrow {
  margin-left: 8px;
  color: #64748b;
  font-size: 12px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.searchable-select-wrapper.open .searchable-select-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

.searchable-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  z-index: 10002;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInDown 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.searchable-select-wrapper.open .searchable-select-dropdown {
  display: flex;
}

.searchable-select-search-box {
  position: relative;
  padding: 8px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
}

.searchable-select-search-box i {
  position: absolute;
  left: 18px;
  color: #94a3b8;
  font-size: 13px;
  pointer-events: none;
}

.searchable-select-input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.searchable-select-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.searchable-select-options {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  list-style: none;
  margin: 0;
}

.searchable-select-option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.searchable-select-option:hover,
.searchable-select-option.focused {
  background: var(--primary-light);
  color: var(--primary);
}

.searchable-select-option.selected {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #ffffff;
  font-weight: 600;
}

.searchable-select-empty {
  padding: 14px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
  font-style: italic;
}

.input-icon-group .searchable-select-wrapper .searchable-select-trigger {
  padding-left: 44px;
}


/* ================= Layout & Page Containers ================= */
.system-page-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.page-action-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-main-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.page-sub-title {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ================= Filter Bar ================= */
.filter-card {
  padding: 18px 22px;
  margin-bottom: 22px;
}

.filter-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-item {
  flex: 0 0 auto;
  min-width: 180px;
}

.search-box {
  position: relative;
  flex: 1 1 260px;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 15px;
  pointer-events: none;
}

.search-box input.form-control-custom {
  padding-left: 40px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ================= Tables ================= */
.table-card {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
}

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

.coffee-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.coffee-table th {
  background: #f8fafc;
  padding: 14px 18px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.coffee-table td {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #334155;
}

.coffee-table tr:hover td {
  background: #fafaf9;
}

/* ================= Table Badges & Cell Components ================= */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-sm {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #d97706, #78350f);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.25);
}

.user-cell-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 14px;
}

.user-cell-username {
  font-size: 12px;
  color: var(--text-muted);
}

.contact-info {
  font-size: 12.5px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.contact-info i {
  color: #94a3b8;
  margin-right: 5px;
}

.badge-list {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.role-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 6px;
  letter-spacing: 0.3px;
}

.badge-admin { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.badge-manager { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-barista { background: #f3e8ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge-cashier { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.badge-default { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.branch-badge-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 3px 9px;
  color: #334155;
}

.branch-pill i {
  color: var(--primary);
  font-size: 11px;
}

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

.status-active { background: #dcfce7; color: #16a34a; border: 1px solid #bbf7d0; }
.status-locked { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }

.action-buttons-group {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.btn-action-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-action-icon:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}

.edit-btn:hover { color: #0284c7; border-color: #0284c7; background: #f0f9ff; }
.key-btn:hover { color: #d97706; border-color: #d97706; background: #fffbeb; }
.lock-btn:hover { color: #dc2626; border-color: #dc2626; background: #fef2f2; }

/* ================= Pagination ================= */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid #e2e8f0;
  background: #fafaf9;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pagination-links {
  display: flex;
  gap: 6px;
}

.page-link-pill {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: #475569;
  border: 1px solid #cbd5e1;
  background: #fff;
  transition: all 0.2s;
}

.page-link-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: var(--text-main);
}

.page-link-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* ================= Coffee Modal System ================= */
.coffee-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 16px;
  box-sizing: border-box;
}

.coffee-modal.active {
  opacity: 1;
  visibility: visible;
}

.coffee-modal-dialog {
  width: 620px;
  max-width: 95vw;
  max-height: 92vh;
  display: flex;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.coffee-modal.active .coffee-modal-dialog {
  transform: scale(1);
}

.coffee-modal-content {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
  width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.coffee-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafaf9;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title i {
  color: var(--primary);
  font-size: 19px;
}

.btn-modal-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  transition: color 0.2s;
}

.btn-modal-close:hover {
  color: #0f172a;
}

.coffee-modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(92vh - 145px);
}

.coffee-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #fafaf9;
}

.row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  max-height: 160px;
  overflow-y: auto;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}

.checkbox-label:hover {
  background: #f1f5f9;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
