* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: #f0f2f5;
  color: #2c3e50;
  line-height: 1.6;
}

/* ============ NAVBAR ============ */
.navbar {
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
  color: white;
  padding: 1.2rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.nav-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  white-space: nowrap;
  color: #ecf0f1;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-btn {
  background: #ecf0f1;
  color: #2c3e50;
  border: 1px solid #d5dbdb;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.25s ease;
  text-transform: capitalize;
}

.nav-btn:hover {
  background: #d5dbdb;
  border-color: #bdc3c7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
  background: #3498db;
  border-color: #3498db;
  color: white;
  font-weight: 600;
}

#logout-btn {
  background: rgba(231, 76, 60, 0.15);
  color: #ecf0f1;
  border: 1px solid rgba(231, 76, 60, 0.3);
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.25s ease;
  margin-left: auto;
}

#logout-btn:hover {
  background: rgba(231, 76, 60, 0.25);
  border-color: rgba(231, 76, 60, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ============ PAGE NAVIGATION ============ */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* ============ MAIN CONTAINER ============ */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 1rem;
  background: white;
  min-height: calc(100vh - 80px);
}

h1 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  border-bottom: 2px solid #ecf0f1;
  padding-bottom: 0.8rem;
  display: inline-block;
}

h2 {
  color: #34495e;
  font-size: 1.05rem;
  margin: 2rem 0 1rem 0;
  font-weight: 600;
}

.subtitle {
  color: #7f8c8d;
  font-size: 0.85rem;
  margin: -1rem 0 1.5rem 0;
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid #ecf0f1;
  margin: 2rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

th {
  background: #34495e;
  color: #ecf0f1;
  padding: 0.75rem 0.6rem;
  text-align: left;
  font-weight: 600;
  border: none;
  white-space: nowrap;
  font-size: 0.75rem;
  letter-spacing: 0.3px;
}

td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #ecf0f1;
  background: white;
}

tr:hover td {
  background: #f8f9fa;
}

td input,
td select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #d5dbdb;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: inherit;
  transition: all 0.2s ease;
  color: #2c3e50;
}

td input:hover,
td select:hover {
  border-color: #bdc3c7;
}

td input:focus,
td select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
  background: #f8f9fa;
}

td input[type="number"] {
  width: 100px;
}

td input[type="text"],
td input[type="date"],
td input[type="datetime-local"] {
  min-width: 120px;
}


/* ============ INFO SECTIONS ============ */
.info-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 6px;
  margin-bottom: 1.2rem;
  border-left: 4px solid #3498db;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.info-section:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.info-section h2 {
  margin-top: 0;
  color: #2c3e50;
  margin-bottom: 0.6rem;
  font-size: 1.05rem;
}

.info-section p {
  color: #555;
  line-height: 1.5;
  margin: 0.6rem 0;
  font-size: 0.85rem;
}

.info-section button {
  margin-top: 0.8rem;
  font-weight: 600;
}

/* ============ CONTROLS ============ */
.controls {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-group label {
  font-weight: 600;
  color: #34495e;
  font-size: 0.8rem;
}

select,
input[type="date"],
input[type="datetime-local"],
input[type="text"],
input[type="number"] {
  padding: 0.5rem 0.7rem;
  border: 1px solid #d5dbdb;
  border-radius: 5px;
  font-size: 0.8rem;
  background: white;
  transition: all 0.2s ease;
  font-family: inherit;
  color: #2c3e50;
}

select:hover,
input:hover {
  border-color: #bdc3c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

select:focus,
input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
  background: #f8f9fa;
}

.symbol-controls {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.add-symbol-btn {
  background: #3498db;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.add-symbol-btn:hover {
  background: #2980b9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.add-symbol-btn:active {
  transform: translateY(1px);
}

/* ============ TABLE WRAPPER ============ */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* ============ TABLES ============ */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th {
  background: #34495e;
  color: #ecf0f1;
  padding: 0.9rem 0.8rem;
  text-align: left;
  font-weight: 600;
  border: none;
  white-space: nowrap;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
}

td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid #ecf0f1;
  background: white;
}

tr:hover td {
  background: #f8f9fa;
}

td input,
td select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid #d5dbdb;
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s ease;
  color: #2c3e50;
}

