:root {
  color-scheme: dark;

  /* Apple Design System Foundations */
  --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", system-ui, -apple-system-headline, sans-serif;
  --apple-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Apple Dark Materials & Depth */
  --bg-dark: #000000;
  --bg-surface: rgba(22, 22, 28, 0.82);
  --bg-card: rgba(28, 28, 34, 0.72);
  --bg-card-hover: rgba(38, 38, 46, 0.82);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(10, 132, 255, 0.3);
  --card-highlight-top: rgba(255, 255, 255, 0.16);
  
  /* Apple System Vibrant Colors */
  --primary: #0a84ff; /* Apple System Blue */
  --primary-glow: rgba(10, 132, 255, 0.28);
  --accent: #30d158; /* Apple System Green */
  --accent-glow: rgba(48, 209, 88, 0.25);
  --purple: #bf5af2; /* Apple System Purple */
  --purple-glow: rgba(191, 90, 242, 0.25);
  
  --text-main: #ffffff;
  --text-muted: rgba(235, 235, 245, 0.65);
  --text-dim: rgba(235, 235, 245, 0.38);
  --danger: #ff453a; /* Apple System Red */
  --warning: #ff9f0a; /* Apple System Orange */

  --sidebar-width: 270px;
  --topbar-height: 64px;
}

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

