/* FileHub - Profile page styles (v2)
   Tabs + card UI matching Files/MyFiles pages; mobile friendly */

.profile {
  margin: auto;
  max-width: 1200px;
}

.profile .profile-header {
  margin: 10px 31px 14px;
}

.profile .profile-header h3 {
  font-size: 26px;
  font-weight: 900;
  color: #111827;
}

.profile .profile-header .sub {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.7;
  margin-top: 6px;
}

.profile .alert.inline {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 700;
}

.profile .alert.inline.success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #c6f7e2;
}

.profile .alert.inline.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Tabs */
.profile-tabs {
  margin: 0 31px 28px;
  display: flex;
  gap: 24px;
  align-items: flex-end;
  border-bottom: 1px solid #eef2f7;
}

.profile-tabs .tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 10px 4px 12px;
  font-size: 13px;
  font-weight: 800;
  color: #6b7280;
  cursor: pointer;
  position: relative;
}

.profile-tabs .tab.active {
  color: var(--app-primary, #2563eb);
}

.profile-tabs .tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 999px;
  background: var(--app-primary, #2563eb);
}

.tab-panel {
  display: none;
}

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

/* Cards */
.profile .profile-card {
  background: #fff;
  border: 1px solid #eef1f4;
  border-radius: 28px;
  box-shadow: 0 8px 24px rgba(31, 35, 41, .04);
  padding: 22px 22px;
  margin: 0 28px 18px;
  box-sizing: border-box;
}

.profile .card-title {
  margin: 2px 0 14px;
  font-size: 16px;
  font-weight: 900;
  color: #111827;
}

/* Info fields */
.info-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}

.field .label {
  font-size: 12px;
  color: #6b7280;
  font-weight: 800;
  margin: 2px 16px 8px;
}

.control.readonly {
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid #eef2f7;
  font-weight: 800;
  color: #111827;
  box-sizing: border-box;
  min-width: 0;
}

.control.readonly.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.control.readonly.status {
  justify-content: flex-start;
  font-weight: 900;
}

.dot {
  display: none;
}

/* Status pill (replace dot indicator) */
.control.readonly.status {
  justify-content: flex-start;
  font-weight: 900;
}

.control.readonly.status.ok {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.control.readonly.status.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.control.readonly.status.off {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #334155;
}

/* Password form */
.pwd-form {
  max-width: 520px;
}

.input-label {
  display: block;
  font-size: 13px;
  color: #6b7280;
  font-weight: 800;
  margin: 8px 16px 8px;
}

.input {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #eef2f7;
  background: #fff;
  padding: 0 16px;
  box-sizing: border-box;
  outline: none;
  margin-bottom: 10px;
  font-size: 14px;
}

.input:focus {
  border-color: rgba(37, 99, 235, .35);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

/* Button (match Files-page primary) */
.profile .btn.pill {
  border-radius: 999px;
  height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  text-decoration: none;
  box-sizing: border-box;
}

/* Password submit button: full width like inputs */
.pwd-form .btn.pill {
  width: 100%;
  display: flex;
  margin-top: 14px;
  font-size: 14px;
}

.profile .btn.pill.small {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  width: auto;
}

.profile .btn.primary.pill {
  background: var(--app-primary, #2563eb);
  color: #fff;
  border: 1px solid transparent;
}

.profile .btn.primary.pill:hover {
  filter: brightness(.98);
}

.profile .btn.primary.pill:active {
  transform: translateY(1px);
}

/* Tips */
.tips {
  margin-top: 16px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 22px;
  padding: 14px 16px;
}

.tips-title {
  font-weight: 900;
  font-size: 14px;
  color: #111827;
  margin-bottom: 10px;
}

.tips ul {
  margin: 0;
  padding-left: 18px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.7;
}

.tips li {
  margin: 8px 0;
}

/* Stats lists */
.profile-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 0 28px 18px;
}

.profile-grid-2 .profile-card {
  margin: 0;
}

.list-card .list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.list-card .list-title {
  font-weight: 900;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-card .list-title .ico {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  color: var(--app-primary, #2563eb);
  font-weight: 900;
}

.list-body {
  border-top: 1px solid #f1f5f9;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.row:last-child {
  border-bottom: 0;
}

.left {
  min-width: 0;
}

.name {
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
}

.meta {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.empty {
  padding: 14px 0;
  color: #9ca3af;
  text-align: center;
  font-weight: 800;
}

/* Stats tiles (match list cards width on all breakpoints) */
.stats-grid {
  margin: 0 28px 18px;
}

.stats-grid .profile-card {
  margin: 0;
}

.stat-tile {
  padding: 18px 18px;
  background: #fff;
}

.stat-tile .k {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.stat-tile .v {
  font-size: 22px;
  font-weight: 900;
  color: #111827;
  margin-top: 6px;
}

/* Mobile */
@media (max-width: 768px) {

  .profile-tabs {
    /* margin: 0 20px 16px; */
    gap: 18px;
  }

  .profile .profile-card {
    /* margin: 0 10px 0px; */
    padding: 18px 24px;
  }

  .info-form {
    grid-template-columns: 1fr;
  }

  .profile-grid-2 {
    grid-template-columns: 1fr;
    /* margin: 0 20px 16px; */
  }

  .name {
    max-width: 220px;
  }

  .pwd-form {
    max-width: 100%;
  }

  /* Stats tiles: same margin/width rhythm as list cards */
  .stats-grid {
    /* margin: 0 20px 16px; */
    grid-template-columns: 1fr;
  }

  .stat-tile {
    padding: 18px 18px;
  }
}

@media (max-width: 420px) {
  .name {
    max-width: 180px;
  }
}