.detail-input.small-inline {
  width: 100px;
}

/* Disabled inputs visual style */
.detail-input:disabled {
  background-color: #eee;
  color: #666;
  border-color: #ddd;
  cursor: not-allowed;
  opacity: 0.9;
}

/* Grey out labels when the field wrapper is disabled */
.form-field-disabled > label {
  color: #999;
}
* {box-sizing: border-box;}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
}

.wrapper-main {
  width: 700px;
  margin: 0 auto;
}

.section-default {
  width: 100%;
  margin-top:30px;
  padding: 20px;
  border-radius: 6px;
  background-color: #e9e9e9;
}

/* .topnav {
  overflow: hidden;
  background-color: #e9e9e9;
} */

/* Top navigation */
.topnav {
  background-color: #e9e9e9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  position: relative;
  z-index: 9999;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Admin Debug: Viewport width display */
#viewport-debug {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(0,0,0,0.9);
  color: #00ff00;
  padding: 4px 8px;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  z-index: 10000;
  white-space: nowrap;
  border-radius: 0 0 4px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  pointer-events: none;
}

/* Brand/Logo */
.nav-brand {
  flex: 0 0 auto;
}

.brand-link {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  padding: 8px 0;
  display: none; /* Hide by default */
}

.brand-link:hover {
  color: #439bfa;
}

/* Desktop: always show full header (logo + nav) for viewports 1025px and up */
@media screen and (min-width: 1025px) {
  .topnav {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .nav-brand {
    flex: 0 0 auto !important;
    order: 0 !important;
  }
  .brand-link {
    display: block !important;
  }
  .nav-menu {
    display: flex !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    flex-direction: row !important;
    left: auto !important;
    background-color: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    order: 0 !important;
  }
  .nav-menu .nav-left,
  .nav-menu .nav-right {
    flex-direction: row !important;
    width: auto !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .topnav .hamburger,
  .topnav > .hamburger,
  div.topnav .hamburger {
    display: none !important;
  }
}

.menu-container {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  background-color: #333;
  color: white;
  z-index: 10000; /* Ensure the menu container is on top */
}

/* Removed old hamburger style - using new mobile hamburger below */

.menu-items {
  display: none;
  position: absolute;
  top: 50px;
  right: 20px;
  background-color: #333;
  width: 200px;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 99999; /* Set very high z-index to be sure */
}

.menu-items ul {
  list-style: none;
  padding: 0;
  margin: 0;
  /* z-index: 1000; */
}

.menu-items ul li {
  padding: 10px;
  text-align: center;
  /* z-index: 1000; */
}

.menu-items ul li a {
  text-decoration: none;
  color: white;
  display: block;
  /* z-index: 1000; */
}

.menu-items ul li a:hover {
  background-color: #575757;
}

/* .topnav a {
  float: left;
  display: block;
  color: black;
  text-align: center;
  padding: 10px 12px;
  text-decoration: none;
  font-size: 14px;
} */

/* Navigation Menu */
.nav-menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Left navigation group */
.nav-left {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Right navigation group */
.nav-right {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Topnav links (desktop) */
.nav-menu a {
  display: inline-block;
  color: black;
  text-align: center;
  padding: 8px 16px;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
  
  /* OPTION 1: Subtle pill buttons with border (uncomment to use) */
  /* border-radius: 20px;
  border: 1px solid transparent;
  background: rgba(102, 126, 234, 0.05); */
  
  /* OPTION 2: Subtle rounded rectangles */
  border-radius: 6px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  background: rgba(102, 126, 234, 0.08);
}

/* .topnav a:hover {
  background-color: #439bfa;
  box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
  color: white;
} */

/* Hover effect */
.nav-menu a:hover {
  background: #667eea;
  color: white;
  border-color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Global button style used across app */
.mybutton,
label.mybutton {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #439bfa;
  background-color: #439bfa;
  color: #fff !important;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.mybutton:hover,
label.mybutton:hover {
  background-color: #2f7ed6;
  border-color: #2f7ed6;
  color: #fff !important;
}

/* Hide the checkbox, we only need it for toggling */
input[type="checkbox"] {
  display: none;
}

/* Other checkboxes (standard) */
input[type="checkbox"]:not(#menu-toggle):not(#resetModalToggle) {
  margin-right: 10px;
  display: inline-block;
}

/* Ensure the mobile menu is hidden by default */
#mobile-menu {
  display: none;
  flex-direction: column;
  background-color: #e9e9e9;
  position: absolute;
  top: 50px;
  right: 10px;
  width: 200px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

/* When the checkbox is checked, show the menu */
input[type="checkbox"]#menu-toggle:checked + .icon + #mobile-menu {
  display: flex; /* Show the menu when checkbox is checked */
}

/* Show menu items */
#mobile-menu a {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 8px;
  gap: 4px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: #333;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile-specific hamburger sizing */
@media screen and (max-width: 768px) {
  .hamburger {
    padding: 4px;
    gap: 3px;
  }
  
  .hamburger span {
    width: 20px;
    height: 2px;
  }
  
  .hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-4px, 5px);
  }
  
  .hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-4px, -5px);
  }
}

.logout-button {
  float: left;
  display: block;
  color: black;
  text-align: center;
  padding: 10px 12px;
  text-decoration: none;
  font-size: 14px;
}

.logout-button:hover {
  background-color: #439bfa;
  box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
  color: white;
}

.topnav p {
    float: left;
    display: block;
    color: black;
    text-align: center;
    padding: 10px 12px;
    text-decoration: none;
    font-size: 14px;
  }

.main-button {
  background-color:#575d96;
  width:135px;
  height:30px;
  font-size:16px;
  border-radius:7px;
  color: white;
  cursor: pointer;
}

.main-button:hover {
  background-color: #439bfa;
  box-shadow: 0 12px 16px 0 rgba(0,0,0,0.24), 0 17px 50px 0 rgba(0,0,0,0.19);
}

/* .topnav a:hover {
  background-color: #ddd;
  color: black;
} */

.topnav a.active {
  background-color:#575d96;
  color: white;
}

.nav-menu .logout-container {
  margin-left: 10px;
}

.logout-link {
  color: #dc3545 !important;
  font-weight: 500;
}

.logout-link:hover {
  background-color: #dc3545 !important;
  color: white !important;
}

.topnav input[type=text] {
  padding: 6px;
  margin-top: 8px;
  font-size: 14px;
  border: none;
}

.topnav .logout-container button {
  float: center;
  padding: 2px;
  margin-top: 8px;
  margin-right: 16px;
  background: #ddd;
  font-size: 14px;
  border: none;
  cursor: pointer;
}

.topnav .logout-container button:hover {
  background: #ccc;
}

.main-image {
  width: 350px; 
  height: auto;
}

/* sign up */
.form-signup {
  margin: 0 auto;
  padding-top: 20px;
  width: 300px;
  }

  .form-input {
  width: 300px;
  height: 30px;
  padding: 0 15px;
  margin-bottom: 6px;
  border: 1px solid #CCC;
  border-radius: 4px;
  background-color: #F6F6F6;
  /* float: left; */
  font-family: arial;
  }

  /* Password container with eye icon */
  .password-container {
    position: relative;
    display: inline-block;
    width: 300px;
  }

  .password-container .form-input {
    width: 100%;
    padding-right: 40px; /* Make room for the eye icon */
  }

  .password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    font-size: 16px;
    user-select: none;
    z-index: 10;
    padding: 5px;
  }

  .password-toggle:hover {
    color: #333;
  }

  .signuperror {
  padding-top: 14px;
  font-family: arial;
  font-size: 16px;
  color: red;
  text-align: center;
  }

  .signupsuccess {
  padding-top: 14px;
  font-family: arial;
  font-size: 16px;
  color: green;
  text-align: center;
  }

  #termsOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

  #termsContent {
    position: relative;
    width: 50%;
    margin: 10% auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    max-height: 70vh; /* Restrict height to 70% of the viewport */
    overflow-y: auto; /* Enable vertical scrolling */
}

