/* ==========================================================================
   Plano D Links Hub — Impeccable Design System
   Visual Direction: Dark Premium Glassmorphism, Micro-Precision, Mobile-First
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Surface & Canvas */
  --bg-main: #0A0C10;
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-surface-hover: rgba(255, 255, 255, 0.075);
  --bg-surface-active: rgba(255, 255, 255, 0.11);
  --bg-card: rgba(255, 255, 255, 0.045);
  --bg-input: rgba(255, 255, 255, 0.035);
  --bg-modal: #12151B;

  /* Borders & Optical Highlights */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-focus: rgba(255, 255, 255, 0.38);

  /* Elevation Shadows */
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
  --shadow-card-hover: 0 8px 28px -4px rgba(0, 0, 0, 0.55), inset 0 1px 0 0 rgba(255, 255, 255, 0.14);
  --shadow-input-focus: 0 0 0 3px rgba(224, 122, 95, 0.2), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);

  /* Typography & Contrast (WCAG AAA compliant on #0A0C10) */
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --text-inverted: #0A0C10;

  /* Accent Color (Plano D Official Purple/Violet) */
  --accent: #7C3AED;
  --accent-rgb: 124, 58, 237;
  --accent-hover: #8B5CF6;
  --accent-subtle: rgba(124, 58, 237, 0.14);
  --accent-border: rgba(124, 58, 237, 0.35);

  /* Status Colors */
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);
  --error: #EF4444;
  --error-bg: rgba(239, 68, 68, 0.12);
  --error-border: rgba(239, 68, 68, 0.3);
  --warning: #F59E0B;

  /* 4-Unit Spatial Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Motion Curves */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 140ms var(--ease-out);
  --transition-normal: 220ms var(--ease-out);

  /* Typography Ramp */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --max-width: 520px;
}

/* ==========================================================================
   Base & Browser Surfaces Reset
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  background-color: var(--bg-main);
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--bg-main);
  background-image: 
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(124, 58, 237, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 255, 255, 0.02) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--accent);
  overflow-x: hidden;
}

/* Themed Selection & Focus Rings */
::selection {
  background: rgba(124, 58, 237, 0.35);
  color: #FFFFFF;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

.app-container {
  width: 100%;
  max-width: var(--max-width);
  min-height: 100vh;
  padding: var(--space-4) var(--space-4) var(--space-10) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-1) var(--space-3) var(--space-1);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text-main);
  transition: opacity var(--transition-fast);
}

.brand:hover {
  opacity: 0.9;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.brand-logo {
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.brand-logo img {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  object-fit: contain !important;
  display: block !important;
}

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.24), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--accent-border);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-hover);
  letter-spacing: -0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.25;
}

.brand-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.btn-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-icon-link:hover {
  color: var(--text-main);
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-icon-link:active {
  transform: scale(0.95);
  background: var(--bg-surface-active);
}

/* ==========================================================================
   Search Bar (High Scanability)
   ========================================================================== */

.search-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: var(--space-1);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.search-input {
  width: 100%;
  height: 52px;
  padding: 0 46px 0 46px;
  font-size: 16px !important;
  font-family: inherit;
  font-weight: 450;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  outline: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  transition: all var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.search-input:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: var(--shadow-input-focus);
}

.search-input:focus + .search-icon {
  color: var(--text-main);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.search-clear:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.16);
}

/* ==========================================================================
   Section Rhythm & Headings
   ========================================================================== */

.section-title {
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: var(--space-6) var(--space-1) var(--space-2) var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ==========================================================================
   Client List & Tactile Cards
   ========================================================================== */

.clients-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.client-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-decoration: none;
  color: var(--text-main);
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.client-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.client-card:active {
  transform: scale(0.985);
  background: var(--bg-surface-active);
}

.client-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.client-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 650;
  color: var(--text-main);
  flex-shrink: 0;
  overflow: hidden;
}

