@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Global Style Variables */
:root {
  --primary-color: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #06b6d4;
  --light-bg: #f1f5f9;
  --dark-text: #0f172a;
  --border-color: #e2e8f0;
  --sidebar-width: 260px;
  --header-height: 64px;
  --transition-speed: 0.25s;
  --sidebar-bg: #0f172a;
  --sidebar-text: rgba(255,255,255,0.72);
  --sidebar-text-active: #fff;
  --sidebar-accent: #6366f1;
  --card-shadow: 0 1px 3px rgba(15,23,42,0.08), 0 4px 16px rgba(15,23,42,0.04);
  --card-shadow-hover: 0 8px 24px rgba(15,23,42,0.12), 0 2px 8px rgba(15,23,42,0.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background-color: var(--light-bg);
  color: var(--dark-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page-guide {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #ffffff, #f4f8ff);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.06);
}

.page-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.page-guide-intro {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.page-guide-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.page-guide-text h3 {
  font-size: 0.98rem;
  line-height: 1.35;
  margin-bottom: 0.1rem;
}

.page-guide-text p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--secondary-color);
}

.page-guide-kicker {
  display: inline-block;
  margin-bottom: 0.18rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-dark);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.page-guide-dismiss {
  border: 0;
  background: rgba(255, 255, 255, 0.8);
  color: var(--secondary-color);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.page-guide-dismiss:hover {
  background: #fff;
  color: var(--dark-text);
  transform: translateY(-1px);
}

.page-guide-points {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-guide-points li {
  position: relative;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--dark-text);
  font-size: 0.84rem;
}

.page-guide-points li::before {
  content: attr(data-step);
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.62rem;
  font-weight: 700;
}

.guide-fab {
  display: none;
}

.context-tip {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 0.84rem;
}

.context-tip i {
  margin-top: 0.1rem;
}

.context-tip-warning {
  background: #fff8e8;
  border-color: rgba(245, 158, 11, 0.22);
  color: #92400e;
}

.context-tip-danger {
  background: #fff1f2;
  border-color: rgba(239, 68, 68, 0.22);
  color: #991b1b;
}

.context-tip-info {
  background: #eef6ff;
  border-color: rgba(37, 99, 235, 0.16);
  color: #1d4ed8;
}

.action-risk-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.45rem;
  padding: 0.16rem 0.42rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  vertical-align: middle;
}

.action-risk-tag.warning {
  background: #fef3c7;
  color: #92400e;
}

.action-risk-tag.danger {
  background: #fee2e2;
  color: #991b1b;
}

@media (max-width: 900px) {
}

@media (max-width: 640px) {
  .page-guide {
    padding: 0.85rem 0.9rem;
  }

  .page-guide-header {
    align-items: flex-start;
  }

  .page-guide-intro {
    gap: 0.65rem;
  }

  .page-guide-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.65rem;
  }

  .page-guide-points li {
    width: 100%;
  }

  .action-risk-tag {
    margin-left: 0.35rem;
  }
}

/* Utility Classes */
.text-primary { color: var(--primary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }
.text-muted { color: var(--secondary-color) !important; }

.bg-primary { background-color: var(--primary-color) !important; }
.bg-success { background-color: var(--success-color) !important; }
.bg-danger { background-color: var(--danger-color) !important; }
.bg-warning { background-color: var(--warning-color) !important; }
.bg-light { background-color: var(--light-bg) !important; }

/* Buttons */
.btn {
  padding: 0.52rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-speed);
}

.btn:hover::after {
  background: rgba(255,255,255,0.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(79,70,229,0.28), 0 1px 2px rgba(79,70,229,0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79,70,229,0.35), 0 2px 6px rgba(79,70,229,0.2);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.28);
}

.btn-success:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16,185,129,0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,0.28);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(239,68,68,0.35);
}

.btn-warning {
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,0.28);
}

.btn-warning:hover {
  background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245,158,11,0.35);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary-color);
  border: 1.5px solid rgba(79,70,229,0.45);
}

