/* ═══════════════════════════════════════════════════════
   OURO  ·  Components: cards, buttons, forms, modal
   ═══════════════════════════════════════════════════════ */

/* ── STAT CARDS ─────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
  min-width: 0;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 22px 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
  min-width: 0;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card.accent {
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  border: none;
  box-shadow: var(--shadow-accent);
  position: relative;
  overflow: hidden;
}

.stat-card.accent::before {
  content: '';
  position: absolute;
  top: -60px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.stat-card.accent::after {
  content: '';
  position: absolute;
  bottom: -24px; left: -24px;
  width: 130px; height: 130px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.stat-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  opacity: 0.50;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-value small {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.5;
  margin-left: 3px;
  letter-spacing: 0;
}

@media (max-width: 768px) {
  .stat-card { padding: 14px 14px; }
  .stat-value { font-size: 20px; }
  .stat-value small { font-size: 10px; margin-left: 2px; }
}

@media (max-width: 380px) {
  .stat-value { font-size: 17px; }
  .stat-card { padding: 12px 10px; }
}

/* ── ASSET CARDS ────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.card-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.card-sub   { font-size: 13px; color: var(--text-sub); margin-bottom: 16px; }

.tenant-card {
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.tenant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* ── List Row Hover ─────────────────────────────────── */
.list-row {
  transition: background 0.15s ease;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .list-row:hover { background: var(--surface-2) !important; }
}

/* ── BADGES ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-blue  { background: var(--accent-subtle); color: var(--accent); }
.badge-gray  { background: var(--surface-2); color: var(--text-sub); }
.badge-green { background: rgba(29,199,91,0.12); color: var(--success); }
.badge-red   { background: rgba(255,59,48,0.12); color: var(--danger); }

/* ── BUTTONS ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 22px;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: opacity 0.15s, transform 0.12s var(--spring), box-shadow 0.15s;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px var(--accent-glow), 0 1px 2px var(--accent-subtle);
}
.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-3); }

.btn-ghost {
  background: none;
  color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ── Invite (share) CTAs — purple to distinguish from the orange accent ── */
.btn-invite-cta {
  background: #8B5CF6; color: #fff;
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; font-size: 13px; font-weight: 700;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-invite-cta:hover  { background: #7C3AED; }
.btn-invite-cta:active { background: #6D28D9; }
@media (max-width: 768px) {
  .btn-invite-cta span { display: none; }
  .btn-invite-cta { padding: 8px 11px; }
}

.btn-invite-profile {
  background: #8B5CF6; color: #fff;
  border: none; border-radius: 12px; cursor: pointer;
  padding: 14px; font-size: 14px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s;
}
.btn-invite-profile:hover  { background: #7C3AED; }
.btn-invite-profile:active { background: #6D28D9; }

.sh-role-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 12px; border-radius: 12px; cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 10px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
}
.sh-role-btn i { font-size: 18px; color: var(--text-sub); flex-shrink: 0; }
.sh-role-btn p { margin: 0; }
.sh-role-btn.sh-role-active {
  background: color-mix(in srgb, #8B5CF6 14%, transparent);
  border-color: #8B5CF6;
}
.sh-role-btn.sh-role-active i { color: #8B5CF6; }

.btn-add {
  display: block;
  width: auto;
  padding: 16px 28px;
  border-radius: var(--radius-card);
  border: 2px dashed var(--border-strong);
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  margin: 0;
}
.btn-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ── FORMS ──────────────────────────────────────────── */
.ios-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface-2);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  margin-bottom: 10px;
  appearance: none;
  -webkit-appearance: none;
}
.ios-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.ios-input::placeholder { color: var(--text-dim); }
.ios-input.input-error {
  border-color: var(--danger) !important;
  background: rgba(255,59,48,0.05);
  box-shadow: 0 0 0 3px rgba(255,59,48,0.12);
  animation: input-shake 0.35s ease both;
}
@keyframes input-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-5px); }
  60%       { transform: translateX(4px); }
  80%       { transform: translateX(-2px); }
}

/* ── LANG SELECT ────────────────────────────────────── */
.lang-select {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-sub);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2399A3B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.sidebar .lang-select { width: 100%; }
.lang-select:hover { background-color: var(--accent-subtle); color: var(--accent); border-color: var(--accent); }
.lang-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

/* ── MODAL ──────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 600px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-box {
    border-radius: 24px !important;
    padding-bottom: 28px !important;
  }
  .modal-box::before {
    display: none;
  }
}

.modal-box {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  border-radius: 28px 28px 0 0;
  padding: 12px 24px 44px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.14), 0 -2px 8px rgba(0,0,0,0.08);
}

/* Drag handle */
.modal-box::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 99px;
  margin: 8px auto 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}
.modal-header h3 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  font-size: 13px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-sub);
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}
.modal-close:hover { background: var(--surface-3); transform: scale(1.1); }

/* ── ALERTS ─────────────────────────────────────────── */
.alert {
  padding: 13px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid currentColor;
  transition: opacity 0.15s, transform 0.15s var(--ease);
}
.alert:hover { opacity: 0.85; transform: translateX(2px); }
.alert-danger  { background: rgba(255, 59, 48, 0.08); color: var(--danger); }
.alert-warning { background: rgba(255,149, 0, 0.08); color: var(--warning); }

/* ── GRID UTILS ─────────────────────────────────────── */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (max-width: 480px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

/* ── UTILS ──────────────────────────────────────────── */
.hidden { display: none !important; }

.space-y-3 {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
