/* ========== LOGIN PAGE THEME ========== */
body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Nunito Sans', 'Montserrat', Arial, sans-serif;
  background: linear-gradient(120deg, #153967 0%, #164175 60%, #19c1f3 100%);
  min-height: 100vh;
}
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: rgba(28, 44, 78, 0.96);
  border-radius: 24px;
  padding: 48px 40px 36px 40px;
  box-shadow: 0 6px 44px #0e1c3470;
  min-width: 320px;
  max-width: 94vw;
  width: 370px;
  text-align: center;
  animation: fadeIn .7s;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.logo {
  width: 62px;
  margin-bottom: 18px;
  border-radius: 10px;
  box-shadow: 0 1px 8px #12d2fa2a;
}
.login-card h2 {
  color: #22d0ff;
  font-size: 2.1rem;
  margin-bottom: 24px;
  letter-spacing: 1px;
  font-weight: 700;
}
.login-card input {
  width: 100%;
  margin-bottom: 16px;
  padding: 13px 14px;
  border-radius: 9px;
  border: none;
  background: #e9f5fe;
  color: #1a294b;
  font-size: 1.12rem;
  font-weight: 500;
  box-shadow: 0 1px 5px #14defa0a;
  transition: border .17s, box-shadow .17s;
  outline: none;
}
.login-card input:focus {
  border: 2.2px solid #17d3ff;
  background: #f3fbff;
}
.btn-primary {
  width: 100%;
  background: linear-gradient(90deg, #17d3ff 0%, #2297e0 100%);
  color: #fff;
  border: none;
  border-radius: 11px;
  padding: 13px 0;
  font-size: 1.12rem;
  font-weight: bold;
  box-shadow: 0 2px 10px #2297e03d;
  transition: background .17s, transform .11s, box-shadow .12s;
  cursor: pointer;
  margin-bottom: 7px;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(90deg, #1db7f0 30%, #133d6e 100%);
  transform: scale(1.018) translateY(-2px);
  box-shadow: 0 4px 16px #17d3ff38;
}
.login-msg {
  min-height: 22px;
  margin-top: 7px;
  font-size: 1.02rem;
  text-align: center;
  letter-spacing: .15px;
  transition: color .2s;
  color: #ffd800;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 550px) {
  .login-card {
    padding: 24px 6vw 20px 6vw;
    width: 99vw;
    min-width: 0;
    border-radius: 13px;
  }
  .logo { width: 42px; }
  .login-card h2 { font-size: 1.2rem; }
}

/* ========== END OF LOGIN PAGE THEME ========== */

/* ========== GLOBAL DASHBOARD/BROKER THEME ========== */
body {
  font-family: 'Segoe UI', 'Montserrat', Arial, sans-serif;
  background: #153259;
  color: #fff;
}
.dashboard-bg {
  min-height: 100vh;
  background: #153259;
}
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #153259;
  border-bottom: 2px solid #0ff2ff26;
  padding: 22px 34px 20px 24px;
  border-radius: 0 0 20px 20px;
  margin-bottom: 40px;
}
.logo-text {
  font-size: 2.45rem;
  font-weight: bold;
  letter-spacing: 1.2px;
  color: #fff;
}
.main-nav {
  display: flex;
  gap: 36px;
  align-items: center;
}
.nav-link {
  color: #fff;
  font-size: 1.26rem;
  font-weight: 600;
  text-decoration: none;
  padding-bottom: 2px;
  transition: color .2s;
  border-bottom: 2.5px solid transparent;
}
.nav-link.active,
.nav-link:hover {
  color: #25e2fc;
  border-bottom: 2.5px solid #25e2fc;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 25px;
}
.profile-link {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c7e8ff;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.profile-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #24466e;
  object-fit: cover;
}
.logout-btn {
  background: #fe256b;
  color: #fff;
  border: none;
  padding: 10px 28px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 1.08rem;
  cursor: pointer;
  transition: background 0.18s;
}
.logout-btn:hover { background: #fa1461; }

.profile-dropdown {
  position: absolute;
  top: 48px; right: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px #11336422;
  min-width: 170px;
  padding: 0.4rem 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.profile-dropdown a {
  color: #16305c;
  padding: 0.7rem 1.1rem;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.18s;
}
.profile-dropdown a:hover {
  background: #f4f7fb;
}

/* ========== MAIN LAYOUT ========== */
.dashboard-main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 80vh;
}
.main-grid {
  display: flex;
  flex-direction: row;
  gap: 48px;
  width: 100%;
  max-width: 1400px;
  margin-top: 30px;
}
.dashboard-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 36px;
}
.dash-card {
  background: #183963;
  border-radius: 26px;
  padding: 36px 34px 34px 34px;
  min-width: 270px;
  min-height: 165px;
  text-align: center;
  box-shadow: 0 2px 24px #001a364a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.dash-label {
  color: #fff;
  font-size: 1.65rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: .5px;
}
.dash-value {
  font-size: 2.6rem;
  font-weight: bold;
  background: #e8f4fd;
  color: #15345a;
  padding: 17px 0;
  border-radius: 16px;
  min-width: 120px;
  border: 4px solid #12e8ff;
  margin: 0 auto;
  box-shadow: 0 1.5px 8px #12e8ff2a;
  letter-spacing: 2px;
}

/* ========== NOTIFICATION BOX (Modern Card Style) ========== */
.notification-box {
  background: #17335c;
  border-radius: 32px;
  min-width: 440px;
  min-height: 410px;
  margin-left: 34px;
  box-shadow: 0 3px 24px #1d354a24;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;
  padding: 30px 30px 30px 30px;
  position: relative;
  overflow: visible;
}
.notif-title {
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  margin: 0 0 30px 0;
  text-align: center;
  width: 100%;
}
.notification-msg {
  background: #f8faff;
  color: #1b263b;
  font-size: 1.11rem;
  border-radius: 18px;
  box-shadow: 0 4px 18px #17d3ff14;
  padding: 19px 28px 16px 25px;
  margin-bottom: 16px;
  margin-right: 6px;
  border-left: 5px solid #22d0ff;
  min-width: 320px;
  max-width: 380px;
  text-align: left;
  position: relative;
  opacity: 0;
  animation: notifFadeIn .35s cubic-bezier(.2,1.5,.5,1.07) forwards;
  transition: box-shadow 0.19s, transform 0.13s, background .15s, opacity .21s;
  cursor: pointer;
}
.notification-msg:hover {
  background: #e6f4ff;
  box-shadow: 0 8px 32px #22d0ff19, 0 0px 0 #fff;
  transform: translateY(-3px) scale(1.03);
}
@keyframes notifFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(.98);}
  to   { opacity: 1; transform: translateY(0) scale(1);}
}
.notification-msg b {
  color: #183963;
  font-size: 1.09em;
  font-weight: bold;
  letter-spacing: .2px;
}
.notification-msg span {
  color: #2c435f;
  font-weight: 500;
  display: block;
  margin-top: 5px;
  font-size: 1em;
}