td input:hover,
td select:hover {
  border-color: #bdc3c7;
}

td input:focus,
td select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
  background: #f8f9fa;
}

td input[type="number"] {
  width: 120px;
}

td input[type="text"],
td input[type="date"],
td input[type="datetime-local"] {
  min-width: 150px;
}

/* ============ BUTTONS ============ */
.delete-btn {
  background: white;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  min-width: 35px;
}

.delete-btn:hover {
  background: #e74c3c;
  color: white;
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.25);
}

.add-btn {
  background: #27ae60;
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 1rem;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.add-btn:hover {
  background: #229954;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.add-btn:active {
  transform: translateY(1px);
}


/* ============ SAVE SECTION ============ */
.save-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: #f8f9fa;
  padding: 1.2rem;
  border-radius: 6px;
  border-left: 4px solid #3498db;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: #2c3e50;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3498db;
}

.save-btn {
  background: #3498db;
  color: white;
  border: none;
  padding: 0.6rem 1.4rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.save-btn:hover:not(:disabled) {
  background: #2980b9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.save-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.save-btn:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}

/* ============ MESSAGES ============ */
.message {
  padding: 0.7rem 0.9rem;
  border-radius: 5px;
  font-weight: 600;
  font-size: 0.8rem;
  background: #d5f4e6;
  color: #27ae60;
  border-left: 4px solid #27ae60;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  animation: slideIn 0.25s ease;
}

.message.error {
  background: #fadbd8;
  color: #c0392b;
  border-left-color: #e74c3c;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============ EXPORT SECTION ============ */
.export-section {
  margin-top: 2rem;
  padding: 1.2rem;
  background: #f8f9fa;
  border-radius: 6px;
}

.export-section h2 {
  margin-top: 0;
  color: #2c3e50;
  font-size: 1rem;
}

.export-btn {
  background: #95a5a6;
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.export-btn:hover {
  background: #7f8c8d;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.export-btn:active {
  transform: translateY(1px);
}

.import-file-input {
  display: none;
}

/* ============ MODALS ============ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.25s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  padding: 1.8rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  min-width: 380px;
  animation: slideUp 0.25s ease;
}

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

.modal-header {
  margin-bottom: 1.2rem;
}

.modal-header h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.1rem;
}

.modal-body {
  margin-bottom: 1.2rem;
}

.modal-body input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid #d5dbdb;
  border-radius: 5px;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.2s ease;
  color: #2c3e50;
}

.modal-body input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
  background: #f8f9fa;
}

.modal-footer {
  display: flex;
  gap: 0.8rem;
  justify-content: flex-end;
}

.modal-footer button {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.25s ease;
}

.cancel-btn {
  background: #95a5a6;
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.cancel-btn:hover {
  background: #7f8c8d;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.confirm-btn {
  background: #3498db;
  color: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.confirm-btn:hover {
  background: #2980b9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
/* ============ RESPONSIVE DESIGN ============ */
@media (max-width: 1024px) {
  .nav-container {
    gap: 1rem;
  }

  .nav-title {
    font-size: 1.1rem;
  }

  .container {
    padding: 1.2rem 0.8rem;
  }

  h1 {
    font-size: 1.3rem;
  }
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 0.8rem;
    padding: 0 1rem;
  }

  .nav-title {
    font-size: 1rem;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
  }

  #logout-btn {
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .container {
    padding: 0.8rem;
  }

  h1 {
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
  }

  h2 {
    font-size: 0.9rem;
  }

  .controls {
    flex-direction: column;
    gap: 0.8rem;
  }

  .control-group {
    width: 100%;
  }

  .symbol-controls {
    flex-direction: column;
    width: 100%;
  }

  .add-symbol-btn {
    width: 100%;
  }

  table {
    font-size: 0.7rem;
  }

  th {
    padding: 0.5rem 0.4rem;
    font-size: 0.65rem;
  }

  td {
    padding: 0.4rem 0.3rem;
  }

  td input,
  td select {
    padding: 0.3rem 0.3rem;
    font-size: 0.7rem;
  }

  td input[type="number"] {
    width: 70px;
  }

  .delete-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.65rem;
  }

  .add-btn {
    width: 100%;
    padding: 0.55rem 1rem;
    font-size: 0.75rem;
  }

  .save-section {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
  }

  .checkbox-label {
    width: 100%;
    font-size: 0.75rem;
  }

  .save-btn {
    width: 100%;
    font-size: 0.75rem;
  }

  .export-btn {
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    padding: 0.5rem 0.8rem;
  }

  .info-section {
    padding: 1rem;
  }

  .modal-content {
    min-width: 90%;
    max-width: 100%;
    padding: 1.2rem;
  }

  .modal-footer {
    flex-direction: column;
  }

  .modal-footer button {
    width: 100%;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .nav-title {
    font-size: 0.9rem;
  }

  .nav-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.65rem;
  }

  h1 {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
  }

  h2 {
    font-size: 0.8rem;
  }

  .subtitle {
    font-size: 0.7rem;
  }

  .container {
    padding: 0.5rem;
  }

  table {
    font-size: 0.65rem;
  }

  th {
    padding: 0.4rem 0.25rem;
    font-size: 0.6rem;
  }

  td {
    padding: 0.25rem 0.2rem;
  }

  td input,
  td select {
    padding: 0.2rem 0.25rem;
    font-size: 0.65rem;
  }

  .controls {
    gap: 0.6rem;
  }

  .save-section {
    padding: 0.8rem;
  }

  .info-section {
    padding: 0.8rem;
  }
}

/* ============ TRENDLINES PAGE INPUT WIDTHS ============ */
#trendlinesPage table {
  font-size: 0.7rem;
}

#trendlinesPage td input[type="text"],
#trendlinesPage td input[type="datetime-local"] {
  min-width: 50px;
  width: 100%;
}

