/* =========================================================================
   SCREWNET HEADLESS CUSTOMER ACCOUNT PORTAL - MINIMALIST MONOCHROME (BLACK & WHITE)
   ========================================================================= */

.account-portal-wrapper {
  max-width: 1180px;
  margin: 32px auto 64px;
  padding: 0 16px;
  min-height: 520px;
  box-sizing: border-box;
}

/* User Greeting Banner */
.account-user-banner {
  background: #000000;
  border-radius: 16px;
  padding: 28px 32px;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #27272a;
  overflow: hidden;
  box-sizing: border-box;
  max-width: 100%;
}

.account-user-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  max-width: 100%;
  flex: 1;
  overflow: hidden;
}

.account-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  font-size: 22px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  border: 2px solid #000000;
}

.account-user-names {
  min-width: 0;
  max-width: 100%;
  flex: 1;
  overflow: hidden;
}

.account-user-names h1 {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.account-role-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #18181b;
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #3f3f46;
  white-space: nowrap;
}

.account-user-names p {
  margin: 0;
  font-size: 13px;
  color: #a1a1aa;
  word-break: break-all;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.account-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #18181b;
  border: 1px solid #27272a;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.account-logout-btn:hover {
  background: #000000;
  border-color: #ffffff;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Tab Navigation Bar */
.account-nav-tabs {
  display: flex;
  gap: 8px;
  background: #f4f4f5;
  padding: 6px;
  border-radius: 12px;
  margin-bottom: 28px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}

.account-nav-tabs::-webkit-scrollbar {
  display: none;
}

.account-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #52525b;
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 180ms ease;
}

.account-nav-tab:hover {
  color: #000000;
  background: rgba(255, 255, 255, 0.7);
}

.account-nav-tab.active {
  background: #000000;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.account-nav-tab .tab-badge {
  background: #ffffff;
  color: #000000;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.account-nav-tab.active .tab-badge {
  background: #ffffff;
  color: #000000;
}

/* Content Panels */
.account-content-panel {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

/* Dashboard Metrics */
.dashboard-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.metric-card {
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 150ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: #000000;
}

.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon.orange,
.metric-icon.blue,
.metric-icon.emerald {
  background: #000000;
  color: #ffffff;
}

.metric-info .metric-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #71717a;
  letter-spacing: 0.5px;
}

.metric-info .metric-val {
  font-size: 22px;
  font-weight: 900;
  color: #000000;
  margin-top: 2px;
}

/* Section Titles */
.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f4f4f5;
}

.section-header-row h2 {
  font-size: 18px;
  font-weight: 800;
  color: #000000;
  margin: 0;
}

.section-header-row p {
  font-size: 13px;
  color: #71717a;
  margin: 4px 0 0;
}

/* Orders List */
.orders-list-grid {
  display: grid;
  gap: 16px;
}

.order-card {
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 20px;
  background: #ffffff;
  transition: all 180ms ease;
}

.order-card:hover {
  border-color: #000000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f4f4f5;
}

.order-id-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-id-text {
  font-size: 16px;
  font-weight: 800;
  color: #000000;
}

.order-date-text {
  font-size: 12px;
  color: #71717a;
}

.order-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid #000000;
  background: #ffffff;
  color: #000000;
}

.status-processing {
  background: #f4f4f5;
  color: #000000;
  border: 1px solid #000000;
}

.status-completed {
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
}

.status-pending {
  background: #ffffff;
  color: #000000;
  border: 1px dashed #000000;
}

.status-cancelled, .status-failed {
  background: #18181b;
  color: #a1a1aa;
  border: 1px solid #27272a;
}

.order-card-body {
  padding: 16px 0;
  display: grid;
  gap: 10px;
}

.order-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.order-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  object-fit: cover;
}

.order-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
  flex: 1;
}

.order-item-qty {
  font-size: 13px;
  color: #71717a;
}

.order-item-price {
  font-size: 14px;
  font-weight: 800;
  color: #000000;
}

.order-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #f4f4f5;
  flex-wrap: wrap;
  gap: 12px;
}

.order-total-group {
  font-size: 13px;
  color: #71717a;
}

.order-total-val {
  font-size: 16px;
  font-weight: 900;
  color: #000000;
  margin-left: 6px;
}

.order-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: #f4f4f5;
  color: #000000;
  border: 1px solid #e4e4e7;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
}

.order-view-btn:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