/* #termsOverlay button {
  display: block;
  margin: 20px auto 0;
  padding: 10px 20px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
} */

/* #termsOverlay button:hover {
  background-color: #0056b3;
} */

.terms-container {
  display: flex;
  align-items: center;
}

.terms-container input {
  margin-right: 10px;
}


.copy-btn {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin-left: 10px;
  color: #5a5a5b;
  font-size: 12px;
}

.copy-btn i {
  margin-right: 5px;
}

.copy-btn:hover {
  color: #0056b3;
}

.copied {
  color: green;
}

.stats-table
{
    border: 1px solid black;
    align-content: left;
}

.table-header
{
    display: table-cell;
    border-color: inherit;
    padding: 3px;
    color: white;
    background-color: #545455;
    font-weight: bold;
    text-align: center;
    vertical-align: inherit;
}




/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Dimmed background */
  overflow: auto;
}

/* Modal content styles */
.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 50%; /* Adjust width */
  max-height: 80%;
  overflow-y: auto;
  position: relative;
  text-align: center;
}

/* Close button at the top center */
.close-btn {
  background-color: #4CAF50;
  color: white;
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
}

.close-btn:hover {
  opacity: 0.8;
}

/* Username styling */
.modal-username {
  font-size: 18px;
  font-weight: bold;
  margin-top: 40px;
  margin-bottom: 20px;
}

/* Note content box styling */
.modal-note-content {
  background-color: #f7f7f7;
  padding: 15px;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  max-height: 300px;  /* Restrict note box height */
  overflow-y: auto;   /* Scrollable if content exceeds the box height */
}

/* Button Styles */
.view-note-btn {
  padding: 5px 10px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  color: white;
}

.view-note-btn:hover {
  opacity: 0.8;
}

/* 3-col grid just for the criteria header + checkboxes */
.criteria-grid-3 {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px 16px;
  align-items: start;
  grid-column: 1 / -1; /* keep spanning full width */
}
.criteria-grid-3 .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: #333;
}
.criteria-grid-3 input[type="text"],
.criteria-grid-3 input[type="number"],
.criteria-grid-3 input[type="date"],
.criteria-grid-3 select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
}
.criteria-grid-3 .check {
  padding: 8px 10px;
  max-width: 200px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
}
.criteria-grid-3 .check label {
  font-weight: 500;
}