#trendlinesPage td input[type="number"] {
  min-width: 60px;
  width: 100%;
}

/* ============ KEY LEVELS PAGE INPUT WIDTHS ============ */
#levelsPage table {
  font-size: 0.7rem;
}

#levelsPage td input[type="text"],
#levelsPage td input[type="date"] {
  min-width: 50px;
  width: 100%;
}

#levelsPage td input[type="number"] {
  min-width: 60px;
  width: 100%;
}

/* ============ UPTIME MONITOR STYLES ============ */

.uptime-stats-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.uptime-card {
  background: white;
  border: 1px solid #ecf0f1;
  border-left: 4px solid #27ae60;
  border-radius: 6px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.25s ease;
}

.uptime-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.uptime-card h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #2c3e50;
}

/* ============ ANIMATIONS ============ */

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============ STATUS INDICATORS ============ */

.status-online {
  color: #27ae60;
}

.status-offline {
  color: #e74c3c;
}

.uptime-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.uptime-badge.online {
  background: #d5f4e6;
  color: #27ae60;
}

.uptime-badge.offline {
  background: #fadbd8;
  color: #c0392b;
}

/* ============ RESPONSIVE UPTIME ============ */

@media (max-width: 768px) {
  .uptime-card {
    padding: 1rem;
  }

  .uptime-card h3 {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  .uptime-card {
    padding: 0.8rem;
  }

  .uptime-card h3 {
    font-size: 0.85rem;
  }
}


/*
#settingsPage td input[type="text"] {
  resize: horizontal;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#settingsPage td input[type="text"]:hover {
  border-color: #3498db;
}

#settingsPage td input[type="text"]:focus {
  border-color: #3498db;
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}
*/