/* ========== BROKER PAGE TABLE ========== */
#brokers-section {
  margin: 36px auto 0 auto;
  max-width: 1380px;
  padding: 24px 24px 48px 24px;
  background: none;
}
.broker-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  color: #fff;
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.5px;
}
.btn-add-broker {
  background: none;
  border: 2.5px solid #30bbff;
  color: #30bbff;
  font-weight: bold;
  font-size: 1.37rem;
  border-radius: 8px;
  padding: 16px 36px;
  cursor: pointer;
  transition: background .15s, color .13s;
}
.btn-add-broker:hover {
  background: #30bbff22;
  color: #fff;
}
.broker-table-wrap {
  margin-top: 14px;
  border-radius: 18px;
  overflow-x: auto;
  background: #122b4a;
  box-shadow: 0 2px 20px #1d436055;
}
.broker-table {
  width: 100%;
  min-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  table-layout: fixed;
}
.broker-table th, .broker-table td {
  text-align: center !important;
  vertical-align: middle !important;
  padding: 16px 14px;
  font-size: 1.13rem;
  color: #f5faff;
  overflow: hidden;
  white-space: nowrap;
}
.broker-table th {
  background: #193f6b;
  color: #fff;
  font-weight: 700;
  border-bottom: 2px solid #30bbff44;
  height: 62px;
}
.broker-table td {
  border-bottom: 1.5px solid #24beff1a;
  background: none;
  height: 76px;
}
.broker-table td:last-child,
.broker-table th:last-child {
  text-align: center !important;
  width: 180px;
  min-width: 130px;
  max-width: 220px;
}
.broker-table td .btn-toggle,
.broker-table td button {
  margin: 0 auto;
  display: inline-block;
}
.status-active {
  color: #28cc6d;
  font-weight: 700;
}
.status-inactive {
  color: #f94a42;
  font-weight: 700;
}
.btn-edit, .btn-deactivate {
  font-size: 1.13rem;
  font-weight: 600;
  border-radius: 6px;
  border: 2px solid #2ea7ff;
  background: none;
  margin-right: 12px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background .15s, color .13s, border .12s;
}
.btn-edit {
  font-size: 1rem;            /* ↓ Smaller text */
  padding: 3px 4px;          /* ↓ Less padding */
  color: #2ea7ff;
  border-color: #2ea7ff;
  border-radius: 5px;
  margin-right: 0;            /* Less space to the right */
}