.btn-outline-primary:hover {
  background: rgba(79,70,229,0.06);
  border-color: var(--primary-color);
}

.btn-outline-danger {
  background-color: transparent;
  color: var(--danger-color);
  border: 1.5px solid rgba(239,68,68,0.45);
}

.btn-outline-danger:hover {
  background: rgba(239,68,68,0.06);
  border-color: var(--danger-color);
}

.btn-sm {
  padding: 0.38rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 0.4rem;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: 0.625rem;
}

/* Cards */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(226,232,240,0.6);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: box-shadow var(--transition-speed), transform var(--transition-speed);
}

.card:hover {
  box-shadow: var(--card-shadow-hover);
}

.card-header {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(226,232,240,0.7);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dark-text);
  letter-spacing: -0.01em;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.card-body {
  padding: 0;
}

/* Stats Card */
.stat-card {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 16px rgba(79,70,229,0.25);
}

.stat-card h3 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.stat-card p {
  opacity: 0.9;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.45rem;
  color: var(--dark-text);
  letter-spacing: 0.01em;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.95rem;
  border: 1.5px solid rgba(226,232,240,0.9);
  border-radius: 0.55rem;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition-speed);
  background: #fafbfc;
  color: var(--dark-text);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-select {
  width: 100%;
  padding: 0.6rem 0.95rem;
  border: 1.5px solid rgba(226,232,240,0.9);
  border-radius: 0.55rem;
  font-size: 0.9rem;
  font-family: inherit;
  background-color: #fafbfc;
  cursor: pointer;
  color: var(--dark-text);
  transition: all var(--transition-speed);
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.form-check-input {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

/* Table */
.table-responsive {
  overflow-x: auto;
  border-radius: 0.85rem;
  background: white;
  border: 1px solid rgba(226,232,240,0.6);
  box-shadow: var(--card-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

table thead {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

table thead th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--secondary-color);
  border-bottom: 1px solid rgba(226,232,240,0.8);
}

table tbody tr {
  border-bottom: 1px solid rgba(226,232,240,0.5);
  transition: background-color var(--transition-speed);
}

table tbody tr:last-child {
  border-bottom: none;
}

table tbody tr:hover {
  background-color: rgba(79,70,229,0.03);
}

table tbody td {
  padding: 0.9rem 1rem;
  font-size: 0.875rem;
}

/* Badges */
.badge {
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-success {
  background-color: #dcfce7;
  color: #166534;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-info {
  background-color: #dbeafe;
  color: #1e40af;
}

.badge-primary {
  background-color: #dbeafe;
  color: #1e3a8a;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  height: 100dvh;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0f172a 0%, #131d35 60%, #171630 100%);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-speed);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-backdrop {
  display: none;
}

.sidebar-header {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
  background: linear-gradient(150deg, #4338ca 0%, #312e81 100%);
}

.sidebar-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-brand-logo {
  display: block;
  width: min(260px, 100%);
  max-height: 140px;
  object-fit: contain;
}

.sidebar-menu {
  padding: 0.85rem 0.65rem;
}

/* ── Sidebar user footer ─────────────────────────────────────────────── */
.sidebar-user-footer {
  display: none; /* hidden on desktop — user info is in the header */
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: #0f172a;
  position: sticky;
  bottom: 0;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.5);
  margin-top: 1px;
}

.sidebar-logout-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.sidebar-logout-btn:hover {
  background: rgba(239,68,68,0.25);
  color: #fca5a5;
}

/* Show sidebar footer only on mobile */
@media (max-width: 768px) {
  .sidebar-user-footer {
    display: flex;
  }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.72rem;
  padding: 0.72rem 0.9rem;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: all var(--transition-speed);
  cursor: pointer;
  border-radius: 0.6rem;
  margin-bottom: 0.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
}

.menu-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--sidebar-text-active);
}

.menu-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.25), rgba(79,70,229,0.18));
  color: var(--sidebar-text-active);
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.3);
}