/* Empty State Box */
.empty-state-box {
  text-align: center;
  padding: 48px 24px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px dashed #d4d4d8;
}

.empty-state-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.empty-state-box h3 {
  font-size: 17px;
  font-weight: 800;
  color: #000000;
  margin: 0 0 6px;
}

.empty-state-box p {
  font-size: 13px;
  color: #71717a;
  margin: 0 0 20px;
}

/* Addresses Grid */
.addresses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.address-card {
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 24px;
  background: #ffffff;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.address-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f4f4f5;
}

.address-card-header h3 {
  font-size: 16px;
  font-weight: 800;
  color: #000000;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.address-edit-link {
  font-size: 13px;
  font-weight: 700;
  color: #000000;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: underline;
}

.address-edit-link:hover {
  color: #3f3f46;
}

.address-body {
  font-size: 13px;
  color: #27272a;
  line-height: 1.7;
  min-height: 90px;
}

.address-body .not-set {
  color: #a1a1aa;
  font-style: italic;
}

.address-meta-line {
  margin-top: 10px;
  font-size: 12px;
  color: #71717a;
}

/* Edit Address Modal / Inline Box */
.address-edit-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e4e4e7;
  display: grid;
  gap: 14px;
}

.form-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.account-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-input-group label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #000000;
}

.account-input-group input,
.account-input-group select {
  padding: 10px 14px;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  font-size: 13px;
  color: #000000;
  background: #ffffff;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
  box-sizing: border-box;
}

.account-input-group input:focus,
.account-input-group select:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.address-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-primary-save {
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary-save:hover {
  background: #27272a;
  border-color: #27272a;
}

.btn-secondary-cancel {
  background: #f4f4f5;
  color: #000000;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary-cancel:hover {
  background: #e4e4e7;
}

/* Account Details Form */
.account-details-form {
  max-width: 640px;
  display: grid;
  gap: 20px;
}

.password-change-box {
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 20px;
  display: grid;
  gap: 14px;
}

.password-change-box h3 {
  font-size: 15px;
  font-weight: 800;
  color: #000000;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Notifications / Feedback */
.account-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-alert-success {
  background: #f4f4f5;
  color: #000000;
  border: 1px solid #000000;
}

.account-alert-error {
  background: #18181b;
  color: #ffffff;
  border: 1px solid #27272a;
}

/* Order Details Modal */
.order-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.order-modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  padding: 28px;
  position: relative;
  box-sizing: border-box;
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f4f4f5;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #000000;
}

.modal-close-btn:hover {
  background: #000000;
  color: #ffffff;
}

/* =========================================================================
   MOBILE RESPONSIVE RULES (iPhone, Android, Tablets)
   ========================================================================= */
@media (max-width: 768px) {
  .account-portal-wrapper {
    padding: 0 12px;
    margin: 16px auto 48px;
  }

  .account-user-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 16px;
    gap: 16px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .account-user-meta {
    width: 100%;
    min-width: 0;
    flex: 1;
    gap: 14px;
    align-items: flex-start;
    overflow: hidden;
  }

  .account-avatar {
    width: 48px;
    height: 48px;
    font-size: 19px;
  }

  .account-user-names {
    width: 100%;
    min-width: 0;
    flex: 1;
    overflow: hidden;
  }

  .account-user-names h1 {
    font-size: 18px;
    line-height: 1.35;
    margin-bottom: 6px;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  .account-role-badge {
    font-size: 10px;
    padding: 2px 7px;
  }

  .account-user-names p {
    font-size: 13px;
    word-break: break-all;
    overflow-wrap: anywhere;
    max-width: 100%;
    color: #a1a1aa;
  }

  .account-logout-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 13px;
    box-sizing: border-box;
  }

  .account-nav-tabs {
    padding: 4px;
    gap: 6px;
    margin-bottom: 20px;
    border-radius: 10px;
  }

  .account-nav-tab {
    padding: 10px 14px;
    font-size: 13px;
    gap: 6px;
  }

  .account-content-panel {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .dashboard-metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-row-two {
    grid-template-columns: 1fr;
  }

  .addresses-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .address-card {
    padding: 18px 16px;
  }

  .account-details-form {
    width: 100%;
    max-width: 100%;
  }

  .order-card {
    padding: 16px 14px;
  }

  .order-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .order-card-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .order-view-btn {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  .order-modal-card {
    padding: 20px 16px;
  }
}