.scan-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.scan-toolbar .left{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.scan-toolbar .right{
  display:flex;
  gap:8px;
}

/* Two-column section with label-left layout (label/input × 2) */
.fields-2col{
  display: grid;
  grid-template-columns: 150px minmax(180px, 1fr) 175px minmax(180px, 1fr);
  column-gap: 30px;
  row-gap: 12px;
  align-items: center;         /* vertically center inputs with labels */
  grid-column: 1 / -1;         /* span full width of the outer grid */
}

.fields-2col label{
  justify-self: end;           /* labels align right, next to inputs */
  font-weight: 600;
  color: #333;
}

.fields-2col input{
  width: 90%;
  padding: 8px 10px;
  border: 1px solid #bbb;
  border-radius: 6px;
  box-sizing: border-box;
}

/* Optional utility if you ever need a full-width row inside this grid */
.fields-2col .full-row{ grid-column: 1 / -1; }

details.scan-results {
  margin-top: 12px;
  border: 1px solid #ddd;
  background: #fffef8;
  border-radius: 8px;
  padding: 10px 12px;
}
details.scan-results summary {
  cursor: pointer;
  list-style: none; /* keep default arrow but cleaner */
  font-size: 14px;
}
details.scan-results summary::-webkit-details-marker { display:none; }
details.scan-results summary::before {
  content: "▾";
  display: inline-block;
  margin-right: 6px;
  font-size: 1.6em;  
  line-height: 1;
  transition: transform .15s ease;
}
details.scan-results[open] summary::before { transform: rotate(0deg); }
details.scan-results:not([open]) summary::before { transform: rotate(-90deg); }

.chip-wrap { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; max-height:260px; overflow:auto; }
.chip {
  display:inline-block; padding:6px 10px; border:1px solid #ddd; border-radius:999px;
  background:#f6f6f6; text-decoration:none; font-family:monospace;
}

tr.just-added{animation:flash .8s}
@keyframes flash{0%{background:#fff7c2}100%{background:transparent}}

.btn-add-all{
    margin-left: 10px;
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1.2;
    border: 1px solid #888;
    border-radius: 6px;
    background: #f5f5f5;
    cursor: pointer;
  }
  .btn-add-all:disabled{ opacity:.6; cursor: default; }

/* /////////////////////////////////////
///////////////  MOBILE  ///////////////
//////////////////////////////////////// */

/* MOBILE css */
@media screen and (max-width: 800px) {
 

  /* Removed conflicting hamburger style */
  .menu-items {
    display: block;
    position: static;
    width: auto;
    background-color: transparent;
  }
  .menu-items ul li {
    display: inline;
    margin-left: 20px;
  }
  /* .topnav a {
    display: none;
  }

  .topnav .logout-container {
    float: none;
  }

  .topnav input[type=text], .topnav .logout-container button {
    float: none;
    display: block;
    text-align: left;
    width: 100%;
    margin: 0;
    padding: 14px;
  }

  .topnav input[type=text] {
    border: 1px solid #ccc;  
  }


  .topnav a:not(:last-child) {
    display: none;
  }


  /* Removed conflicting icon styles */


  #mobile-menu.show {
    display: flex;
  } */

  .main-image {
    width: 90vw; 
    height: auto;
  }

  #termsContent {
    position: relative;
    width: 90%;
    margin: 10% auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    max-height: 80vh; /* Restrict height to 70% of the viewport */
    overflow-y: auto; /* Enable vertical scrolling */
}

 /* Allow page to shrink (override any inline/head min-width) */
  html, body { min-width: 0 !important; }

  /* Sections edge-to-edge with comfy spacing */
  .section {
    width: 100% !important;
    margin: 12px auto !important;
    padding: 14px !important;
  }

  /* Brand/header images scale */
  .main-image { width: 100%; height: auto; }

  /* Scan toolbar: stack buttons under the select */
  .scan-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .scan-toolbar .left {
    width: 100%;
    justify-content: flex-start;
  }
  .scan-toolbar .right,
  .scan-toolbar button[form="scan-form"] {
    width: auto;
  }

  /* 4-col criteria block -> 2 cols on mobile */
  .criteria-grid-3 {
    grid-template-columns: repeat(2, minmax(140px, 1fr)) !important;
    gap: 10px 12px;
  }
  .criteria-grid-3 .form-group label { margin-bottom: 6px; }
  .criteria-grid-3 .check {
    max-width: 200px;  /* keep your cap */
    width: 100%;
  }

  /* Label-left fields: switch to TWO equal columns on mobile */
  .fields-2col {
    grid-template-columns: 1fr 1fr !important;   /* two equal columns */
    column-gap: 15px;
    row-gap: 10px;
  }
  .fields-2col label { 
    justify-self: start; 
    font-size: 14px;
  }
  .fields-2col input {
    width: 100% !important;   /* full width of column */
    font-size: 14px;
  }
  
  /* My Symbols section mobile optimization */
  .section h2 {
    font-size: 16px !important;
  }
  
  .section {
    padding: 10px !important;
  }
  
  .section a {
    font-size: 12px !important;
    padding: 3px 6px !important;
  }
  
  /* My Symbols table mobile optimization */
  .section table {
    font-size: 12px !important;
  }
  
  .section table th,
  .section table td {
    padding: 4px 6px !important;
    font-size: 12px !important;
  }
  
  .section table th {
    font-size: 11px !important;
    font-weight: 600;
  }
  
  .section input[type="text"] {
    font-size: 12px !important;
    padding: 4px 6px !important;
    width: 120px !important;
  }
  
  /* My Symbols table with horizontal scroll and JavaScript sticky columns */
  .section .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    position: relative;
  }
  
  .section .table-container table {
    min-width: 1000px;
    font-size: 12px !important;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
  }
  
  /* Sticky column styles - JavaScript will handle positioning */
  .section .table-container table th:first-child,
  .section .table-container table td:first-child {
    position: relative;
    background-color: #f8f9fa;
    z-index: 60; /* ensure above other headers */
    border-right: 2px solid #dee2e6;
    min-width: 100px;
    width: 100px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  }
  
  .section .table-container table th:first-child {
    background-color: #e9ecef;
    font-weight: 600;
  }
  
  .section .table-container table td:first-child {
    background-color: #fff;
  }
  
  .section .table-container table th:last-child,
  .section .table-container table td:last-child {
    position: relative;
    background-color: #f8f9fa;
    z-index: 15; /* below first column */
    border-left: 2px solid #dee2e6;
    min-width: 120px;
    width: 120px;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  }
  
  .section .table-container table th:last-child {
    background-color: #e9ecef;
  }
  
  .section .table-container table td:last-child {
    background-color: #fff;
  }

  /* Options: wrap into 2 (or 3 if space) per row
     If you add class="options-grid" to the container, this will apply.
  */
  .options-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    gap: 8px;
  }

  /* You currently have inline style on the Options grid.
     This overrides that inline grid just on mobile. */
  [style*="grid-template-columns: repeat(5"] {
    grid-template-columns: repeat(2, minmax(140px, 1fr)) !important;
  }

  /* Tables: horizontal scroll instead of squish */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table thead tr, table tbody tr {
    white-space: nowrap;
  }

  /* Teams two-column area -> stacked */
  .section > div[style*="display: flex"] {
    display: block !important;
  }
  .section > div[style*="display: flex"] > div {
    width: 100% !important;
    margin-bottom: 16px;
  }

  /* Modal / terms width for small screens */
  .modal-content,
  #termsContent {
    width: 92% !important;
    margin: 10% auto !important;
    max-height: 80vh !important;
  }

  /* Top nav: keep touch targets usable */
  .topnav a {
    padding: 10px 10px;
    font-size: 14px;
  }

}