.btn-edit:hover {
  background: #2ea7ff44;
  color: #fff;
  border-color: #2ea7ff;
}
.btn-deactivate {
  color: #1eb54d;
  border-color: #1eb54d;
}
.btn-deactivate:hover {
  background: #1eb54d44;
  color: #fff;
  border-color: #1eb54d;
}
.btn-toggle {
  min-width: 88px;
  max-width: 140px;
  display: inline-block;
  text-align: center;
  margin: 0 auto;
  padding: 10px 0;
  font-size: 1.07em;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  transition: background 0.18s;
  cursor: pointer;
}
.btn-toggle.active { background: #e74c3c;}
.btn-toggle.inactive { background: #3ad07d;}

/* ========== MODAL, PROFILE, ETC ========== */
.hidden { display: none !important; }
.modal-box label { color: #153259 !important; font-weight: 600; }
.profile-form label { color: #222e47 !important; font-weight: 700; font-size: 1.1rem; margin-bottom: 5px; display: block; }
.profile-form input[type="password"] {
  border: 2px solid #4978f5; color: #111; background: #f6f8fc;
  border-radius: 8px; padding: 11px 13px; margin-bottom: 20px; font-size: 1rem;
}
.profile-form input[type="password"]:focus { border-color: #1661e9; background: #fff; outline: none; }
.profile-form button[type="submit"] {
  background: #16b672; color: #fff; font-weight: bold; border: none; border-radius: 8px;
  padding: 12px 0; width: 100%; font-size: 1.09rem; margin-top: 8px; cursor: pointer;
  transition: background 0.18s;
}
.profile-form button[type="submit"]:hover { background: #118c57; }
.profile-form {
  background: #1487f3;
  box-shadow: 0 4px 24px #11336414;
  padding: 30px 28px 16px 28px;
  border-radius: 14px;
  max-width: 390px;
  margin: 34px auto;
}
.profile-form label { color: #222 !important; font-weight: 600; font-size: 1.2rem; }

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1150px) {
  .main-grid { flex-direction: column; align-items: center; gap: 34px;}
  .notification-box { margin-left: 0; min-width: 340px; min-height: 220px; }
}
@media (max-width: 900px) {
  .dashboard-cards { min-width: 0; grid-template-columns: 1fr; grid-template-rows: none; gap: 26px; }
  .dash-card { min-width: 180px; padding: 22px 11px; }
  .notification-box { min-width: 220px; padding: 18px 5px; }
  .broker-table th, .broker-table td { font-size: .98rem; padding: 13px 5px; white-space: normal !important; }
}
@media (max-width: 700px) {
  .broker-table { min-width: 100vw; font-size: 0.95em; }
}
@media (max-width: 600px) {
  .dashboard-header { flex-direction: column; gap: 18px; padding: 18px 4vw;}
  .main-grid { flex-direction: column; gap: 15px;}
  .dashboard-cards { grid-template-columns: 1fr; }
  .notification-box { min-width: 98vw; margin-left: 0; padding: 9px 4vw; }
  .notification-msg { min-width: 0; max-width: 98vw; }
}

.notification-msg {
  background: #fff;
  color: #16305c;
  border-radius: 16px;
  margin: 16px 0 0 0;
  padding: 19px 28px 17px 28px;
  min-width: 260px;
  max-width: 90vw;
  box-shadow: 0 2px 10px #15325914;
  font-size: 1.19rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: box-shadow .14s, background .18s;
  border-left: 6px solid #1be9fc;
  position: relative;
}
.notification-msg b {
  color: #143353;
  font-size: 1.18em;
}
.notification-msg span {
  color: #222;
  font-size: 1em;
}
.notification-info { border-left: 6px solid #1be9fc;}
.notification-success { border-left: 6px solid #28cc6d; }
.notification-error { border-left: 6px solid #f94a42; }
.notification-msg:hover {
  background: #f2faff;
  box-shadow: 0 4px 18px #1be9fc28;
}
.assigned-segments { margin: 18px 0 0 0; }
.segment-chip {
  display: inline-block;
  padding: 6px 18px;
  margin: 0 4px 4px 0;
  background: #223b5a;
  color: #fff;
  border-radius: 99px;
  font-size: 0.97em;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* === Notifications: fix card width + clamp text (END OF FILE) === */

/* Stack messages */
.notification-list{
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* Fix each card’s width inside the panel */
.notification-box .notification-msg{
  box-sizing:border-box;   /* include padding in width */
  width:460px;             /* fixed card width */
  max-width:100%;          /* stay responsive if panel is narrower */
  min-width:320px;         /* optional floor */
}

/* Subject: single line with ellipsis */
.notification-box .notification-msg b{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* Description: clamp to 3 lines and wrap long words */
.notification-box .notification-msg span{
  /* legacy WebKit clamp */
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;

  /* modern, unprefixed */
  line-clamp:3;

  overflow:hidden;
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
}

/* If the browser supports the standard property, use normal block layout */
@supports (line-clamp: 3){
  .notification-box .notification-msg span{ display:block; }
}

/* Timestamp helper (if you use a dedicated element) */
.notification-box .notification-msg .note-time{
  opacity:.7;
  font-size:.85em;
  margin-top:6px;
  white-space:nowrap;
}

/* Mobile: let card use full panel width */
@media (max-width:600px){
  .notification-box .notification-msg{
    width:100%;
    min-width:0;
  }
}

/* Center the "No notifications..." message in the panel */
.notification-box { position: relative; }

/* When the list only contains the empty-state, center it */
.notification-list:has(.notification-empty){
  flex: 1;                      /* fill the panel under the title */
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-empty{
  color: #fff;
  opacity: .9;
  text-align: center;
  max-width: 80%;
}

/* Fallback for browsers without :has() */
@supports not selector(.notification-list:has(.notification-empty)) {
  .notification-empty{
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    text-align: center;
  }
}

/* Center the empty-state exactly in the middle of the panel */
.notification-box { position: relative; }  /* ensure a positioning context */

.notification-box .notification-empty{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);     /* perfect center */
  width: calc(100% - 60px);             /* respect .notification-box 30px side padding */
  max-width: 100%;
  text-align: center;
  line-height: 1.35;
  margin: 0;
  padding: 0 16px;                       /* small breathing room */
  pointer-events: none;                  /* nothing to click */
}

.hidden { display: none !important; }

.header-avatar {
  width:32px; height:32px; border-radius:50%;
  display:grid; place-items:center; overflow:hidden;
  background:#e9eef7; color:#4067b7; font-weight:700;
  font-size:.85rem; border:2px solid #d9e2f2;
}
.header-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }

.profile-dropdown {
  position:absolute; right:0; top:calc(100% + 8px);
  background:#fff; border:1px solid #e5e7eb; border-radius:10px;
  box-shadow:0 10px 30px rgba(17,51,100,.15);
  min-width:180px; padding:8px 0; z-index:30;
}
.profile-dropdown a {
  display:block; padding:10px 14px; color:#0f172a; text-decoration:none;
}
.profile-dropdown a:hover { background:#f7fafc; }












.assigned-segments { margin: 40px auto 0 auto; max-width: 700px; background: #1e2942; padding: 36px 30px 28px 30px; border-radius: 20px; box-shadow: 0 8px 32px #11336415; text-align: left; }
    .assigned-segments h3 { margin: 0 0 18px 0; font-size: 1.3rem; color: #fff; letter-spacing: 0.04em; }
    .segment-chip { display: inline-block; padding: 5px 50px; margin: 0 7px 8px 0; background: #223b5a; color: #fff; border-radius: 20px; font-size: 1.08em; font-weight: 600; letter-spacing: 0.04em; box-shadow: 0 2px 10px #11224425; position: relative; }
    .edit-btn { background: none; color: #38e4c3; border: none; margin-left: 12px; cursor: pointer; font-size: 1em; font-weight: 700; padding: 0 4px; transition: color 0.2s; }
    .edit-btn:hover { color: #fff; }
    .modal-bg { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(17,28,52,0.82); z-index: 50; display: flex; align-items: center; justify-content: center; }
    .modal-content { background: #16223b; border-radius: 20px; padding: 36px 36px 30px 36px; box-shadow: 0 8px 44px #1af1e344; min-width: 540px; max-width: 840px; }
    .modal-content h2 { color: #38e4c3; margin-top: 0; }
    .form-row { display: flex; flex-wrap: wrap; gap: 22px 20px; margin-bottom: 12px; }
    .form-col { flex: 1 1 210px; min-width: 200px; display: flex; flex-direction: column; }
    .form-col label { color: #eee; font-weight: 600; margin-bottom: 5px; }
    .form-col input, .form-col select { background: #223050; color: #fff; border: 2px solid #38e4c3; border-radius: 9px; padding: 9px 14px; margin-bottom: 0; font-size: 1em; outline: none; transition: border 0.18s; }
    .form-col input:focus, .form-col select:focus { border-color: #46f; }
    .form-actions { display: flex; justify-content: flex-end; gap: 16px; margin-top: 20px; }
    .btn-save, .btn-cancel { font-size: 1em; padding: 8px 26px; border-radius: 8px; border: none; cursor: pointer; font-weight: 600; }
    .btn-save { background: #38e4c3; color: #122a33; }
    .btn-save:hover { background: #19b8ad; }
    .btn-cancel { background: #28344d; color: #eee; }
    .btn-cancel:hover { background: #1e263a; }
    .hidden { display: none !important; }
    #segmentFormMsg { min-height: 20px; font-size: 1.08em; margin-top: 6px; }

/* price under the chip label */
.segment-chip .chip-price {
  display: block;
  margin-top: 6px;
  font-weight: 700;
  color: #b9c8e2;
  transition: color .18s ease, transform .18s ease;
  line-height: 1.1;
}
.segment-chip .chip-price.up   { color: #19de82; }  /* green */
.segment-chip .chip-price.down { color: #ff5a5a; }  /* red   */



/* Compact height ONLY for the Stock Options chip (the one with no .chip-price) */
#segments-list .segment-chip:not(:has(.chip-price)) {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 70px;         /* shorter card */
  padding: 5px 30px;
  border-radius: 20px;  /* same corner style you liked */
  vertical-align: top;
}

/* Push Edit to the right on that single chip */
#segments-list .segment-chip:not(:has(.chip-price)) .edit-btn {
  margin-left: auto;
}

/* Remove the invisible spacer we previously added */
#segments-list .segment-chip:not(:has(.chip-price))::before {
  content: none;
  display: none;
}

/*///////////////////////////////////////
/* ===== Segment chip layout (stack: title → price → Edit) ===== */
.segment-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;                 /* spacing between title, price, Edit */
  text-align: center;
  vertical-align: top;      /* aligns chips nicely on the same row */
}

/* price line under the title */
.segment-chip .chip-price {
  display: block;
  margin: 0;                /* remove extra top margin so it centers perfectly */
  min-height: 1.2em;        /* keep height stable to avoid layout jumps */
  line-height: 1;
  font-weight: 700;
  color: #b9c8e2;
  font-variant-numeric: tabular-nums;  /* fixed-width digits */
  transition: color .18s ease, transform .18s ease;
}

.segment-chip .chip-price.up   { color: #19de82; }  /* green */
.segment-chip .chip-price.down { color: #ff5a5a; }  /* red */

/* make sure the Edit button isn't pushing things around */
.segment-chip .edit-btn {
  margin: 0;
}


/*//////////////////////////////////////

/* ----- FIX Stock Options alignment (override older rule) ----- */


/* remove the margin that was pushing Edit to the right */
#segments-list .segment-chip:not(:has(.chip-price)) .edit-btn {
  margin-left: 0 !important;
}

/* add an invisible “price row” so Edit lines up vertically */

/* Forgot password link — themed */
.forgot-link,
.forgot-link:visited {
  color: #8ecaf6;          /* default */
  text-decoration: none;
  font-weight: 600;
  transition: color .2s ease, text-shadow .2s ease;
}

.forgot-link:hover {
  color: #ffffff;          /* hover (your teal) */
  text-shadow: 0 0 10px #38e4c355;
}

.forgot-link:active {
  color: #ffffff;          /* pressed */
}

.forgot-link:focus-visible {
  outline: 2px solid #38e4c3;
  outline-offset: 2px;
  border-radius: 6px;
}

/* Back-link color inside the card */
.login-card .back-link,
.login-card .back-link:visited { 
  color: #8AD3FF;   /* pick your brand color */
}

.login-card .back-link:hover,
.login-card .back-link:active {
  color: #C9ECFF;
  text-decoration: underline;
}


/* =========================
   PHONE OVERRIDES (≤ 767px)
   ========================= */
@media (max-width: 767px) {
  :root { --gap: 12px; --pad: 14px; --radius: 16px; --tap: 44px; }

  /* General */
  html, body { overflow-x: hidden; }
  img, video, canvas, svg { max-width: 100%; height: auto; }
  .btn, .btn-primary, button { width: 100%; min-height: var(--tap); }

  /* ---------- Header / Nav ---------- */
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 14px 12px;
    margin-bottom: 18px;
    border-radius: 0 0 14px 14px;
  }
  .logo-text { font-size: 1.6rem; text-align: center; }
  .header-right { order: 2; justify-content: center; gap: 12px; }
  .logout-btn { padding: 10px 14px; font-size: 1rem; width: 100%; max-width: 220px; }
  .main-nav {
    order: 3;
    display: flex; flex-wrap: wrap; gap: 10px 14px;
    justify-content: center; padding: 6px 0 0;
  }
  .nav-link { font-size: 1rem; border-bottom-width: 2px; }

  /* ---------- Main layout ---------- */
  .dashboard-main { padding: 0 12px 20px; }
  .main-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-top: 10px;
    max-width: 100%;
  }

  /* ---------- Cards grid ---------- */
  .dashboard-cards {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }
  .dash-card {
    min-width: 0; min-height: 120px;
    padding: 18px 14px;
    border-radius: 18px;
  }
  .dash-label { font-size: 1.15rem; margin-bottom: 10px; }
  .dash-value { font-size: 1.7rem; padding: 10px 0; }

  /* ---------- Notifications panel ---------- */
  .notification-box {
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 14px;
    margin-left: 0;
    border-radius: 16px;
  }
  .notification-box .notif-title { font-size: 1.3rem; margin-bottom: 10px; }
  .notification-box .notification-msg {
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    padding: 12px 12px;
    font-size: 1rem;
    border-radius: 12px;
  }

  /* ---------- Brokers table ---------- */
  .broker-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .section-title { font-size: 1.6rem; text-align: center; }
  .btn-add-broker { width: 100%; padding: 12px 0; font-size: 1.05rem; }

  .broker-table-wrap {
    margin: 10px -12px 0;     /* edge-to-edge scroll container */
    padding: 0 12px;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .broker-table {
    min-width: 620px;          /* keep columns readable; horizontally scrolls */
    font-size: .95rem;
  }
  .broker-table th, .broker-table td { padding: 10px 8px; }

  /* ---------- Modals ---------- */
  .modal-content {
    width: calc(100vw - 24px) !important;
    max-width: none;
    min-width: 0;
    padding: 22px 16px;
    border-radius: 16px;
    max-height: 85vh;
    overflow: auto;
  }

  /* ---------- Profile form ---------- */
  .profile-form {
    max-width: none;
    width: calc(100% - 24px);
    margin: 16px auto;
    padding: 20px 16px;
    border-radius: 12px;
  }

  /* ---------- Assigned segments ---------- */
  .assigned-segments {
    max-width: none;
    width: calc(100% - 24px);
    margin: 16px auto 0;
    padding: 16px;
    border-radius: 14px;
  }
  .segment-chip {
    padding: 8px 14px;
    font-size: .98rem;
    border-radius: 14px;
  }

  /* ---------- Auth cards (login/forgot/reset) ---------- */
  .login-card {
    width: 100%;
    max-width: 100%;
    padding: 22px 16px 18px;
    border-radius: 14px;
  }
  .login-card h2 { font-size: 1.5rem; margin-bottom: 12px; }
  .login-card input { padding: 12px 12px; font-size: 1rem; }
  .forgot-wrap { margin: 6px 0 8px; }
  .forgot-link { font-size: .95rem; }
}


/* START: REJECT MODAL STYLES */
.reject-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.55);
  z-index: 9999;
}
.reject-modal-overlay.show { display: flex; }

.reject-modal-box {
  width: min(920px, 92vw);
  max-height: 85vh;
  background: #0e1b2b;           /* dark card that matches your theme */
  color: #e6eef9;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
}

.reject-modal-header,
.reject-modal-footer {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.reject-modal-footer { border-top: 1px solid rgba(255,255,255,.06); border-bottom: none; }

.reject-modal-body {
  padding: 12px 14px;
  overflow: auto;
}

.reject-modal-pre {
  white-space: pre-wrap;     /* wrap long JSON nicely */
  word-break: break-word;
  background: #fff4f4;
  color: #a00;
  border: 1px solid #f5b5b5;
  border-radius: 6px;
  padding: 10px;
  margin: 0;
  max-height: 60vh;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
}

/* Buttons */
.reject-modal-close,
.reject-modal-close-btn,
.view-reason-btn {
  cursor: pointer;
  border: 1px solid #ccc;
  background: #eee;
  color: #111;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.reject-modal-close {
  background: transparent;
  border: none;
  color: #9fb4d1;
  font-size: 16px;
  line-height: 1;
}
.reject-modal-close:hover { color: #fff; }
/* END: REJECT MODAL STYLES */

#angelFields, #dhanFields, #zerodhaFields, #growwFields { display: none; }

.signup-wrap, .forgot-wrap { text-align:center; margin-top:10px; }
.signup-link { color:#4caf50; text-decoration:none; font-weight:500; }
.signup-link:hover { text-decoration:underline; }

.signup-login-link {
  color: #00cfff;         /* bright cyan-blue */
  text-decoration: none;  /* remove underline */
  font-weight: 500;
}

.signup-login-link:hover {
  color: #ffffff;         /* turn white on hover */
  text-decoration: underline;
}

/* Apply same style to ALL auth inputs */
.login-card input[type="text"],
.login-card input[type="password"],
.login-card input[type="tel"],
.login-card input[type="email"] {
  width: 100%;
  height: 44px;            /* lock identical height */
  padding: 0 14px;         /* same horizontal padding */
  font-size: 1rem;
  border-radius: 6px;      /* same radius as others */
  border: none;
  box-sizing: border-box;
  -webkit-appearance: none; /* avoid Safari special email styling */
  appearance: none;
}


/* Password wrapper should not shrink the input */
.password-wrapper {
  position: relative;
  width: 100%;               /* match parent width */
}

/* Add right padding so text doesn't overlap the eye */
.password-wrapper input {
  padding-right: 44px;
}

/* Position the eye consistently */
.password-wrapper .toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em;
  line-height: 1;
  color: #333;
}

/* === Fix only the eye button inside password field === */
.password-wrapper {
  position: relative;
}

.password-wrapper input {
  width: 100%;             /* same width as other inputs */
  padding-right: 40px;     /* leave space for eye */
  box-sizing: border-box;  /* prevent shrinking */
}

.password-wrapper .toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.1em;
  background: none;
  border: none;
  line-height: 1;
}

/*=============================
/* --- Mobile: reliable sideways scroll for Orders table --- */
@media (max-width:700px) {
  /* The scroll container */
  .orders-table-wrap{
    overflow-x:auto;                /* enable horizontal scroll */
    overflow-y:visible;
    -webkit-overflow-scrolling:touch;  /* momentum on iOS */
    scrollbar-gutter: stable both-edges;
  }

  /* Make the table expand beyond the viewport if needed,
     but never shrink smaller than the screen width */
  .orders-table{
    width:max-content;   /* grow to fit columns */
    min-width:100%;      /* at least full screen width */
    border-collapse:separate;  /* avoids clipping with radius in some browsers */
  }

  /* Keep columns on one line so they don't wrap and increase row height */
  .orders-table th,
  .orders-table td{
    white-space:nowrap;
  }

  /* Optional: a tiny hint above the table */
  .orders-table-wrap::before{
    content:"Swipe to see more →";
    display:block;
    margin:6px 8px -4px auto;
    font-size:12px;
    color:#a9c3de;
  }
}


/* ===== Mobile-only: make Orders table swipe horizontally ===== */
@media (max-width:700px) {
  /* allow horizontal scrolling (override the earlier overflow:hidden) */
  .orders-table-wrap{
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  /* let the table grow to its natural full width (so there IS something to scroll) */
  .orders-table{
    width: max-content !important;   /* expand to fit all columns */
    min-width: 100% !important;      /* but never smaller than the screen */
    border-collapse: separate;       /* avoids odd clipping with rounded parents */
  }

  /* keep columns on one line; prevents wrapping that makes rows huge */
  .orders-table th,
  .orders-table td{
    white-space: nowrap !important;
  }

  /* optional hint */
  .orders-table-wrap::before{
    content:"Swipe to see more →";
    display:block;
    margin:6px 8px -4px auto;
    font-size:12px;
    color:#a9c3de;
  }
}


.trade-disclaimer {
  margin-top: 18px;
  padding: 12px 15px;
  background: #f0f5ff;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: #2979ff;
  font-weight: 500;
}

.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:focus {
  caret-color: #1a294b;              /* cursor color */
  transition: background-color 9999s ease-out, color 9999s ease-out;
  transition-delay: 9999s;           /* prevents flash on page load */
}

/* ---- Account Status Popup ---- */
.status-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}
.status-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.status-box {
  position: relative;
  z-index: 1;
  background: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
  width: 340px;
}
.status-box h2 {
  color: #c23b22;
  font-size: 22px;
  margin-bottom: 10px;
}
.status-box p {
  color: #333;
  font-size: 15px;
  line-height: 1.4;
}


#notif-bell {
  position: relative;
  display: inline-block;
  margin-right: 20px;
  cursor: pointer;
  color: #fff;
}
#notif-bell i { font-size: 20px; }
#notif-count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: #ff4444;
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  padding: 2px 5px;
}
#notif-popup {
  position: absolute;
  top: 60px;
  right: 20px;
  width: 320px;
  background: #0b1e3b;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  padding: 12px 15px;
  z-index: 9999;
  backdrop-filter: blur(6px);
  transform: translateY(-10px);
  opacity: 0;
  transition: all 0.3s ease;
}
#notif-popup:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
}
#notif-popup.hidden { display: none; }
#notif-popup h4 {
  margin: 0 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 6px;
}
#notif-list { max-height: 250px; overflow-y: auto; }
.notif-item {
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
}
.notif-item strong {
  display: block;
  color: #00c3ff;
  font-size: 14px;
}
.notif-item p { font-size: 13px; color: #ccc; margin: 4px 0; }
.notif-item small { font-size: 11px; color: #aaa; }
.no-notif { text-align: center; color: #aaa; font-size: 13px; }


/* ========== News STYLES ========== */
/* === Market News Section === */
.news-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 6px;
}

.news-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.2s ease;
}

.news-card:hover {
  transform: scale(1.02);
}

.news-title {
  color: #0066cc;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}

.news-title:hover {
  text-decoration: underline;
}

.news-meta {
  font-size: 12px;
  color: #777;
}


/* ====== Live Market Chart Launcher + Modal (TradingView embed, no blur) ====== */
/* small styles scoped to chart launcher */
.chart-launcher { margin-top:20px; display:flex; gap:12px; align-items:center; }
.chart-card {
  background: linear-gradient(180deg,#0f2a44,#0b2238);
  border-radius:12px;
  padding:12px 16px;
  width:220px;
  color:#fff;
  cursor:pointer;
  font-weight:700;
  display:flex;
  gap:10px;
  align-items:center;
  box-shadow:0 8px 24px rgba(3,18,36,0.35);
}
.chart-card .dot { width:12px;height:12px;border-radius:50%;background:#1dd174;box-shadow:0 0 8px rgba(29,209,161,0.18); }

/* modal */
.tv-modal { position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:9999; }
.tv-modal.open { display:flex; }

/* NO blur here — removed backdrop-filter to avoid page blur */
.tv-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.18); }

.tv-panel {
  width:92%;
  max-width:1220px;
  height:82vh;
  background: rgba(7,16,25,0.96);
  border-radius:10px;
  padding:8px;
  box-shadow:0 18px 40px rgba(2,8,20,0.35);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
  z-index:10000; /* ensure panel sits above most page elements */
}
.tv-modal.open .tv-panel {
  transform: translateY(0);
  opacity: 1;
}

.tv-header { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px; }
.tv-header h3 { color:#e6f1f8; margin:0; font-size:15px; }
.tv-controls { display:flex; gap:8px; align-items:center; }
.tv-controls select { padding:6px 8px; border-radius:8px; border:1px solid rgba(31,59,84,0.7); background:rgba(8,36,54,0.85); color:#fff; }
.tv-controls button { background:#0f2a44;color:#fff;border:0;padding:6px 10px;border-radius:8px;cursor:pointer; }

/* the container hosting TradingView should be transparent to allow the widget's theme */
.tv-container { flex:1; border-radius:8px; overflow:hidden; background: transparent; }

/* Ensure TradingView inner widget fills container fully */
.tradingview-widget-container { height:100% !important; width:100% !important; }
.tradingview-widget-container__widget { height:100% !important; width:100% !important; }

@media (max-width: 768px) {
  .tv-panel { width:98%; height:92vh; border-radius:6px; padding:6px; }
  .chart-launcher { margin-top:12px; gap:8px; }
}

/* utility: visually-hidden label for accessibility */
.sr-only { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
