/* TRUG Admin Panel - Consolidated Stylesheet */

/* ============================================
   VARIABLES (Design Tokens)
   ============================================ */
:root {
  /* Brand Colors */
  --color-brand: #e25454;
  --color-brand-dark: #c23e3e;
  --color-brand-light: #fff0f0;

  /* Semantic Colors */
  --color-success: #22c55e;
  --color-success-light: #dcfce7;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-danger: #ef4444;
  --color-danger-light: #fee2e2;

  /* Background Colors */
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-inset: #f1f5f9;

  /* Text Colors */
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #94a3b8;

  /* Border Colors */
  --color-border: #e2e8f0;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;

  /* Layout */
  --sidebar-width: 260px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

a {
  color: var(--color-brand);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-brand-dark);
}

button {
  font-family: inherit;
}

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

table {
  border-collapse: collapse;
}

/* ============================================
   LAYOUT - Sidebar & Main Content
   ============================================ */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition: transform var(--transition-base);
}

.sidebar-brand {
  padding: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-brand);
}

.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  background: var(--color-brand);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: var(--space-6);
}

.sidebar-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
}

.sidebar-menu {
  list-style: none;
}

.sidebar-item {
  margin-bottom: var(--space-1);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.sidebar-link:hover {
  background: var(--color-surface-inset);
  color: var(--color-text);
}

.sidebar-link.active {
  background: var(--color-brand);
  color: white;
}

.sidebar-link.active:hover {
  background: var(--color-brand-dark);
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-inset);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.sidebar-return-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--color-brand-light);
  border: 1px solid var(--color-brand);
  border-radius: var(--radius-md);
  color: var(--color-brand);
  font-weight: 500;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.sidebar-return-link:hover {
  background: var(--color-brand);
  border-color: var(--color-brand-dark);
  color: white;
  transform: translateY(-1px);
}

.sidebar-return-link svg {
  flex-shrink: 0;
}