/* Marketing Box Styles */
.marketing-box {
  width: 300px;
  height: 400px;
  margin: 30px auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.marketing-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(102, 126, 234, 0.4);
}

.marketing-box::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s;
}

.marketing-box:hover::before {
  animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.marketing-content {
  padding: 25px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

.marketing-icon {
  font-size: 28px;
  text-align: center;
  margin-bottom: 15px;
  animation: bounce 2s infinite;
}

.pricing-text {
  font-family: 'Grenze Gotisch', cursive;
  font-size: 32px;
  font-weight: bold;
  color: #f1f2f1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  display: inline-block;
  margin-left: 8px;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

.marketing-title {
  color: white;
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin: 0 0 5px 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.marketing-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  text-align: center;
  line-height: 1.4;
  margin: 0 0 5px 0;
}

.marketing-features {
  margin: 5px 0;
}

.feature-item {
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  margin: 5px 0;
  text-align: center;
  font-weight: 500;
}

.marketing-button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 25px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.marketing-button:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
  text-decoration: none;
  color: white;
}

.button-arrow {
  font-size: 18px;
  transition: transform 0.3s ease;
}

.marketing-button:hover .button-arrow {
  transform: translateX(5px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  /* My Symbols tables - increase font sizes on mobile */
  .section .table-container table {
    font-size: 14px !important;
  }
  .section .table-container table th,
  .section .table-container table td {
    font-size: 14px !important;
    padding: 6px 8px !important;
  }
  .section .table-container table thead th {
    font-size: 13px !important;
    font-weight: 600 !important;
  }
  /* Sticky table headers for My Symbols/My List tables on mobile */
  .table-container #symbol-table thead th,
  .table-container #top-ten-table thead th {
    position: sticky;
    top: 0;
    z-index: 5; /* baseline header z-index lower than symbol header */
    background-color: #e9ecef;
  }
  /* Ensure the first (Symbol) header cell sits above other headers and aligns left */
  .table-container table thead th:first-child {
    position: sticky;
    top: 0;
    left: 0; /* pin to left */
    z-index: 9999; /* ensure symbol header above others */
    background-color: #e9ecef;
  }
  /* Mobile Navigation */
  .topnav {
    justify-content: flex-start !important;
    padding: 8px 12px;
  }
  
  .brand-link {
    display: block; /* Show brand on mobile */
    font-size: 16px;
    padding: 4px 0;
  }
  
  .hamburger {
    display: flex;
    order: -1 !important; /* Move hamburger to left */
    margin-right: 10px !important;
  }
  
  .topnav > .nav-brand {
    order: 0 !important;
    margin-right: auto !important;
  }
  
  .nav-menu {
    display: none; /* Hide desktop nav on mobile */
    position: fixed;
    top: 50px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 50px);
    background-color: #f8f9fa;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 15px 0;
    transition: left 0.3s ease;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 9998;
  }
  
  .nav-menu.active {
    display: flex; /* Show when hamburger is clicked */
    left: 0;
  }
  
  .nav-menu .nav-left {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    align-items: flex-start;
    padding-left: 16px;
  }
  
  .nav-menu .nav-right {
    flex-direction: column;
    width: 100%;
    gap: 8px;
    align-items: flex-start;
    padding-left: 16px;
  }
  
  .nav-menu a {
    display: block;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
    font-size: 15px;
    width: 150px;
  }
  
  /* Theme toggle container on mobile - override inline styles */
  .nav-menu .nav-right > div[style] {
    width: 150px !important;
    margin: 0 !important;
    margin-right: 0 !important;
    margin-top: 8px !important;
    display: flex !important;
    justify-content: flex-start !important;
    padding-left: 0 !important;
  }
  
  .nav-menu .nav-right > div > div[style] {
    width: 150px !important;
    display: flex !important;
    margin: 0 !important;
  }
  
  /* Make Light and Dark buttons equal width */
  .nav-menu .theme-btn {
    flex: 1 1 50% !important;
    min-width: 0 !important;
    padding: 5px 8px !important;
    font-size: 0.75em !important;
  }
  
  /* Align Help link properly - override inline styles */
  .nav-menu .nav-right > a[style] {
    margin: 0 !important;
    margin-right: 0 !important;
  }
  
  .nav-menu .nav-left a:last-of-type {
    border-bottom: 1px solid #e9ecef;
  }
  
  .nav-menu .logout-container {
    margin: 15px 0 0 0;
    padding: 0;
  }
  
  .nav-menu .logout-container .logout-link {
    display: block;
    padding: 8px 12px;
    border: 1px solid #dc3545;
    border-radius: 5px;
    text-align: center;
    background-color: transparent;
    width: 150px;
  }
  
  .nav-menu .logout-container .logout-link:hover {
    background-color: #dc3545 !important;
    color: white !important;
  }
  
  /* Remove extra body padding since header is not fixed on mobile */
  /* body padding-top removed - header is not fixed positioned on mobile */
}

/* Mobile Device Detection - only for narrow viewports (≤1024px) so PC at 1025px+ always gets full header */
@media screen and ((pointer: coarse) and (max-width: 1024px)),
       screen and ((hover: none) and (max-width: 1024px)),
       screen and ((pointer: coarse) and (max-height: 900px) and (max-width: 1024px)),
       screen and ((hover: none) and (max-height: 900px) and (max-width: 1024px)) {
  /* Hide desktop navigation on mobile devices (both orientations) */
  /* But allow it to show when active class is present */
  .nav-menu:not(.active) {
    display: none !important;
  }
  /* Show brand next to hamburger when in mobile layout */
  .brand-link {
    display: block !important;
    font-size: 16px;
    padding: 4px 0;
  }
  
  /* Prevent header overflow and fix layout */
  .topnav {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
  }
  
  /* Force hamburger to be on the left - use maximum specificity */
  .topnav .hamburger,
  .topnav > .hamburger,
  div.topnav .hamburger {
    order: -999 !important;
    margin-right: 10px !important;
    margin-left: 0 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    position: relative !important;
    left: 0 !important;
    right: auto !important;
    float: none !important;
  }
  
  /* Nav brand comes after hamburger */
  .topnav .nav-brand,
  .topnav > .nav-brand,
  div.topnav .nav-brand {
    order: 0 !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    flex-shrink: 0 !important;
  }
  
  /* Hide desktop nav menu in topnav, but allow it to show when active */
  .topnav .nav-menu:not(.active),
  .topnav > .nav-menu:not(.active),
  div.topnav .nav-menu:not(.active) {
    display: none !important;
    order: 999 !important;
  }
  
  /* Show menu when active - must override the hidden state */
  .topnav .nav-menu.active,
  .topnav > .nav-menu.active,
  div.topnav .nav-menu.active,
  .nav-menu.active {
    display: flex !important;
    position: fixed !important;
    top: 50px !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100vh - 50px) !important;
    z-index: 9998 !important;
    background-color: #f8f9fa !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding: 15px 0 !important;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1) !important;
    order: 999 !important;
    overflow-y: auto !important;
  }
  
  /* Ensure nav-left and nav-right are columns when menu is active */
  .nav-menu.active .nav-left,
  .nav-menu.active .nav-right {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
    align-items: stretch !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
  }
  
  /* Make links stack vertically and take full width - left aligned */
  .nav-menu.active .nav-left a,
  .nav-menu.active .nav-right a {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 8px 12px !important;
    border-bottom: 1px solid #e9ecef !important;
    text-align: left !important;
    text-align-last: left !important;
    box-sizing: border-box !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }
  
  /* Ensure nav-menu children don't display in row */
  .nav-menu.active > * {
    flex-direction: column !important;
    display: flex !important;
  }
  
  /* Prevent body scroll when menu is open */
  body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }
  
  html.menu-open {
    overflow: hidden !important;
  }
  
  /* Ensure topnav layout is correct */
  .topnav {
    flex-direction: row !important;
    align-items: center !important;
  }
  
  /* Ensure body doesn't overflow */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative !important;
  }
  
  /* Fix page width constraints - remove left padding/margin */
  .section {
    width: 100% !important;
    max-width: 100% !important;
    margin: 15px 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 15px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box !important;
  }
  
  /* Ensure table container handles overflow properly */
  .table-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* Prevent table from being wider than container, but allow horizontal scroll if needed */
  .table-container table {
    width: 100% !important;
    min-width: 600px !important; /* Allow horizontal scroll if table is wider */
    table-layout: auto !important;
  }
  
  /* Ensure sections don't have excessive padding in landscape */
  .section.section-default {
    padding-left: 5px !important;
    padding-right: 5px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Prevent any element from causing horizontal scroll */
  body > * {
    max-width: 100vw !important;
    box-sizing: border-box !important;
  }
  
  /* Allow tables to scroll horizontally if needed */
  .table-container {
    overflow-x: auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  /* Ensure navigation items don't overflow */
  .nav-left,
  .nav-right {
    overflow: visible !important;
  }
}

  /* Marketing box styles */
  .marketing-box {
    width: 280px;
    height: 290px;
    margin: 20px auto;
  }
  
  .marketing-content {
    padding: 20px;
  }
  
  .marketing-title {
    font-size: 20px;
  }
  
  .marketing-description {
    font-size: 13px;
  }
  
  .feature-item {
    font-size: 11px;
  }
  
  .marketing-button {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .pricing-text {
    font-size: 28px;
  }

  /* Overlay sticky first header to guarantee top stacking */
  .table-container .sticky-first-header {
    position: sticky;
    top: 0;
    left: 0;
    z-index: 10000;
    display: block;
    width: 100%;
    height: 100%;
    background-color: #e9ecef; /* mask anything underneath */
    background-clip: padding-box;
    border-right: 2px solid #dee2e6;
    box-shadow: 6px 0 8px rgba(0,0,0,0.08); /* soft divider on right */
    font-weight: 600;
    text-align: left;
    pointer-events: none; /* don't block header clicks */
  }
}

/* ========================================
   ADMIN DASHBOARD STYLES
   ======================================== */

.admin-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

.admin-log-card {
    margin-top: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 20px;
}

.admin-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.admin-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-log-table th,
.admin-log-table td {
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 12px;
    vertical-align: top;
    text-align: left;
}

.admin-log-table th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 13px;
}