html {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color-scheme: dark;
  font-family: var(--apple-font);
  background-color: var(--bg-dark);
  color: var(--text-main);
  display: block;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image: 
    radial-gradient(circle at 12% 8%, rgba(10, 132, 255, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(48, 209, 88, 0.05) 0%, transparent 50%);
}

/* Apple Fluid Tactile Responsiveness */
button, .btn, .nav-item, .device-card, .rule-item, .kpi-card, .schedule-card-item, .apple-action-btn, .schedule-segment-btn, .device-add-btn {
  -webkit-tap-highlight-color: transparent;
}

button:active, .btn:active, .nav-item:active, .device-card:active, .rule-item:active, .apple-action-btn:active, .schedule-segment-btn:active, .device-add-btn:active {
  transform: scale(0.975);
  transition: transform 80ms cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Master Layout */
.app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
  position: relative;
  box-sizing: border-box;
}

/* Sidebar Styling */
/* Sidebar Styling */
.app-sidebar {
  width: var(--sidebar-width);
  background: rgba(18, 18, 22, 0.85);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0a84ff, #0056b3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.sidebar-brand-icon svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.sidebar-brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sidebar-brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(10, 132, 255, 0.15);
  color: #60a5fa;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  border: 1px solid rgba(10, 132, 255, 0.3);
}

/* Sidebar Active Device Card */
.sidebar-device-box {
  margin: 0.85rem 1.15rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-color);
  border-top: 1px solid var(--card-highlight-top);
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-device-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.sidebar-device-name {
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Sidebar Navigation Items */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 0.6rem 0.35rem 0.6rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(6, 182, 212, 0.12));
  color: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-item.active .nav-icon svg {
  stroke: var(--primary);
}

.nav-badge {
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', monospace;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-weight: 700;
}

.nav-item.active .nav-badge {
  background: var(--primary);
  color: #042f1a;
}

/* Sidebar Bottom: User Card */
.sidebar-footer {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--border-color);
  background: rgba(11, 17, 32, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  width: calc(100% - var(--sidebar-width));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
}

/* Topbar Navigation */
.app-topbar {
  height: var(--topbar-height);
  background: rgba(18, 18, 22, 0.82);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border-bottom: 1px solid var(--border-color);
  padding: 0 clamp(1.25rem, 2vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.topbar-breadcrumb strong {
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* System Health Badges */
.badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.badge-green {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.08);
}

.badge-blue {
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.3);
  background: rgba(6, 182, 212, 0.08);
}

.badge-purple {
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.08);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

/* App Main Workspace - 100% Full Screen Width on PC */
.app-content {
  flex: 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
  padding: 1.5rem clamp(1.25rem, 2vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Metric KPI Cockpit Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

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

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid var(--border-color);
  border-top: 1px solid var(--card-highlight-top);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.kpi-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.kpi-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.kpi-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

/* View Panels Switching */
.view-panel {
  display: none;
  flex-direction: column;
  gap: 1.25rem;
}

.view-panel.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

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

/* Operational Content Grid */
.content-grid {
  display: grid;
  grid-template-columns: minmax(350px, 400px) 1fr;
  gap: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

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

.card {
  background: var(--bg-card);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid var(--border-color);
  border-top: 1px solid var(--card-highlight-top);
  border-radius: 18px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.015em;
}

/* =======================================================
   APPLE DESIGN: MULTI-DEVICE STRIP CAROUSEL (Capture 1 Fix)
   ======================================================= */
.devices-strip-card {
  padding: 1.2rem 1.4rem;
  background: rgba(24, 24, 30, 0.72);
}

.devices-strip-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.devices-strip-badge {
  font-size: 0.65rem;
  font-weight: 800;
  color: #0a84ff;
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.3);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
  letter-spacing: 0.06em;
}

.devices-strip-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.devices-strip-hint {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.devices-list {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 0.85rem 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.devices-list::-webkit-scrollbar {
  height: 6px;
}

.devices-list::-webkit-scrollbar-track {
  background: transparent;
}

.devices-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
}

.device-card {
  min-width: 250px;
  max-width: 280px;
  flex-shrink: 0;
  background: rgba(30, 30, 38, 0.75);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  position: relative;
  user-select: none;
}

.device-card:hover {
  transform: translateY(-2px);
  background: rgba(40, 40, 50, 0.85);
  border-color: rgba(255, 255, 255, 0.15);
  border-top-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.device-card.active {
  border-color: #0a84ff;
  border-top-color: #38a0ff;
  background: rgba(20, 35, 55, 0.88);
  box-shadow: 0 0 0 1px #0a84ff, 0 12px 36px rgba(10, 132, 255, 0.28);
}

.device-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.device-id-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--apple-mono);
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.2rem 0.55rem;
}

.device-phone-svg {
  color: #0a84ff;
  flex-shrink: 0;
}

.device-status {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.2rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-online {
  background: rgba(48, 209, 88, 0.15);
  color: #30d158;
  border: 1px solid rgba(48, 209, 88, 0.35);
}

.status-qr {
  background: rgba(255, 159, 10, 0.15);
  color: #ff9f0a;
  border: 1px solid rgba(255, 159, 10, 0.35);
}

.status-offline {
  background: rgba(255, 69, 58, 0.15);
  color: #ff453a;
  border: 1px solid rgba(255, 69, 58, 0.35);
}

.status-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: applePulse 2s infinite ease-in-out;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

@keyframes applePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.device-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.device-name-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-phone-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--apple-mono);
}

.device-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.55rem;
  margin-top: 0.2rem;
}

.device-owner-badge {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.15rem 0.45rem;
}

.device-selected-chip {
  font-size: 0.72rem;
  font-weight: 700;
  color: #0a84ff;
  background: rgba(10, 132, 255, 0.15);
  border: 1px solid rgba(10, 132, 255, 0.35);
  border-radius: 9999px;
  padding: 0.15rem 0.55rem;
}

.device-select-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.device-empty-state {
  padding: 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Apple Add WhatsApp Button */
.device-add-btn {
  min-width: 210px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.device-add-btn:hover {
  border-color: #0a84ff;
  background: rgba(10, 132, 255, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.15);
}

.device-add-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(235, 235, 245, 0.8);
  transition: all 0.25s;
}

.device-add-btn:hover .device-add-icon-circle {
  background: #0a84ff;
  color: #ffffff;
  border-color: #0a84ff;
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.4);
}

.device-add-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.device-add-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* =======================================================
   APPLE DESIGN: INSET BOT RULES CARDS (Capture 2 Fix)
   ======================================================= */
.rules-section-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.rules-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.rules-header-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.rules-title-icon {
  font-size: 1.1rem;
}

.rules-count-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 0.2rem 0.65rem;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.rule-item {
  background: rgba(28, 28, 34, 0.72);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 1.15rem 1.35rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.rule-item:hover {
  background: rgba(36, 36, 44, 0.82);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.rule-item.inactive-rule {
  opacity: 0.65;
}

.rule-item.inactive-rule:hover {
  opacity: 0.9;
}

.rule-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.rule-identity-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rule-keyword-badge {
  font-family: var(--apple-font);
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(10, 132, 255, 0.18);
  border: 1px solid rgba(10, 132, 255, 0.4);
  border-radius: 8px;
  padding: 0.25rem 0.7rem;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 8px rgba(10, 132, 255, 0.15);
}

.rule-match-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.rule-type-pill {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.pill-text {
  background: rgba(191, 90, 242, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(191, 90, 242, 0.3);
}

.pill-image {
  background: rgba(48, 209, 88, 0.15);
  color: #86efac;
  border: 1px solid rgba(48, 209, 88, 0.3);
}

.pill-video {
  background: rgba(255, 159, 10, 0.15);
  color: #fde68a;
  border: 1px solid rgba(255, 159, 10, 0.3);
}

.pill-doc {
  background: rgba(10, 132, 255, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(10, 132, 255, 0.3);
}

.rule-controls-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Apple iOS Native Switch */
.apple-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
}

.apple-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.apple-switch-slider {
  position: relative;
  width: 42px;
  height: 24px;
  background-color: rgba(255, 255, 255, 0.16);
  border-radius: 9999px;
  transition: background-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.apple-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-switch input:checked + .apple-switch-slider {
  background-color: #30d158;
  border-color: #30d158;
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.35);
}

.apple-switch input:checked + .apple-switch-slider:before {
  transform: translateX(18px);
}

.apple-switch-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Apple Inset Action Buttons */
.rule-actions-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.apple-action-btn {
  border: none;
  border-radius: 8px;
  padding: 0.32rem 0.65rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-action-btn:active {
  transform: scale(0.96);
}

.apple-action-btn.edit {
  background: rgba(10, 132, 255, 0.12);
  color: #60a5fa;
  border: 1px solid rgba(10, 132, 255, 0.3);
}

.apple-action-btn.edit:hover {
  background: #0a84ff;
  color: #ffffff;
  border-color: #0a84ff;
  box-shadow: 0 4px 12px rgba(10, 132, 255, 0.35);
}

.apple-action-btn.delete {
  background: rgba(255, 69, 58, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(255, 69, 58, 0.3);
}

.apple-action-btn.delete:hover {
  background: #ff453a;
  color: #ffffff;
  border-color: #ff453a;
  box-shadow: 0 4px 12px rgba(255, 69, 58, 0.35);
}

/* Apple Inset Response Box */
.rule-response-box {
  background: rgba(10, 10, 14, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.85rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rule-response-text {
  font-size: 0.86rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
  word-break: break-word;
}

.var-tag {
  display: inline-block;
  font-family: var(--apple-mono);
  font-size: 0.76rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  margin: 0 0.15rem;
}

.rule-media-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: #0a84ff;
  background: rgba(10, 132, 255, 0.08);
  border: 1px solid rgba(10, 132, 255, 0.22);
  border-radius: 6px;
  padding: 0.25rem 0.55rem;
  width: fit-content;
}

.rule-media-link {
  color: #60a5fa;
  text-decoration: underline;
  max-width: 380px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rule-empty-state {
  padding: 2rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Status Pills */
.status-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-disconnected {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-connected {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-qr {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Form Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-control {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.72rem 1rem;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

.input-control:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

textarea.input-control {
  resize: vertical;
  min-height: 85px;
}

/* ========================================================
   UNIVERSAL DARK STYLING FOR SELECT & DROPDOWN OPTIONS
   (Fix for white box / invisible text on Chromium & Windows)
   ======================================================== */
select.input-control,
select {
  color-scheme: dark !important;
  background-color: #16161e;
  color: #ffffff !important;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 14px;
  padding-right: 2.5rem !important;
  cursor: pointer;
}

select option,
select optgroup,
.input-control option,
.input-control optgroup {
  background-color: #1a1a24 !important;
  color: #ffffff !important;
  font-size: 0.9rem !important;
  padding: 0.65rem 1rem !important;
}

select option:checked,
select option:hover,
.input-control option:checked,
.input-control option:hover {
  background-color: #0a84ff !important;
  color: #ffffff !important;
}

/* Date, Time & Calendar inputs (Dark Mode) */
input[type="date"],
input[type="time"],
input[type="datetime-local"] {
  color-scheme: dark !important;
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff !important;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(0.85);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Chrome Autofill in Dark Theme */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: #ffffff !important;
  -webkit-box-shadow: 0 0 0px 1000px #1a1a24 inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

/* Apple Buttons */
.btn {
  background: #0a84ff;
  color: #ffffff;
  border: none;
  padding: 0.72rem 1.35rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35);
}

.btn:hover {
  background: #0071e3;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(10, 132, 255, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: #ff453a;
  box-shadow: 0 4px 14px rgba(255, 69, 58, 0.3);
}

.btn-danger:hover {
  background: #e0382e;
}

.btn-purple {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.3);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: 8px;
}

/* QR Container */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  background: rgba(10, 14, 23, 0.5);
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.qr-image {
  width: 175px;
  height: 175px;
  border-radius: 10px;
  background: white;
  padding: 6px;
  display: none;
}

/* Live Terminal Log */
.logs-box {
  background: rgba(10, 14, 23, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  color: #93c5fd;
  height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.log-item {
  display: flex;
  gap: 0.5rem;
  line-height: 1.4;
}

.log-time {
  color: var(--text-muted);
}

.log-bot {
  color: #a7f3d0;
  font-weight: 600;
}

/* Dropzone & Media Previews */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 1.75rem 1rem;
  text-align: center;
  background: rgba(10, 14, 23, 0.45);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.drop-zone:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.04);
}

.media-preview-box {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}

.media-preview-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.media-preview-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.media-preview-name {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
}

.media-preview-size {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-clear-media {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.35rem;
}

/* Scheduler Styles */
.schedule-segmented-nav {
  display: flex;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.35rem;
  gap: 0.35rem;
}

.schedule-segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.schedule-segment-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.schedule-segment-btn.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.quick-time-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.quick-time-pill:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.schedule-card-item {
  background: rgba(10, 14, 23, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.schedule-card-item:hover {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.schedule-card-item.status-border-pending {
  border-left: 4px solid var(--accent);
}

.schedule-card-item.status-border-completed {
  border-left: 4px solid var(--primary);
}

.schedule-card-item.status-border-failed {
  border-left: 4px solid var(--danger);
}

.schedule-card-item.status-border-cancelled {
  border-left: 4px solid var(--text-muted);
}

.countdown-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(6, 182, 212, 0.12);
  color: #67e8f9;
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  animation: pulse-countdown 2.5s infinite;
}

@keyframes pulse-countdown {
  0%, 100% { box-shadow: 0 0 0 rgba(6, 182, 212, 0); }
  50% { box-shadow: 0 0 10px rgba(6, 182, 212, 0.3); }
}

.schedule-filter-tab {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.schedule-filter-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.schedule-filter-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal-box {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: rgba(10, 14, 23, 0.5);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ========================================================
   RESPONSIVE DESIGN BREAKDOWN (HP / TABLET / MOBILE)
   ======================================================== */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 58;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-backdrop.active {
  display: block;
  opacity: 1;
}

@media (max-width: 900px) {
  .app-sidebar {
    width: min(300px, 82vw) !important;
    transform: translateX(-100%);
    box-shadow: none;
    z-index: 1000 !important;
  }
  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 15px 0 50px rgba(0, 0, 0, 0.9) !important;
  }
  .sidebar-backdrop {
    z-index: 998 !important;
  }
  .app-main {
    margin-left: 0 !important;
    width: 100% !important;
  }
  .btn-sidebar-toggle {
    display: inline-flex !important;
  }
  .app-content {
    padding: 1rem 0.85rem !important;
    gap: 1.15rem !important;
  }
  .app-topbar {
    padding: 0 0.85rem !important;
    height: 56px !important;
  }
  /* Hide desktop system status pills on mobile so topbar stays super clean */
  .topbar-right .badge {
    display: none !important;
  }
  /* Hide 'Beranda /' prefix on breadcrumb on mobile */
  .topbar-breadcrumb span:first-child,
  .topbar-breadcrumb span:nth-child(2) {
    display: none !important;
  }
  .content-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  .kpi-card {
    padding: 0.95rem 1rem !important;
    border-radius: 14px !important;
  }
  .kpi-value {
    font-size: 1.25rem !important;
  }

  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1.2fr 0.8fr"],
  .responsive-grid-2 {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .card {
    padding: 1.15rem 1rem !important;
    border-radius: 16px !important;
    gap: 1rem !important;
  }

  .card-title {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .devices-strip-card {
    padding: 1rem !important;
  }
  .devices-list {
    padding-bottom: 0.5rem !important;
  }
}

@media (max-width: 640px) {
  .topbar-user-badge {
    padding: 0.25rem 0.5rem !important;
  }
  #topbarUserName {
    display: none;
  }
  .schedule-segmented-nav {
    flex-direction: column !important;
  }
  .schedule-segment-btn {
    width: 100% !important;
    padding: 0.55rem 0.75rem !important;
  }
  .modal-box {
    width: 95% !important;
    margin: 0.5rem !important;
    border-radius: 16px !important;
  }
  .modal-body {
    padding: 1.15rem 1rem !important;
  }
  .modal-footer {
    padding: 0.85rem 1rem !important;
  }
  .input-control,
  .login-input {
    font-size: 16px !important;
  }
}

/* ==========================================
   APPLE DESIGN: LOGIN EXPERIENCE
   ========================================== */
.login-overlay {
  position: fixed;
  inset: 0;
  background-color: #000000;
  background-image: 
    radial-gradient(circle at 50% 12%, rgba(10, 132, 255, 0.15) 0%, transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(48, 209, 88, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 20% 90%, rgba(191, 90, 242, 0.06) 0%, transparent 45%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(26, 26, 32, 0.78);
  backdrop-filter: blur(40px) saturate(200%);
  -webkit-backdrop-filter: blur(40px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  padding: 2.75rem 2.25rem 2.25rem 2.25rem;
  box-shadow: 0 35px 80px -20px rgba(0, 0, 0, 0.9), 0 0 50px rgba(10, 132, 255, 0.12);
  animation: appleLoginIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appleLoginIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-logo {
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, #0a84ff 0%, #0056b3 100%);
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(10, 132, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: 1.15rem;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-logo:hover {
  transform: scale(1.04);
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.login-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.login-alert {
  margin-bottom: 1.25rem;
  background: rgba(255, 69, 58, 0.14);
  border: 1px solid rgba(255, 69, 58, 0.35);
  color: #ffb4ab;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 500;
  text-align: center;
}

.login-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.login-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.82rem 1rem;
  color: #ffffff;
  font-size: 0.92rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-input:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.login-eye-btn {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(235, 235, 245, 0.5);
  font-size: 1.05rem;
  padding: 0.25rem;
  transition: all 0.2s;
}

.login-eye-btn:hover {
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.btn-login-primary {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 12px;
  background: #0a84ff;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(10, 132, 255, 0.38);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-login-primary:hover {
  background: #0071e3;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(10, 132, 255, 0.48);
}

.btn-login-primary:active {
  transform: scale(0.975);
}

.login-footer {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
}

.login-secure-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 500;
}

.login-secure-chip svg {
  color: #30d158;
}

/* Sidebar Quota Box */
.sidebar-quota-box {
  margin: 0.25rem 0 0.85rem 0;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

/* Logout Buttons */
.btn-logout-icon {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.btn-logout-icon:hover {
  background: #ef4444;
  color: #ffffff;
  transform: scale(1.05);
}

.topbar-user-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.35rem 0.75rem;
}

/* Feature Privilege Checkbox Item */
.privilege-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.privilege-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

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