.sidebar-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-logout:hover {
  background: var(--color-danger-light);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 60;
  width: 44px;
  height: 44px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

/* Main Content */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-content {
  flex: 1;
  padding: var(--space-8);
  max-width: 1400px;
  gap: 20px;
  display: flex;
  flex-direction: column;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-content {
    padding: var(--space-6);
    padding-top: calc(var(--space-6) + 60px);
    max-width: 100%;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .admin-content {
    padding: var(--space-4);
    padding-top: calc(var(--space-4) + 60px);
    max-width: 100vw;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .admin-content>section {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
  }
}

/* ============================================
   FLASH MESSAGES
   ============================================ */
.admin-notice {
  background: var(--color-success-light);
  color: #166534;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  border: 1px solid #86efac;
}

.admin-alert {
  background: var(--color-danger-light);
  color: #991b1b;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  border: 1px solid #fecaca;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-brand);
  color: white;
  box-shadow: 0 1px 3px rgba(226, 84, 84, 0.3);
  border: 2px solid transparent;
}

.btn-primary:hover {
  background: #d64a4a;
  border-color: #b83232;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(226, 84, 84, 0.5);
}

.btn-primary:active {
  background: var(--color-brand-dark);
  border-color: #a02828;
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(226, 84, 84, 0.4);
}

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

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

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background: var(--color-surface-inset);
  color: var(--color-text);
}

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.btn-danger:hover {
  background: var(--color-danger);
  color: white;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
}

/* Button aliases for backward compatibility */
.btn-brand {
  background: var(--color-brand);
  color: white;
  box-shadow: 0 1px 3px rgba(226, 84, 84, 0.3);
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-brand:hover {
  background: var(--color-brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(226, 84, 84, 0.4);
}

.btn-small {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.card-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border);
  background: var(--color-surface-inset);
}

/* ============================================
   PAGE HEADER
   ============================================ */
.page-header {
  margin-bottom: var(--space-8);
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
  line-height: 1.2;
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.page-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .page-header-row {
    flex-direction: column;
    width: 100%;
    max-width: 100%;
  }

  .page-header-row>* {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .page-actions {
    width: 100%;
    max-width: 100%;
  }

  .page-actions .btn {
    width: 100%;
    max-width: 100%;
  }
}

/* ============================================
    BADGES
    ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.badge-upcoming {
  background: var(--color-success-light);
  color: var(--color-success);
}

.badge-today {
  background: var(--color-warning-light);
  color: #92400e;
}

.badge-past {
  background: var(--color-surface-inset);
  color: var(--color-text-muted);
}

.badge-count {
  background: var(--color-surface-inset);
  color: var(--color-text-secondary);
  min-width: 24px;
  justify-content: center;
}

.meetup-badge {
  display: inline-flex;
  background: var(--color-brand-light);
  color: var(--color-brand);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-sm);
}

.video-badge {
  display: inline-flex;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  color: white;
}

.video-badge.youtube {
  background: #ff0000;
}

.video-badge.vimeo {
  background: #1ab7ea;
}

/* Badge video alias for consistency with views */
.badge-video {
  display: inline-flex;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  color: white;
}

.badge-video.badge-youtube,
.badge-video.youtube {
  background: #ff0000;
}

.badge-video.badge-vimeo,
.badge-video.vimeo {
  background: #1ab7ea;
}

/* ============================================
   VISUALLY HIDDEN (Accessibility)
   ============================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   STATS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-8);
  width: 100%;
  max-width: 100%;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
}

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

.stat-value {
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--color-brand);
  line-height: 1;
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* ============================================
   BREADCRUMBS
   ============================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.breadcrumbs a {
  color: var(--color-text-secondary);
}

.breadcrumbs a:hover {
  color: var(--color-brand);
}

.breadcrumbs-separator {
  color: var(--color-text-muted);
}

.breadcrumbs-current {
  color: var(--color-text);
  font-weight: 500;
}

/* ============================================
   TABLES
   ============================================ */
.data-table-wrapper {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
}

.data-table {
  width: 100%;
  font-size: var(--text-sm);
  border-collapse: collapse;
}

.data-table thead {
  background: var(--color-surface-inset);
}

.data-table th {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  height: 64px;
}

.data-table tbody tr:last-child {
  border-bottom: none;
}

.data-table td {
  padding: var(--space-3) var(--space-5);
  vertical-align: middle;
  height: 100%;
}

.data-table tbody tr:hover {
  background: var(--color-surface-inset);
}

.data-table .actions {
  display: flex;
  gap: var(--space-2);
  justify-content: flex-end;
}

.data-table .actions .btn {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
}

.data-table thead {
  background: var(--color-surface-inset);
  border-bottom: 1px solid var(--color-border);
}

/* Data Cards (Mobile Alternative) */
.data-cards {
  display: none;
}

.data-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.data-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.data-card-title {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
}

.data-card-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.data-card-footer {
  display: flex;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.data-card-footer .btn {
  flex: 1;
  justify-content: center;
}

@media (max-width: 768px) {
  .data-table-wrapper {
    display: none;
  }

  .data-cards {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* ============================================
   FORMS
   ============================================ */
.form {
  max-width: 720px;
}

.form-section {
  margin-bottom: var(--space-8);
}

.form-section-title {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-border);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-field {
  margin-bottom: var(--space-5);
}

.form-field:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--color-danger);
  margin-left: var(--space-1);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-family: inherit;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--color-text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(226, 84, 84, 0.1);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
}

.form-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

@media (max-width: 640px) {
  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }
}

.form-errors {
  background: var(--color-danger-light);
  border: 1px solid var(--color-danger);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
}

.form-errors-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-danger);
  margin-bottom: var(--space-2);
}

.form-errors-list {
  margin: 0;
  padding-left: var(--space-5);
  color: var(--color-danger);
  font-size: var(--text-sm);
}

.form-errors-list li {
  margin-bottom: var(--space-1);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  margin-bottom: var(--space-6);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-sm {
  font-size: var(--text-sm);
}

.text-base {
  font-size: var(--text-base);
}

.text-lg {
  font-size: var(--text-lg);
}

.text-xl {
  font-size: var(--text-xl);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-secondary {
  color: var(--color-text-secondary);
}

.text-brand {
  color: var(--color-brand);
}

.text-success {
  color: var(--color-success);
}

.text-danger {
  color: var(--color-danger);
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-center {
  text-align: center;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-4 {
  gap: var(--space-4);
}

.hide-mobile {
  display: inherit;
}

.hide-desktop {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .hide-desktop {
    display: inherit !important;
  }
}

/* Action Grid (Quick Actions) */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-4);
}

.action-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.action-card:hover {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-sm);
}

.action-icon {
  width: 48px;
  height: 48px;
  background: var(--color-brand-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.action-content h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 var(--space-1) 0;
}

.action-content p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0;
}

/* Meetup List (Dashboard) */
.meetup-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.meetup-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}

.meetup-list-item:last-child {
  border-bottom: none;
}

.meetup-list-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
}

.meetup-list-details h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.meetup-list-details h4 a {
  color: var(--color-text);
}

.meetup-list-details h4 a:hover {
  color: var(--color-brand);
}

.meetup-list-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.meetup-list-actions {
  display: flex;
  gap: var(--space-3);
}

.btn-small {
  font-size: var(--text-xs);
  padding: var(--space-2) var(--space-3);
}

/* ============================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Meetup List Mobile */
@media (max-width: 768px) {
  .meetup-list-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
    padding: var(--space-4) 0;
  }

  .meetup-list-info {
    width: 100%;
    min-width: 0;
  }

  .meetup-list-details {
    min-width: 0;
    flex: 1;
  }

  .meetup-list-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .meetup-list-meta {
    flex-wrap: wrap;
  }

  .meetup-list-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .data-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
  }

  .meetup-list-actions .btn {
    flex: 1;
    justify-content: center;
    min-height: 44px;
  }
}