.admin-log-table-container {
    max-height: 500px;
    overflow-y: auto;
}

.log-summary {
    font-weight: 600;
    margin-bottom: 6px;
}

.log-details-list {
    margin: 0;
    padding-left: 18px;
    color: #444;
}

.log-details-list li {
    margin-bottom: 4px;
}

/* My Symbols desktop - keep compact sizes */
@media screen and (min-width: 769px) {
    .section .mode-selector-header h2 {
        font-size: 1.3em !important;
    }
    
    .section .mode-selector-header label {
        font-size: 0.6em !important;
        margin-left: 8px !important;
    }
    
    .section .mode-selector-header select {
        font-size: 0.6em !important;
        padding: 2px 4px !important;
        max-width: 140px !important;
    }
    
    .section .mode-selector-header .btn {
        font-size: 0.7em !important;
        padding: 4px 8px !important;
    }
    
    /* My Scanner desktop - match mode selector to other inputs */
    .ultra-compact-scanner > div:first-of-type h2 label {
        font-size: 0.85em !important;
        margin-left: 10px !important;
        font-weight: 600 !important;
    }
    
    .ultra-compact-scanner > div:first-of-type h2 select {
        font-size: 0.8em !important;
        padding: 3px 6px !important;
        height: 24px !important;
        font-weight: normal !important;
    }
}