.client-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.client-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.client-name {
  font-size: 0.985rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-star {
  color: #F59E0B;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.client-notes {
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-arrow {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-2);
  flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.client-card:hover .client-arrow {
  color: var(--text-main);
  transform: translateX(3px);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--text-muted);
  font-size: 0.925rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-card);
  margin-top: var(--space-3);
}

/* ==========================================================================
   Client Detail View
   ========================================================================== */

.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-1);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  margin-left: -8px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.back-btn:hover {
  color: var(--text-main);
  background: var(--bg-surface);
}

.back-btn:active {
  transform: scale(0.96);
}

.client-header-card {
  padding: var(--space-6) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.client-header-avatar {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(224, 122, 95, 0.18), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--accent-border);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-hover);
  overflow: hidden;
}

.client-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.client-header-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  line-height: 1.25;
}

.client-header-note {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 90%;
  line-height: 1.45;
}

/* ==========================================================================
   Tactile Action Links (48–56px height)
   ========================================================================== */

.links-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.link-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-decoration: none;
  color: var(--text-main);
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.link-button:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.link-button:active {
  transform: scale(0.985);
  background: var(--bg-surface-active);
}

.link-button-content {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.link-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.link-button:hover .link-icon-box {
  background: var(--accent-subtle);
  border-color: var(--accent-border);
  color: var(--accent-hover);
}

.link-title {
  font-size: 0.985rem;
  font-weight: 550;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-action-icon {
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: var(--space-2);
  flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.link-button:hover .link-action-icon {
  color: var(--text-main);
  transform: translate(2px, -2px);
}

/* ==========================================================================
   Login Box
   ========================================================================== */

.login-box {
  margin: auto 0;
  padding: var(--space-8) var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-5);
}

.login-logo-wrapper {
  width: 64px;
  height: 64px;
  min-width: 64px;
  max-width: 64px;
  max-height: 64px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-border);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 24px -4px rgba(124, 58, 237, 0.35);
  margin: 0 auto;
  flex-shrink: 0;
}

.login-brand-logo {
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  object-fit: contain !important;
  display: block !important;
}

.login-icon {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.22), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--accent-border);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-hover);
}

.login-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ==========================================================================
   Forms & Controls
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 550;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.form-input, .form-select, .form-textarea, input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px !important;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
  outline: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.065);
  box-shadow: var(--shadow-input-focus);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ==========================================================================
   Buttons System
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 12px 20px;
  font-size: 0.925rem;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.01em;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  user-select: none;
}

.btn-primary {
  background: var(--text-main);
  color: var(--text-inverted);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
  background: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.18);
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-accent {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(224, 122, 95, 0.35);
}

.btn-accent:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(224, 122, 95, 0.45);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid var(--error-border);
  color: #F87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #FCA5A5;
}

.btn-sm {
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Admin Specific
   ========================================================================== */

.admin-card {
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-card-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-2);
}

.admin-links-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: 4px;
}

.admin-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: var(--space-2);
}

.admin-link-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex: 1;
}

.admin-link-url {
  font-size: 0.775rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.admin-link-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Alerts & Toast Feedback
   ========================================================================== */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  animation: slideDown 200ms var(--ease-out);
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #34D399;
}

.alert-error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: #F87171;
}

.alert-info {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 460px;
  background: var(--bg-modal);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  padding: var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleUp 180ms var(--ease-out);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Utilities & Animations
   ========================================================================== */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.w-3 { width: 14px; height: 14px; }
.w-4 { width: 16px; height: 16px; }
.w-5 { width: 20px; height: 20px; }
.w-6 { width: 24px; height: 24px; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.gap-2 { gap: var(--space-2); }
.flex-row { display: flex; flex-direction: row; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* Responsiveness (360px – 430px) */
@media (max-width: 380px) {
  .app-container {
    padding: var(--space-3) var(--space-3) var(--space-8) var(--space-3);
  }
  .client-card {
    padding: 12px 14px;
  }
  .link-button {
    padding: 10px 14px;
    min-height: 52px;
  }
}