/* Page Header Mobile */
@media (max-width: 640px) {
  .page-header {
    margin-bottom: var(--space-6);
  }

  .page-title {
    font-size: var(--text-xl);
  }

  .page-header-row {
    flex-direction: column;
    gap: var(--space-4);
  }

  .page-header-row>div {
    max-width: 100%;
    min-width: 0;
  }

  .page-actions {
    width: 100%;
    max-width: 100%;
  }

  .page-actions .btn {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .page-title {
    font-size: var(--text-xl);
    word-break: break-word;
  }
}

/* Breadcrumbs Mobile */
@media (max-width: 640px) {
  .breadcrumbs {
    flex-wrap: wrap;
    font-size: var(--text-xs);
  }

  .breadcrumbs-separator {
    flex-shrink: 0;
  }

  .breadcrumbs-current {
    width: 100%;
    margin-top: var(--space-1);
  }
}

/* Action Grid Mobile */
@media (max-width: 640px) {
  .action-grid {
    grid-template-columns: 1fr;
  }

  .action-card {
    padding: var(--space-3);
  }

  .action-icon {
    width: 40px;
    height: 40px;
    font-size: var(--text-lg);
  }
}

/* Stats Grid Mobile */
@media (max-width: 640px) {
  .stats-grid {
    display: block !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }

  .stats-grid>* {
    max-width: 100vw !important;
    width: 100% !important;
    margin-bottom: var(--space-3);
  }

  .stat-card {
    padding: var(--space-4);
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box;
    display: block !important;
  }

  .stat-value {
    font-size: var(--text-2xl);
    max-width: 100% !important;
    width: 100% !important;
    word-break: break-word;
  }

  .stat-label {
    font-size: var(--text-xs);
    max-width: 100% !important;
    width: 100% !important;
    word-break: break-word;
  }
}

/* Data Cards Mobile Improvements */
@media (max-width: 768px) {
  .data-card {
    padding: var(--space-4);
  }

  .data-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .data-card-footer {
    flex-wrap: wrap;
  }

  .data-card-footer .btn {
    min-height: 44px;
  }
}

/* Card Mobile Adjustments */
@media (max-width: 640px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .card-body {
    padding: var(--space-4);
  }

  .card-footer {
    padding: var(--space-3) var(--space-4);
  }

  .card-title {
    font-size: var(--text-base);
  }
}

/* Empty State Mobile */
@media (max-width: 640px) {
  .empty-state {
    padding: var(--space-8) var(--space-4);
  }

  .empty-state-icon {
    font-size: 2.5rem;
  }
}

/* Touch Target Improvements */
@media (max-width: 768px) {

  .data-table .actions .btn,
  .btn-sm {
    min-height: 36px;
    min-width: 36px;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
  }

  .sidebar-link {
    min-height: 44px;
  }

  .meetup-link {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
  }

  /* Smaller action buttons on mobile */
  .meetup-list-actions .btn,
  .page-actions .btn,
  .action-grid .btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    min-height: 36px;
  }
}

/* Form Mobile Improvements */
@media (max-width: 640px) {

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
    min-height: 44px;
  }

  .form-section {
    margin-bottom: var(--space-6);
  }
}

/* Table Actions Mobile */
@media (max-width: 768px) {
  .data-card-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--space-2);
  }

  .data-card-footer .btn {
    width: 100%;
  }
}

.filter-section {
  padding-block: 24px;
}