/* My Symbols mobile input styles */
@media screen and (max-width: 768px) {
    .add-symbol-input {
        width: 100% !important;
        max-width: 300px !important;
        flex: 1 !important;
    }
    
    /* Keep mode selector on same line as title on mobile */
    .section .mode-selector-header {
        flex-wrap: nowrap !important;
        gap: 3px !important;
        align-items: center !important;
    }
    
    .section .mode-selector-header h2 {
        font-size: 0.95em !important;
        white-space: nowrap !important;
        margin: 0 !important;
        flex-shrink: 1 !important;
    }
    
    .section .mode-selector-header label {
        font-size: 0.7em !important;
        white-space: nowrap !important;
        margin-left: 2px !important;
        flex-shrink: 0 !important;
    }
    
    .section .mode-selector-header select {
        font-size: 0.7em !important;
        padding: 2px 4px !important;
        min-width: 150px !important;
        width: 150px !important;
        flex-shrink: 0 !important;
    }
    
    .section .mode-selector-header .btn {
        display: none !important;
    }
}

/* Mobile Admin Dashboard Styles */
@media screen and (max-width: 768px) {
    .admin-container {
        padding: 10px !important;
        max-width: 100% !important;
        overflow-x: visible !important;
    }
    
    .dashboard-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 15px !important;
        width: 100% !important;
        overflow: hidden !important;
    }
    
    .dashboard-title {
        font-size: 1.5em !important;
        margin: 0 !important;
    }
    
    .action-buttons {
        flex-wrap: wrap !important;
        gap: 6px !important;
        width: 100% !important;
        max-width: 100% !important;
        justify-content: flex-start !important;
        overflow: visible !important;
    }
    
    .action-buttons .btn {
        flex: 0 1 auto !important;
        min-width: 90px !important;
        max-width: calc(50% - 3px) !important;
        font-size: 10px !important;
        padding: 6px 8px !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        box-sizing: border-box !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        margin-bottom: 15px !important;
        width: 100% !important;
    }
    
    .stat-card {
        padding: 8px 6px !important;
    }
    
    .stat-number {
        font-size: 1.2em !important;
    }
    
    .stat-label {
        font-size: 9px !important;
        line-height: 1.2 !important;
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-button {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .search-filter {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .search-filter input[type="text"] {
        width: 100%;
        max-width: none;
    }
    
    .search-filter select {
        width: 100%;
    }
    
    .search-filter .btn {
        width: 100%;
        margin-top: 5px;
    }
    
    /* Table container for horizontal scrolling */
    .table-container {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        margin: 0 !important;
        border: 1px solid #dee2e6 !important;
        border-radius: 8px !important;
        display: block !important;
        position: relative !important;
    }
    
    .data-table {
        display: table !important;
        min-width: 900px !important;
        width: 900px !important;
        font-size: 11px !important;
        border-spacing: 0 !important;
        border-collapse: separate !important;
        table-layout: fixed !important;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px 4px !important;
        min-width: 70px !important;
        white-space: nowrap !important;
    }
    
    /* Non-sticky cells need relative positioning */
    .data-table th:not(:first-child),
    .data-table td:not(:first-child) {
        position: relative !important;
    }
    
    .data-table th {
        background: #f8f9fa !important;
        font-size: 11px !important;
        font-weight: 600 !important;
    }
    
    /* Make first column (Name) sticky on mobile with proper width */
    .data-table th:first-child,
    .data-table td:first-child {
        position: -webkit-sticky !important;
        position: sticky !important;
        left: 0 !important;
        z-index: 100 !important;
        min-width: 112px !important;
        max-width: 112px !important;
        width: 112px !important;
        box-shadow: 2px 0 4px rgba(0,0,0,0.15) !important;
        font-size: 10px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        background-clip: padding-box !important;
    }
    
    .data-table thead th:first-child {
        background: #e9ecef !important;
        z-index: 101 !important;
    }
    
    .data-table tbody td:first-child {
        background: #fff !important;
        z-index: 100 !important;
    }
    
    /* Admin table specific adjustments */
    .admin-table-cell {
        padding: 6px 4px !important;
        font-size: 11px;
    }
    
    /* Action buttons in tables */
    .action-buttons-small {
        flex-direction: column;
        gap: 3px;
    }
    
    .btn-small {
        padding: 3px 6px;
        font-size: 10px;
        width: 100%;
    }
    
    /* Note button adjustments */
    .note-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    /* Subscription form adjustments */
    .data-table form {
        display: flex;
        flex-direction: column;
        gap: 3px;
    }
    
    .data-table form select {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    .data-table form button {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    /* API stats table mobile */
    .api-stats {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .api-table {
        font-size: 12px;
    }
    
    .api-table th,
    .api-table td {
        padding: 8px 10px;
    }
    
    /* Modal adjustments for mobile */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
    
    .close-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .modal-username {
        font-size: 16px;
        margin-top: 30px;
    }
    
    .modal-note-content {
        font-size: 14px;
        padding: 12px;
    }
    
    /* Additional mobile optimizations */
    .data-table button {
        min-height: 32px;
        touch-action: manipulation;
    }
    
    .data-table form button {
        min-height: 28px;
    }
    
    /* Improve touch targets */
    .data-table a {
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        padding: 4px 8px;
    }
    
    /* Better spacing for mobile */
    .data-table tr {
        border-bottom: 1px solid #eee;
    }
    
    .data-table tr:hover {
        background-color: #f8f9fa;
    }
    
    /* Status badges mobile optimization */
    .status-badge {
        font-size: 10px;
        padding: 2px 6px;
        border-radius: 3px;
    }
    
    /* Loading spinner mobile */
    .loading {
        padding: 15px;
    }
    
    .spinner {
        width: 30px;
        height: 30px;
        border-width: 3px;
    }
    
    /* Tab content mobile spacing */
    .tab-content {
        padding: 0;
        overflow: visible !important;
    }
    
    /* Ensure proper scrolling behavior */
    .table-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .table-container::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }
    
    .table-container::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
    
    /* Mobile scroll hint */
    .mobile-scroll-hint {
        display: none !important;
    }
    
    .scroll-icon {
        font-weight: bold;
        margin-right: 5px;
    }
}

/* Hide mobile scroll hint on desktop */
@media screen and (min-width: 769px) {
    .mobile-scroll-hint {
        display: none;
    }
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.dashboard-title {
    font-size: 2.5em;
    color: #333;
    margin: 0;
    flex: 0 0 25%;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.dashboard-header .action-buttons {
    flex: 1 1 75%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    grid-auto-rows: minmax(48px, auto);
    gap: 12px;
}

.dashboard-header .action-buttons .btn,
.dashboard-header .action-buttons a.btn {
    width: 100%;
    text-align: center;
    white-space: nowrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

.tab-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.tab-buttons {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: #fff;
    color: #007bff;
    border-bottom: 3px solid #007bff;
}

.tab-button:hover {
    background: #e9ecef;
}

.tab-content {
    display: none;
    padding: 0;
}

.tab-content.active {
    display: block;
}

.api-stats {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.api-stats h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.api-table {
    width: 100%;
    border-collapse: collapse;
}

.api-table th,
.api-table td {
    padding: 10px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.api-table th {
    background: #e9ecef;
    font-weight: bold;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
    min-width: 150px;
}

.data-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

/* Specific column widths for admin tables */
.data-table th:nth-child(1), 
.data-table td:nth-child(1) { 
    width: 20%; 
} /* Name */

.data-table th:nth-child(2), 
.data-table td:nth-child(2) { 
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
} /* ID */

.data-table th:nth-child(3), 
.data-table td:nth-child(3) { 
    width: 20%; 
} /* Username */

.data-table th:nth-child(4), 
.data-table td:nth-child(4) { 
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
} /* Admin */

.data-table th:nth-child(5), 
.data-table td:nth-child(5) { 
    width: 10%; 
} /* Verified */

.data-table th:nth-child(6), 
.data-table td:nth-child(6) { 
    width: 12%; 
} /* Start Date */

.data-table th:nth-child(7), 
.data-table td:nth-child(7) { 
    width: 12%; 
} /* Last Login */

.data-table th:nth-child(8), 
.data-table td:nth-child(8) { 
    width: 8%; 
} /* Login Count */

.data-table th:nth-child(9), 
.data-table td:nth-child(9) { 
    width: 8%; 
} /* API Access */

.data-table th:nth-child(10), 
.data-table td:nth-child(10) { 
    width: 15%; 
} /* Subscription */

.data-table th:nth-child(11), 
.data-table td:nth-child(11) { 
    width: 10%; 
} /* Notes */

/* Admin table cell padding */
.admin-table-cell {
    padding: 8px 8px !important;
}

/* Subscribers table specific widths (different structure) */
#subscribersTable th:nth-child(1), 
#subscribersTable td:nth-child(1) { 
    width: 20%; 
} /* Name */

#subscribersTable th:nth-child(2), 
#subscribersTable td:nth-child(2) { 
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
} /* ID */

#subscribersTable th:nth-child(3), 
#subscribersTable td:nth-child(3) { 
    width: 25%; 
} /* Email */

#subscribersTable th:nth-child(4), 
#subscribersTable td:nth-child(4) { 
    width: 12%; 
} /* Status */

#subscribersTable th:nth-child(5), 
#subscribersTable td:nth-child(5) { 
    width: 15%; 
} /* Plan */

#subscribersTable th:nth-child(6), 
#subscribersTable td:nth-child(6) { 
    width: 15%; 
} /* Start Date */

#subscribersTable th:nth-child(7), 
#subscribersTable td:nth-child(7) { 
    width: 15%; 
} /* End Date */

#subscribersTable th:nth-child(8), 
#subscribersTable td:nth-child(8) { 
    width: 20%; 
} /* Customer ID */

#subscribersTable th:nth-child(9), 
#subscribersTable td:nth-child(9) { 
    width: 20%; 
} /* Actions */