.menu-item.active i {
  color: #a5b4fc;
}

.menu-item i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
  color: rgba(255,255,255,0.45);
  transition: color var(--transition-speed);
}

.menu-item:hover i {
  color: rgba(255,255,255,0.85);
}

/* Sidebar section label — clickable to collapse */
.sidebar-section-label {
  padding: 0.65rem 0.9rem 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-top: 0.35rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color 0.2s;
}
.sidebar-section-label:hover { color: rgba(255,255,255,0.5); }

.sidebar-section-chevron {
  font-size: 0.6rem;
  transition: transform 0.22s ease;
  opacity: 0.5;
}
.sidebar-section-label.collapsed .sidebar-section-chevron {
  transform: rotate(-90deg);
}

/* Collapsible items wrapper */
.sidebar-section-items {
  overflow: hidden;
  max-height: 600px;
  transition: max-height 0.28s ease, opacity 0.22s ease;
  opacity: 1;
}
.sidebar-section-items.collapsed {
  max-height: 0;
  opacity: 0;
}

/* Sidebar badge on menu items */
.sidebar-badge {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 1.05rem;
  height: 1.05rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.2rem;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(15,23,42,0.8);
}

/* Header */
.header {
  position: fixed;
  left: var(--sidebar-width);
  top: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 1px 0 rgba(226,232,240,0.6), 0 4px 16px rgba(15,23,42,0.04);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 999;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.header-left h2 {
  font-size: 1.15rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--dark-text);
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  position: relative;
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  border: 1px solid rgba(226,232,240,0.8);
  background: rgba(248,250,252,0.8);
  transition: all var(--transition-speed);
}

.user-menu:hover {
  background: rgba(241,245,249,1);
  border-color: rgba(203,213,225,0.9);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.user-avatar.business-logo-avatar {
  background: #fff;
  color: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.user-avatar.business-logo-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
  border-radius: inherit;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 1.75rem 2rem;
  min-height: calc(100vh - var(--header-height));
  background: var(--light-bg);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.2s;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  border-radius: 1.1rem;
  padding: 1.75rem;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 24px 64px rgba(15,23,42,0.2), 0 8px 24px rgba(15,23,42,0.12);
  border: 1px solid rgba(226,232,240,0.8);
}

.modal-content-wide {
  max-width: 760px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.35rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(226,232,240,0.7);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-text);
  letter-spacing: -0.01em;
}

.close {
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--secondary-color);
  cursor: pointer;
  border: none;
  background: none;
  line-height: 1;
}

.close:hover {
  color: var(--dark-text);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.device-form-shell {
  max-height: 80vh;
  overflow-y: auto;
  padding-right: 4px;
}

.device-form-section {
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.accent-section {
  background: linear-gradient(135deg, #eef4ff 0%, #f8fcff 55%, #ffffff 100%);
  border-color: #c9dfff;
}

.device-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.device-section-head h4 {
  font-size: 1.05rem;
  color: var(--dark-text);
}

.device-section-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-color);
  margin-bottom: 0.2rem;
}

.device-section-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
}

.device-grid {
  display: grid;
  gap: 0.85rem;
}

.device-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.emi-preview-card {
  background: #0f172a;
  border-radius: 1rem;
  color: #fff;
  padding: 1rem 1.1rem;
}

.emi-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding-top: 0.5rem;
}

.emi-preview-row:first-child {
  padding-top: 0;
}

.emi-preview-hero {
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 0.35rem;
}

.emi-preview-label {
  display: block;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.76);
}

.emi-preview-note {
  display: block;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 0.15rem;
}

.emi-preview-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.emi-preview-subvalue {
  font-size: 0.9rem;
  font-weight: 600;
}

.emi-preview-subvalue.danger {
  color: #fda4af;
}

.form-hint {
  margin-top: 0.45rem;
  font-size: 0.76rem;
  color: var(--secondary-color);
}

