
/* AG Marketplace — User Dashboard */

:root {
  --ag-blue: #1557a6;
  --ag-blue-dark: #103c78;
  --ag-text: #142b50;
  --ag-muted: #59749a;
  --ag-border: #d7e6fa;
  --ag-bg: #f2f7fd;
  --ag-white: #fff;
}

/* Reset dashboard layout */
body:has(#welcome) {
  margin: 0 !important;
  min-height: 100vh;
  background: var(--ag-bg) !important;
  color: var(--ag-text);
  font-family: "Noto Sans Devanagari", "Nirmala UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

body:has(#welcome) *,
body:has(#welcome) *::before,
body:has(#welcome) *::after {
  box-sizing: border-box;
}

body:has(#welcome) a {
  text-decoration: none;
}

body:has(#welcome) button {
  font-family: inherit;
}

/* Header */
body:has(#welcome) .dashboard-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-height: 78px;
  padding: 12px clamp(16px, 4vw, 42px);
  background: #fff;
  border-bottom: 1px solid var(--ag-border);
  box-shadow: 0 3px 14px rgb(16 60 120 / 5%);
}

body:has(#welcome) .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ag-blue-dark);
  font-size: clamp(16px, 2vw, 25px);
  font-weight: 800;
}

body:has(#welcome) .brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #2473d1, #10447f);
  color: #fff;
  font-size: 19px;
  font-weight: 900;
  box-shadow: 0 5px 12px rgb(21 87 166 / 18%);
}

body:has(#welcome) .header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

body:has(#welcome) .header-user-name {
  max-width: 180px;
  overflow: hidden;
  color: var(--ag-text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body:has(#welcome) .logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid #f0b9b9;
  border-radius: 10px;
  background: #fff;
  color: #c62828;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

body:has(#welcome) .logout-button:hover {
  background: #fff1f1;
}

body:has(#welcome) .logout-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* Main content */
body:has(#welcome) .dashboard-container {
  width: min(1180px, calc(100% - 40px));
  margin: 28px auto 0;
}

/* Welcome banner */
body:has(#welcome) .welcome-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 195px;
  margin-bottom: 26px;
  padding: 30px 36px;
  overflow: hidden;
  border-radius: 15px;
  background: linear-gradient(120deg, #103d79, #2369b5);
  color: #fff;
  box-shadow: 0 8px 24px rgb(21 87 166 / 12%);
}

body:has(#welcome) .eyebrow {
  margin: 0 0 7px;
  color: #b9dcff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
}

body:has(#welcome) #welcome {
  margin: 0;
  color: #fff;
  font-size: clamp(25px, 3.5vw, 38px);
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

body:has(#welcome) .welcome-description {
  margin: 10px 0 0;
  color: #e7f1ff;
  font-size: 15px;
  line-height: 1.8;
}

body:has(#welcome) .welcome-icon {
  display: grid;
  width: 90px;
  height: 90px;
  flex: 0 0 90px;
  place-items: center;
  border: 2px solid rgb(255 255 255 / 35%);
  border-radius: 23px;
  background: rgb(255 255 255 / 10%);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
}

/* General cards */
body:has(#welcome) .dashboard-card {
  min-width: 0;
  margin: 0 0 22px;
  padding: 25px;
  border: 1px solid var(--ag-border);
  border-radius: 14px;
  background: var(--ag-white);
  box-shadow: 0 4px 18px rgb(21 87 166 / 4%);
}

body:has(#welcome) .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 20px;
}

body:has(#welcome) .section-heading h2 {
  margin: 0;
  color: var(--ag-text);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.5;
}

body:has(#welcome) .section-heading p {
  margin: 4px 0 0;
  color: var(--ag-muted);
  font-size: 13px;
}

body:has(#welcome) .text-link {
  flex-shrink: 0;
  color: var(--ag-blue);
  font-weight: 750;
}

body:has(#welcome) .text-link:hover,
body:has(#welcome) .action-link:hover {
  text-decoration: underline;
}

/* Profile details */
body:has(#welcome) .profile-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body:has(#welcome) .profile-item {
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid #e3edf9;
  border-radius: 10px;
  background: #f6f9fe;
}

body:has(#welcome) .profile-label {
  display: block;
  margin-bottom: 4px;
  color: var(--ag-muted);
  font-size: 12px;
}

body:has(#welcome) .profile-value {
  display: block;
  color: var(--ag-text);
  font-size: 14px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

/* Verification */
body:has(#welcome) .verification-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 50%;
  background: #e5f0ff;
  color: var(--ag-blue);
  font-size: 23px;
  font-weight: 800;
}

body:has(#welcome) .verification-status {
  margin: 0 0 18px;
  padding: 17px;
  border: 1px solid #e3edf9;
  border-radius: 11px;
  background: #f6f9fe;
  overflow-wrap: anywhere;
}

body:has(#welcome) .verification-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

body:has(#welcome) .verification-line + .verification-line {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ag-border);
}

body:has(#welcome) .status-verified {
  color: #087647;
  font-weight: 750;
}

body:has(#welcome) .status-pending {
  color: #b42318;
  font-weight: 750;
}

body:has(#welcome) .action-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 9px;
  background: var(--ag-blue);
  color: #fff;
  font-weight: 750;
  text-align: center;
}

body:has(#welcome) .action-link:hover {
  background: var(--ag-blue-dark);
  text-decoration: none;
}

/* Feature links */
body:has(#welcome) .dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

body:has(#welcome) .dashboard-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--ag-border);
  border-radius: 10px;
  background: #fff;
  color: var(--ag-text);
  transition: border-color 0.18s ease, background 0.18s ease;
}

body:has(#welcome) .dashboard-link:hover {
  border-color: #8bb5ed;
  background: #f5f9ff;
}

body:has(#welcome) .link-icon {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  place-items: center;
  border-radius: 50%;
  background: #e7f1ff;
  color: #1557b7;
  font-size: 22px;
  font-weight: 800;
}

body:has(#welcome) .dashboard-link > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

body:has(#welcome) .dashboard-link strong {
  display: block;
  color: var(--ag-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

body:has(#welcome) .dashboard-link small {
  display: block;
  margin-top: 3px;
  color: var(--ag-muted);
  font-size: 11px;
  line-height: 1.5;
}

body:has(#welcome) .link-arrow {
  flex: 0 0 auto;
  color: var(--ag-muted);
  font-size: 23px;
}

body:has(#welcome) .vendor-link {
  border-color: #c4e6d3;
  background: #f4fbf7;
}

body:has(#welcome) .vendor-link .link-icon {
  background: #d8f4e5;
  color: #087647;
}

body:has(#welcome) .help-text {
  margin: 20px 0 0;
  padding: 13px 16px;
  border-radius: 9px;
  background: #edf8f4;
  color: #356b60;
  font-size: 12px;
  line-height: 1.8;
}

/* API status messages */
body:has(#welcome) .message-box {
  margin: 0 0 20px;
  padding: 13px 16px;
  border: 1px solid #f0d49a;
  border-radius: 10px;
  background: #fff8e8;
  color: #795400;
  overflow-wrap: anywhere;
}

body:has(#welcome) .message-box[hidden] {
  display: none !important;
}

body:has(#welcome) .message-box.error {
  border-color: #f1baba;
  background: #fff1f1;
  color: #9e2424;
}

body:has(#welcome) .message-box.success {
  border-color: #b8dec5;
  background: #f0fbf3;
  color: #176638;
}

body:has(#welcome) .loading-text {
  margin: 0;
  color: var(--ag-muted);
}

/* Footer */
body:has(#welcome) .dashboard-footer {
  padding: 0 0 25px;
  color: var(--ag-muted);
  font-size: 12px;
  text-align: center;
}

/* Keyboard accessibility */
body:has(#welcome) a:focus-visible,
body:has(#welcome) button:focus-visible {
  outline: 3px solid #85b8ff;
  outline-offset: 3px;
}

/* Tablet */
@media (max-width: 900px) {
  body:has(#welcome) .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:has(#welcome) .dashboard-container {
    width: calc(100% - 30px);
  }
}

/* Mobile */
@media (max-width: 560px) {
  body:has(#welcome) .dashboard-header {
    min-height: 62px;
    padding: 9px 12px;
    gap: 8px;
  }

  body:has(#welcome) .brand {
    gap: 7px;
    font-size: 13px;
  }

  body:has(#welcome) .brand-mark {
    width: 35px;
    height: 35px;
    flex-basis: 35px;
    border-radius: 9px;
    font-size: 13px;
  }

  body:has(#welcome) .header-actions {
    gap: 7px;
  }

  body:has(#welcome) .header-user-name {
    max-width: 65px;
    font-size: 12px;
  }

  body:has(#welcome) .logout-button {
    min-height: 36px;
    padding: 6px 9px;
    font-size: 12px;
  }

  body:has(#welcome) .dashboard-container {
    width: calc(100% - 20px);
    margin-top: 15px;
  }

  body:has(#welcome) .welcome-panel {
    min-height: 0;
    margin-bottom: 15px;
    padding: 22px 17px;
    border-radius: 12px;
  }

  body:has(#welcome) #welcome {
    font-size: 25px;
  }

  body:has(#welcome) .welcome-description {
    font-size: 13px;
  }

  body:has(#welcome) .welcome-icon {
    width: 47px;
    height: 47px;
    flex-basis: 47px;
    border-radius: 12px;
    font-size: 15px;
  }

  body:has(#welcome) .dashboard-card {
    margin-bottom: 15px;
    padding: 16px 13px;
    border-radius: 12px;
  }

  body:has(#welcome) .section-heading {
    gap: 8px;
    margin-bottom: 15px;
  }

  body:has(#welcome) .section-heading h2 {
    font-size: 17px;
  }

  body:has(#welcome) .section-heading p {
    font-size: 12px;
  }

  body:has(#welcome) .text-link {
    font-size: 12px;
  }

  body:has(#welcome) .profile-details {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body:has(#welcome) .profile-item {
    padding: 12px;
  }

  body:has(#welcome) .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  body:has(#welcome) .dashboard-link {
    min-height: 70px;
    padding: 11px;
  }

  body:has(#welcome) .link-icon {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
    font-size: 20px;
  }

  body:has(#welcome) .help-text {
    margin-top: 15px;
    padding: 12px;
  }
}

/* Small phones */
@media (max-width: 360px) {
  body:has(#welcome) .brand {
    font-size: 11px;
  }

  body:has(#welcome) .header-user-name {
    display: none;
  }

  body:has(#welcome) .welcome-icon {
    display: none;
  }

  body:has(#welcome) .dashboard-container {
    width: calc(100% - 14px);
  }
}