.search-filter {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-filter input,
.search-filter select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-filter input[type="text"] {
    width: 300px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-canceled {
    background: #f8d7da;
    color: #721c24;
}

.status-past_due {
    background: #fff3cd;
    color: #856404;
}

.status-inactive {
    background: #e2e3e5;
    color: #6c757d;
}

.action-buttons-small {
    display: flex;
    gap: 5px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.sync-btn {
    background: #17a2b8;
    color: white;
}

.comp-btn {
    background: #28a745;
    color: white;
}

.remove-comp-btn {
    background: #dc3545;
    color: white;
}

.note-btn {
    background: #6c757d;
    color: white;
}

.note-btn.has-note {
    background: #28a745;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}

.close-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    float: right;
}

.modal-username {
    margin: 10px 0;
    color: #333;
}

.modal-note-content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 10px 0;
    white-space: pre-wrap;
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}


/* General Button Style - Eye-catching buttons (used for Analyze Results, Open Symbols, etc.) */
.general-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  transition: transform .2s;
  text-align: center;
}

.general-button:hover {
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
}

/* Size variants */
.general-button.small { padding: 8px 16px; font-size: 14px; }
.general-button.large { padding: 16px 40px; font-size: 18px; }

/* Color variants */
.general-button.primary { background: linear-gradient(135deg, #667eea, #764ba2); }
.general-button.info    { background: linear-gradient(135deg, #007bff, #0056b3); }
.general-button.success { background: linear-gradient(135deg, #28a745, #20c997); }
.general-button.warning { background: linear-gradient(135deg, #ffc107, #e0a800); color:#212529; }
.general-button.danger  { background: linear-gradient(135deg, #dc3545, #c82333); }
.general-button.secondary { background: linear-gradient(135deg, #6c757d, #545b62); }


/* ========================================================================== */
/* DARK THEME - Applied when html[data-theme="dark"] is set */
/* ========================================================================== */

[data-theme="dark"] {
    color-scheme: dark;
}

/* Base elements */
[data-theme="dark"] body {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

/* Navigation */
[data-theme="dark"] .topnav {
    background-color: #2d2d2d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

[data-theme="dark"] .topnav a,
[data-theme="dark"] .nav-menu a {
    color: #e0e0e0;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .topnav a:hover,
[data-theme="dark"] .nav-menu a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
}

[data-theme="dark"] .brand-link {
    color: #e0e0e0;
}

[data-theme="dark"] .brand-link:hover {
    color: #667eea;
}

/* Sections and containers */
[data-theme="dark"] .section-default {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

[data-theme="dark"] .wrapper-main {
    background-color: #1a1a1a;
}

/* White background containers */
[data-theme="dark"] .ultra-compact-scanner,
[data-theme="dark"] .scanner-container,
[data-theme="dark"] .results-container,
[data-theme="dark"] .card,
[data-theme="dark"] .panel {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .admin-log-card {
    background-color: #2d2d2d;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

[data-theme="dark"] .admin-log-table th {
    background-color: #333333;
    color: #f0f0f0;
}

[data-theme="dark"] .admin-log-table td {
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .log-details-list {
    color: #d0d0d0;
}

/* Forms and inputs */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #333333;
    color: #e0e0e0;
    border-color: #555555;
}

[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] input[type="password"]:focus,
[data-theme="dark"] input[type="number"]:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
    border-color: #667eea;
    background-color: #3a3a3a;
}

[data-theme="dark"] input[type="text"]::placeholder,
[data-theme="dark"] input[type="email"]::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #999999;
}

/* Disabled inputs */
[data-theme="dark"] .detail-input:disabled,
[data-theme="dark"] input:disabled,
[data-theme="dark"] select:disabled {
    background-color: #252525;
    color: #666;
    border-color: #404040;
}

/* Tables */
[data-theme="dark"] table {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

[data-theme="dark"] th {
    background-color: #333333;
    color: #e0e0e0;
    border-color: #555555;
}

[data-theme="dark"] td {
    border-color: #404040;
    color: #e0e0e0;
}

[data-theme="dark"] tr:hover {
    background-color: #3a3a3a !important;
}

[data-theme="dark"] tr:nth-child(even) {
    background-color: #282828;
}

/* Buttons */
[data-theme="dark"] .btn {
    background-color: #404040;
    color: #e0e0e0;
    border-color: #555555;
}

[data-theme="dark"] .btn:hover {
    background-color: #4a4a4a;
    border-color: #667eea;
}

/* Keep primary button colors vibrant in dark mode */
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
}

/* Labels and text */
[data-theme="dark"] label {
    color: #e0e0e0;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #f0f0f0;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div {
    color: inherit;
}

/* Borders and dividers */
[data-theme="dark"] hr {
    border-color: #404040;
}

/* Checkboxes and radios */
[data-theme="dark"] input[type="checkbox"],
[data-theme="dark"] input[type="radio"] {
    filter: invert(1) hue-rotate(180deg);
}

/* Links */
[data-theme="dark"] a {
    color: #7B9EFF;
}

[data-theme="dark"] a:hover {
    color: #9BB4FF;
}

/* Modals and overlays */
[data-theme="dark"] .modal,
[data-theme="dark"] [id*="Modal"] > div {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

/* Box shadows */
[data-theme="dark"] .ultra-compact-scanner,
[data-theme="dark"] .card,
[data-theme="dark"] .panel {
    box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
}

/* Specific element overrides */
[data-theme="dark"] .scanner-grid label {
    color: #b0b0b0;
}

[data-theme="dark"] .filter-group-header {
    color: #d0d0d0;
}

/* Grid items and tiles */
[data-theme="dark"] #grid > div {
    border-color: #404040 !important;
}

/* Keep heat map colors as-is (they're already colorful) */
/* Green/red stock movements stay the same for visibility */

/* Logout container */
[data-theme="dark"] .logout-container {
    background-color: #404040;
}

[data-theme="dark"] .logout-link {
    color: #e0e0e0;
}

[data-theme="dark"] .logout-link:hover {
    background-color: #4a4a4a;
}

/* Loading overlays */
[data-theme="dark"] #loading-overlay,
[data-theme="dark"] [id*="overlay"] {
    background-color: rgba(26, 26, 26, 0.9) !important;
    color: #e0e0e0 !important;
}

/* Pagination */
[data-theme="dark"] button {
    background-color: #404040;
    color: #e0e0e0;
    border-color: #555555;
}

[data-theme="dark"] button:hover:not(:disabled) {
    background-color: #4a4a4a;
}

[data-theme="dark"] button:disabled {
    background-color: #2a2a2a;
    color: #666;
}

/* Context menus */
[data-theme="dark"] #ctxMenu {
    background-color: #2d2d2d !important;
    border-color: #404040 !important;
}

[data-theme="dark"] #ctxMenu button {
    background-color: #2d2d2d !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] #ctxMenu button:hover {
    background-color: #3a3a3a !important;
}

/* Hamburger menu */
[data-theme="dark"] .hamburger span {
    background-color: #e0e0e0;
}

/* Mobile navigation */
[data-theme="dark"] .nav-menu {
    background-color: #2d2d2d;
}


/* Keep Update Run button text black in dark mode (yellow background needs dark text) */
[data-theme="dark"] .update-run-btn,
[data-theme="dark"] button[name="update_scan"] {
    color: #000 !important;
}

/* My Symbols page - make last and net prices more visible in dark mode */
[data-theme="dark"] td.last {
    color: #e0e0e0 !important;
}

/* Override inline color styles for net prices in dark mode */
[data-theme="dark"] td.net[style*="#0b7d2b"] {
    color: #4ade80 !important; /* Brighter green for dark mode */
}

[data-theme="dark"] td.net[style*="#8b0000"] {
    color: #ff6b6b !important; /* Brighter red for dark mode */
}

[data-theme="dark"] td.net[style*="#333"] {
    color: #b0b0b0 !important; /* Light gray instead of dark gray */
}