.emi-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.emi-summary-card {
  border-radius: 0.9rem;
  padding: 0.7rem 0.85rem;
  background: #f8fbff;
  border: 1px solid #dbe8fb;
}

.emi-summary-card.warning {
  background: #fffbeb;
  border-color: #fde68a;
}

.emi-summary-card.danger {
  background: #fef2f2;
  border-color: #fecaca;
}

.emi-summary-card span,
.installment-values span,
.emi-status-meta {
  font-size: 0.76rem;
  color: var(--secondary-color);
}

.emi-summary-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.1rem;
  color: var(--dark-text);
}

.emi-summary-card small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #475569;
}

.installment-empty {
  border: 1px dashed #c7d7ef;
  border-radius: 0.9rem;
  padding: 1rem;
  text-align: center;
  color: var(--secondary-color);
  background: #f8fbff;
}

.installment-tracker {
  display: block;
}

.installment-table {
  font-size: 0.84rem;
}

.installment-table thead th {
  padding: 0.65rem 0.75rem;
  font-size: 0.76rem;
  white-space: nowrap;
}

.installment-table tbody td {
  padding: 0.6rem 0.75rem;
  vertical-align: middle;
}

.installment-cell-meta {
  display: grid;
  gap: 0.1rem;
}

.installment-cell-meta strong {
  font-size: 0.85rem;
  color: var(--dark-text);
}

.installment-cell-meta span {
  font-size: 0.72rem;
  color: var(--secondary-color);
}

.installment-update-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.installment-status-select,
.installment-input {
  min-width: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.84rem;
}

.installment-status-select {
  min-width: 110px;
}

.installment-input {
  max-width: 110px;
}

.installment-save-button {
  padding: 0.45rem 0.7rem;
  white-space: nowrap;
}

.installment-row {
  border: 1px solid var(--border-color);
  border-radius: 0.95rem;
  padding: 1rem;
  background: #fff;
}

.installment-meta,
.installment-values,
.installment-actions {
  display: grid;
  gap: 0.75rem;
}

.installment-meta {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.installment-kicker {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-color);
  font-weight: 700;
}

.installment-values {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #edf2f7;
}

.installment-values strong,
.installment-meta strong {
  display: block;
  margin-top: 0.25rem;
  color: var(--dark-text);
}

.installment-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
  margin-top: 0.95rem;
}

.emi-status-cell {
  display: grid;
  gap: 0.3rem;
}

.emi-status-progress {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dark-text);
}

.emi-status-cell-overdue {
  gap: 0.15rem;
}

.emi-status-progress-overdue {
  color: #dc2626;
}

.emi-status-meta-overdue {
  color: #dc2626;
  font-weight: 700;
}

.panel-status-banner {
  background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
  border: 1px solid #d7e4f6;
  border-radius: 0.9rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.profile-parent-card {
  margin-bottom: 1rem;
}

.profile-parent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.profile-parent-item {
  border: 1px solid #dbe8fb;
  border-radius: 0.8rem;
  background: #f8fbff;
  padding: 0.8rem 0.9rem;
}

.profile-parent-label {
  display: block;
  font-size: 0.76rem;
  color: var(--secondary-color);
  margin-bottom: 0.25rem;
}

.profile-parent-item strong {
  display: block;
  color: var(--dark-text);
  font-size: 0.95rem;
  word-break: break-word;
}

.alert-device-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.85rem;
}

.alert-device-card,
.alert-device-stats {
  border-radius: 0.9rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.alert-device-eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-color);
  margin-bottom: 0.35rem;
}

.alert-device-meta {

@media (max-width: 768px) {
  .emi-summary-grid {
    grid-template-columns: 1fr;
  }

  .profile-parent-grid {
    grid-template-columns: 1fr;
  }

  .installment-table {
    font-size: 0.78rem;
  }

  .installment-table thead th,
  .installment-table tbody td {
    padding: 0.5rem 0.55rem;
  }

  .installment-update-cell {
    min-width: 190px;
    flex-direction: column;
    align-items: stretch;
  }

  .installment-status-select,
  .installment-input {
    max-width: none;
    width: 100%;
  }
}
  margin-top: 0.35rem;
  color: var(--secondary-color);
  font-size: 0.86rem;
}

.alert-device-stats {
  display: grid;
  gap: 0.7rem;
}

.alert-device-stats span {
  display: block;
  color: var(--secondary-color);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.alert-device-stats strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1rem;
  color: var(--dark-text);
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger-color);
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border-left: 4px solid var(--warning-color);
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af;
  border-left: 4px solid var(--info-color);
}

/* Loading Spinner */
.spinner {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.page-item {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.page-item:hover,
.page-item.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 0;
  }

  body {
    line-height: 1.5;
  }

  h1 {
    font-size: 1.55rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  h3 {
    font-size: 1rem;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  .sidebar {
    width: 272px;
    transform: translateX(-100%);
    box-shadow: 16px 0 48px rgba(15, 23, 42, 0.35);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    z-index: 998;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  .header {
    left: 0;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .header-left,
  .header-right {
    min-width: 0;
  }

  .header-left h2 {
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .header-right {
    gap: 0.75rem;
  }

  /* User menu hidden on mobile — logout moved to sidebar footer */
  .user-menu {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 1rem;
    overflow-x: hidden;
  }

  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .stat-card {
    padding: 14px 12px;
    border-radius: 12px;
    margin-bottom: 0.75rem;
  }

  .stat-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
  }

  .stat-card p {
    font-size: 0.75rem;
  }

  .card {
    padding: 1rem;
  }

  .card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    font-size: 1.05rem;
  }

  .card-header h3 {
    font-size: 1rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-label {
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
  }

  .form-control,
  .form-select {
    padding: 0.72rem 0.85rem;
    font-size: 0.94rem;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    white-space: normal;
  }

  .btn-sm {
    padding: 0.42rem 0.8rem;
    font-size: 0.8rem;
  }

  .btn-lg {
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }

  .badge {
    font-size: 0.68rem;
    padding: 0.28rem 0.58rem;
  }

  .alert {
    padding: 0.9rem 1rem;
    font-size: 0.85rem;
  }

  .modal-header h3 {
    font-size: 1.15rem;
  }

  .modal-footer {
    gap: 0.75rem;
  }

  .row {
    margin: 0 -0.5rem;
  }

  .col,
  .col-md-3,
  .col-md-4,
  .col-md-6,
  .col-md-8,
  .col-md-12 {
    padding: 0 0.5rem;
  }

  table thead th,
  table tbody td {
    padding: 0.75rem;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  .table-responsive {
    -webkit-overflow-scrolling: touch;
    border-radius: 0.8rem;
  }

  /* Default min-width for most tables; key-requests tabs override per-tab below */
  .table-responsive:not(.key-requests-table) table {
    min-width: 680px;
  }

  .row.mb-3 {
    row-gap: 0.75rem;
  }

  .row.mb-3 > [class*='col-'] {
    margin-bottom: 0;
  }

  .header-left .btn.btn-sm,
  .card-header .btn,
  .card-header .btn-sm {
    flex-shrink: 0;
  }

  .card-header.d-flex,
  .card-header.justify-content-between {
    align-items: flex-start;
  }

  .user-profile,
  .user-profile span,
  .header-right .user-profile {
    min-width: 0;
  }

  .user-profile span {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pagination {
    gap: 0.35rem;
  }

  .page-item {
    min-width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }

  .page-guide-text p,
  .page-guide-points li,
  .text-muted {
    font-size: 0.8rem;
  }

  .device-grid.two-col,
  .alert-device-summary,
  .emi-summary-grid,
  .installment-values,
  .installment-actions {
    grid-template-columns: 1fr;
  }
}

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.75rem;
}

.col {
  flex: 1;
  padding: 0 0.75rem;
}

.col-md-3 {
  flex: 0 0 25%;
  max-width: 25%;
  padding: 0 0.75rem;
}

.col-md-4 {
  flex: 0 0 33.333%;
  max-width: 33.333%;
  padding: 0 0.75rem;
}

.col-md-6 {
  flex: 0 0 50%;
  max-width: 50%;
  padding: 0 0.75rem;
}

.col-md-8 {
  flex: 0 0 66.666%;
  max-width: 66.666%;
  padding: 0 0.75rem;
}

.col-md-12 {
  flex: 0 0 100%;
  max-width: 100%;
  padding: 0 0.75rem;
}

@media (max-width: 768px) {
  .col-md-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-md-4,
  .col-md-6,
  .col-md-8,
  .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.35rem;
  }

  h2 {
    font-size: 1.08rem;
  }

  h3 {
    font-size: 0.95rem;
  }

  .stat-card {
    padding: 12px 10px;
    margin-bottom: 0.5rem;
  }

  .stat-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.2rem;
  }

  .stat-card p {
    font-size: 0.7rem;
  }

  .header {
    padding: 0.75rem;
  }

  .main-content {
    padding: 0.85rem;
  }

  .table-responsive table {
    min-width: 620px;
  }

  .card {
    padding: 0.85rem;
    border-radius: 0.65rem;
  }

  .card-header h3 {
    font-size: 0.94rem;
  }

  .form-label {
    font-size: 0.84rem;
  }

  .form-control,
  .form-select {
    font-size: 0.9rem;
    padding: 0.66rem 0.75rem;
  }

  .btn {
    font-size: 0.86rem;
  }

  .btn.btn-primary.w-100,
  .btn.w-100 {
    justify-content: center;
  }

  .badge {
    font-size: 0.64rem;
  }

  .alert {
    font-size: 0.8rem;
  }

  table thead th,
  table tbody td {
    font-size: 0.78rem;
  }

  .modal-content {
    width: calc(100% - 1rem);
    padding: 1rem;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Utility spacing */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.d-none { display: none; }
.d-block { display: block; }

/* Device management surfaces: consistent actions across list, form, and details pages */
.admin-device-ui .btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  justify-content: center;
  white-space: nowrap;
}

.admin-device-ui .btn i {
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.admin-device-ui .btn-sm {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12px;
}

.admin-device-ui .btn-outline-primary {
  border-width: 1px;
}

.admin-device-ui .header-left .btn.btn-sm {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
}

.admin-device-ui .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-device-ui .page-header-actions,
.admin-device-ui .form-actions,
.admin-device-ui .action-bar,
.admin-device-ui .lock-btns,
.admin-device-ui .modal-footer {
  gap: 10px;
}

.admin-device-ui .page-header-actions .btn,
.admin-device-ui .form-actions .btn,
.admin-device-ui .action-bar .btn,
.admin-device-ui .lock-btns .btn,
.admin-device-ui .modal-footer .btn {
  min-width: 118px;
}

.admin-device-ui .form-actions #submitBtn,
.admin-device-ui .action-bar .btn-primary {
  min-width: 138px;
}

.admin-device-ui .devices-filter-row {
  align-items: stretch;
  row-gap: 10px;
}

.admin-device-ui .devices-filter-row > [class*='col-'] {
  display: flex;
}

.admin-device-ui .devices-filter-row .form-control,
.admin-device-ui .devices-filter-row .form-select,
.admin-device-ui .devices-filter-row .btn {
  min-height: 38px;
}

.admin-device-ui table .btn {
  min-width: 86px;
}

.devices-page a.btn,
.devices-page a.btn:hover,
.devices-page a.btn:focus {
  text-decoration: none;
}

.devices-page .device-primary-cta {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 9px;
  background: var(--primary-color);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  font-weight: 700;
  letter-spacing: 0;
}

.devices-page .device-primary-cta:hover {
  background: var(--primary-dark);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.devices-page .device-add-guidance {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #dbeafe;
  background: #eff6ff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.devices-page .device-add-guidance-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: white;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.devices-page .device-add-guidance strong {
  display: block;
  font-size: 13px;
  color: #1e3a8a;
  margin-bottom: 2px;
}

.devices-page .device-add-guidance span {
  display: block;
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

.devices-page .device-details-btn {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  box-shadow: none;
}

.devices-page .device-details-btn:hover {
  background: #dbeafe;
  color: #1e40af;
}

.admin-device-ui .lock-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  justify-content: center;
}

@media (max-width: 640px) {
  .admin-device-ui .page-header-actions,
  .admin-device-ui .page-header-actions .btn,
  .admin-device-ui .form-actions .btn,
  .admin-device-ui .action-bar .btn,
  .admin-device-ui .lock-btns,
  .admin-device-ui .lock-btns .btn,
  .admin-device-ui .lock-btn {
    width: 100%;
  }

  .admin-device-ui .devices-filter-row > [class*='col-'] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Hide sidebar hamburger on desktop — sidebar is always visible there */
@media (min-width: 769px) {
  .sidebar-toggle-btn { display: none !important; }
}

/* Mobile: make hamburger a clear, tappable icon button */
@media (max-width: 768px) {
  .sidebar-toggle-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    margin-right: 0.5rem !important;
    background: var(--light-bg);
    border: 1.5px solid var(--border-color) !important;
    border-radius: 0.45rem;
    color: var(--dark-text);
    font-size: 1rem;
    flex-shrink: 0;
    cursor: pointer;
  }
  .sidebar-toggle-btn:active {
    background: var(--border-color);
  }
}

/* FRP Warning Banner — mobile */
@media (max-width: 640px) {
  .frp-banner-inner {
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    gap: 0.65rem !important;
    padding: 0.85rem 0.9rem !important;
    padding-right: 2.2rem !important; /* room for dismiss × */
  }
  /* Icon stays small and doesn't stretch */
  .frp-banner-inner > div:first-child {
    width: 34px !important;
    height: 34px !important;
    border-radius: 0.5rem !important;
  }
  .frp-banner-inner > div:first-child i {
    font-size: 0.9rem !important;
  }
  /* Text block takes full remaining width */
  .frp-banner-inner > div:nth-child(2) {
    flex: 1 1 0 !important;
    min-width: 0 !important;
  }
  /* Title + badge — allow badge to wrap below on very small screens */
  .frp-banner-inner > div:nth-child(2) > div:first-child {
    flex-wrap: wrap !important;
    gap: 0.3rem !important;
  }
  /* CTA button — full width, below the text block */
  .frp-banner-inner > a {
    width: 100% !important;
    justify-content: center !important;
    padding: 0.55rem 1rem !important;
    font-size: 0.82rem !important;
  }
}

/* ── Key stock alert — shared across keys.html and index.html ──────────────── */
.key-stock-alert {
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 1rem 1.1rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 5px solid #f97316;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(154,52,18,.08);
}
.key-stock-alert.danger {
  background: #fef2f2;
  border-color: #fecaca;
  border-left-color: #dc2626;
}
.key-stock-alert-main {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  min-width: 0;
}
.key-stock-alert-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #ffedd5;
  color: #c2410c;
  font-size: 1rem;
}
.key-stock-alert.danger .key-stock-alert-icon { background: #fee2e2; color: #b91c1c; }
.key-stock-alert-title { font-size: .95rem; font-weight: 800; color: #111827; margin-bottom: .18rem; }
.key-stock-alert-text  { font-size: .82rem; color: #7c2d12; line-height: 1.45; }
.key-stock-alert.danger .key-stock-alert-text { color: #991b1b; }
.key-stock-alert-action { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 640px) {
  .key-stock-alert { flex-direction: column; }
  .key-stock-alert-action { width: 100%; }
  .key-stock-alert-action .btn { width: 100%; justify-content: center; }
}
