:root {
  --md-bg: #eef1f8;
  --md-surface: #ffffff;
  --md-surface-alt: #f8f9ff;
  --md-primary: #1a73e8;
  --md-primary-dark: #0f4ab7;
  --md-secondary: #ff8a65;
  --md-tertiary: #8e24aa;
  --md-success: #2e7d32;
  --md-danger: #d32f2f;
  --md-warning: #f9a825;
  --md-text-primary: #1f2937;
  --md-text-muted: #6b7280;
  --md-radius-lg: 20px;
  --md-radius: 14px;
  --md-shadow-soft: 0 22px 45px rgba(15, 76, 129, 0.08);
  --md-shadow-card: 0 18px 40px rgba(17, 24, 39, 0.12);
  --md-shadow-hover: 0 22px 50px rgba(26, 115, 232, 0.18);
}

@font-face {
  font-family: 'Material Icons Outlined';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('/fonts/material-icons/MaterialIconsOutlined.otf') format('opentype');
}

@font-face {
  font-family: 'Material Icons Round';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('/fonts/material-icons/MaterialIconsRound.otf') format('opentype');
}

* {
  box-sizing: border-box;
}

body, html {
  min-height: 100vh;
}

body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background: var(--md-bg);
  color: var(--md-text-primary);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

.material-icons-outlined,
.material-icons-round {
  vertical-align: middle;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
}

.material-icons-outlined {
  font-family: 'Material Icons Outlined';
}

.material-icons-round {
  font-family: 'Material Icons Round';
}

.page {
  min-height: 100vh;
}

.md-body {
  position: relative;
}

/* ========================================
   Animated Mesh Gradient Background
   ======================================== */
.mesh-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(135deg, #eef1f8 0%, #f0f4ff 50%, #fef5f1 100%);
  overflow: hidden;
}

.mesh-gradient {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  opacity: 0.5;
  animation: meshFloat 15s infinite ease-in-out;
  will-change: transform;
}

.mesh-gradient-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(26, 115, 232, 0.4), transparent 70%);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
}

.mesh-gradient-2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(142, 36, 170, 0.35), transparent 70%);
  top: 50%;
  right: -15%;
  animation-delay: 8s;
}

.mesh-gradient-3 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 138, 101, 0.3), transparent 70%);
  bottom: -10%;
  left: 35%;
  animation-delay: 16s;
}

@keyframes meshFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  25% {
    transform: translate(80px, -80px) scale(1.15) rotate(5deg);
  }
  50% {
    transform: translate(-60px, 60px) scale(0.95) rotate(-3deg);
  }
  75% {
    transform: translate(60px, 40px) scale(1.05) rotate(3deg);
  }
}

/* Optimisation pour mobile */
@media (max-width: 768px) {
  .mesh-gradient {
    filter: blur(60px);
  }

  .mesh-gradient-1 {
    width: 400px;
    height: 400px;
  }

  .mesh-gradient-2 {
    width: 450px;
    height: 450px;
  }

  .mesh-gradient-3 {
    width: 350px;
    height: 350px;
  }
}

/* Réduction d'animation pour accessibilité */
@media (prefers-reduced-motion: reduce) {
  .mesh-gradient {
    animation: none;
  }
}

/* Toasts */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1090;
}

.toast .toast-body {
  font-weight: 500;
}

/* Login */
.md-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: transparent;
}

.md-login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--md-radius-lg);
  padding: 2.75rem 2.25rem;
  box-shadow: 0 25px 50px rgba(26, 115, 232, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.3) inset;
}

.md-login-head {
  margin-bottom: 2rem;
}

.md-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, rgba(26, 115, 232, 1), rgba(10, 61, 200, 1));
  margin-bottom: 1rem;
  font-size: 28px;
}

.md-login-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.md-login-subtitle {
  color: var(--md-text-muted);
  margin-bottom: 1.5rem;
}

.md-language-switcher {
  display: inline-flex;
  justify-content: center;
}

.md-login-form .form-control {
  border-radius: 12px;
  padding: 0.75rem 1rem;
}

.md-login-action {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.85rem 1rem;
  box-shadow: 0 12px 30px rgba(26, 115, 232, 0.35);
}

.md-login-footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  text-align: center;
}

/* Dashboard layout */
.md-dashboard {
  padding: 2rem 0 3rem;
}

.md-app-container {
  margin: 0 auto;
  max-width: 1320px;
  padding: 0 1.5rem;
}

.md-appbar {
  background: linear-gradient(135deg, #1a73e8, #4f46e5);
  border-radius: var(--md-radius-lg);
  padding: 1.8rem 2.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  color: #fff;
  margin-bottom: 2.5rem;
}

.md-appbar-primary {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.md-appbar-title {
  font-weight: 700;
  margin: 0;
}

.md-appbar-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.md-appbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.md-lang-selector {
  min-width: 120px;
  border-radius: 12px;
  border: none;
  box-shadow: 0 5px 20px rgba(15, 76, 129, 0.1);
}

.md-icon-button {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.md-icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.md-main {
  padding-bottom: 1rem;
}

/* Metric cards */
.md-metric-card {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1.6rem 1.8rem;
  border-radius: var(--md-radius-lg);
  background: var(--md-surface);
  box-shadow: var(--md-shadow-soft);
  height: 100%;
}

.md-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 26px;
}

.md-gradient-primary {
  background: linear-gradient(135deg, #1a73e8, #0f4ab7);
}

.md-gradient-secondary {
  background: linear-gradient(135deg, #ff8a65, #f4511e);
}

.md-gradient-tertiary {
  background: linear-gradient(135deg, #8e24aa, #5e35b1);
}

.md-metric-label {
  margin: 0;
  color: var(--md-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.md-metric-value {
  margin: 0.25rem 0 0;
  font-size: 1.9rem;
  font-weight: 700;
}

.md-metric-card--next .md-metric-stack {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.md-metric-value--compact {
  font-size: 1.4rem;
  line-height: 1.25;
}

.md-metric-subvalue {
  margin: 0;
  color: var(--md-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Cards */
.md-card {
  border-radius: var(--md-radius-lg);
  background: var(--md-surface);
  box-shadow: var(--md-shadow-soft);
  overflow: visible;
}

.md-card-header {
  padding: 1.8rem 2rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.md-card-title {
  margin: 0;
  font-weight: 600;
}

.md-card-subtitle {
  margin: 0.35rem 0 0;
  color: var(--md-text-muted);
}

.md-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.md-card-body {
  padding: 0 2rem 2rem;
}

.md-elevated {
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 15px 30px rgba(26, 115, 232, 0.25);
}

.md-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(26, 115, 232, 0.12);
  color: #1a73e8;
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Tables */
.md-table-shell {
  border-radius: var(--md-radius);
  background: var(--md-surface);
  overflow: visible;
}

.table thead th {
  border: none;
  background: var(--md-surface-alt);
  color: var(--md-text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.95rem 1.2rem;
}

.table tbody tr {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.table tbody td {
  border: none;
  padding: 1.15rem 1.2rem;
  vertical-align: middle;
}

.table tbody td code {
  color: var(--md-primary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.table tbody tr:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(15, 76, 129, 0.12);
}

.table-responsive {
  overflow-x: auto;
  overflow-y: visible;
}

/* Hide mobile cards on desktop */
.mobile-channel-cards {
  display: none;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

.status-indicator .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge {
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-cron {
  background: rgba(26, 115, 232, 0.12);
  color: var(--md-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.table-actions .dropdown-menu {
  border-radius: 14px;
  border: none;
  box-shadow: 0 18px 32px rgba(15, 76, 129, 0.18);
  padding: 0.45rem;
  z-index: 2000;
}

.table-actions .dropdown-item {
  border-radius: 10px;
  font-weight: 500;
  padding: 0.55rem 0.9rem;
}

.table-actions .dropdown {
  position: relative;
  z-index: 1;
}

tbody tr.dropdown-open-row {
  position: relative;
  z-index: 3000;
}

.table-actions .dropdown-item:hover {
  background: rgba(26, 115, 232, 0.08);
}

.table-actions .dropdown-toggle::after {
  display: none;
}

.no-data {
  color: var(--md-text-muted);
  font-size: 0.95rem;
}

/* Logs table background states */
#logs-table tbody tr.success {
  background: rgba(46, 125, 50, 0.08);
}

#logs-table tbody tr.error {
  background: rgba(211, 47, 47, 0.08);
}

#logs-table tbody tr.pending,
#logs-table tbody tr.started,
#logs-table tbody tr.running {
  background: rgba(26, 115, 232, 0.08);
}

#logs-table tbody tr.cancelled {
  background: rgba(107, 114, 128, 0.1);
}

/* Pagination */
.md-pagination .page-link {
  border-radius: 999px;
  border: none;
  padding: 0.45rem 0.85rem;
  color: var(--md-text-primary);
}

.md-pagination .page-item.active .page-link {
  background: var(--md-primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(26, 115, 232, 0.35);
}

.md-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Buttons overrides */
.btn-primary {
  background: linear-gradient(135deg, #1a73e8, #0f4ab7);
  border: none;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0f4ab7, #0a2f91);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.btn-light {
  background: rgba(255, 255, 255, 0.18);
  border: none;
  color: #fff;
}

.btn-light:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

/* Dropdown fallback positioning */
.table-actions .dropdown-menu.show {
  display: block;
}

/* Modal tweaks */
.modal-content {
  border-radius: var(--md-radius);
  border: none;
  box-shadow: var(--md-shadow-card);
}

.modal-header {
  border-bottom: none;
}

.modal-footer {
  border-top: none;
}

/* Settings modal */
.md-settings-modal .modal-dialog,
.md-channel-modal .modal-dialog {
  max-width: 640px;
}

.md-settings-modal .modal-content,
.md-channel-modal .modal-content {
  border-radius: 28px;
  border: none;
  box-shadow: 0 30px 60px rgba(15, 76, 129, 0.2);
  background: linear-gradient(135deg, rgba(240, 244, 255, 0.95), #ffffff);
}

.md-settings-form .modal-header {
  border-bottom: none;
  padding: 2rem 2.4rem 1.2rem;
}

.md-settings-form .modal-header .modal-title {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 0;
}

.md-settings-subtitle {
  margin: 0.4rem 0 0;
  color: #5f6b7a;
  font-size: 0.95rem;
}

.md-settings-body {
  padding: 0 2.4rem 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.md-settings-section {
  background: #fff;
  border-radius: 20px;
  padding: 1.4rem 1.6rem;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.12);
  border: 1px solid rgba(26, 115, 232, 0.06);
}

.md-settings-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.1rem;
}

.md-settings-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  background: linear-gradient(135deg, #1a73e8, #0f4ab7);
}

.md-settings-icon--polling {
  background: linear-gradient(135deg, #ff8a65, #f4511e);
}

.md-settings-icon--security {
  background: linear-gradient(135deg, #8e24aa, #5e35b1);
}

.md-channel-icon--info {
  background: linear-gradient(135deg, #1a73e8, #0f4ab7);
}

.md-channel-icon--schedule {
  background: linear-gradient(135deg, #fb8c00, #f4511e);
}

.md-channel-icon--limits {
  background: linear-gradient(135deg, #10b981, #047857);
}

.md-channel-icon--notifications {
  background: linear-gradient(135deg, #8e24aa, #5e35b1);
}

.md-settings-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.md-settings-description {
  margin: 0.15rem 0 0;
  color: var(--md-text-muted);
  font-size: 0.9rem;
}

.md-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.md-field:last-of-type {
  margin-bottom: 0;
}

.md-field-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.md-field-input {
  border-radius: 12px;
  border: 1px solid rgba(26, 115, 232, 0.18);
  padding: 0.7rem 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.md-field-input:focus {
  border-color: #1a73e8;
  box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.15);
}

.md-field .form-text {
  color: var(--md-text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.md-settings-footer {
  border-top: none;
  padding: 1.6rem 2.4rem 2.2rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.md-cron-preview {
  margin: 0;
  color: #5f6b7a;
  font-size: 0.85rem;
  font-style: italic;
}

.md-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.md-switch-title {
  margin: 0;
  font-weight: 600;
}

.md-switch-description {
  margin: 0.25rem 0 0;
  color: var(--md-text-muted);
  font-size: 0.85rem;
}

/* Footer */
.md-footer {
  margin-top: 3rem;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 992px) {
  .md-appbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .md-appbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .md-card-body {
    padding: 0 1.5rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .md-app-container {
    padding: 0 1rem;
  }

  .md-appbar {
    padding: 1.5rem 1.7rem;
  }

  .table-responsive {
    margin-bottom: 1.25rem;
  }

  .md-metric-card {
    padding: 1.35rem 1.45rem;
  }
}

@media (max-width: 576px) {
  .md-login-card {
    padding: 2.25rem 1.75rem;
  }

  .md-appbar-actions {
    gap: 0.5rem;
  }
}

/* Mobile optimizations (phone-specific) */
@media (max-width: 767px) {
  /* Typography improvements */
  body {
    font-size: 15px;
  }

  .table thead th {
    font-size: 0.8rem;
    padding: 0.85rem 1rem;
  }

  .table tbody td {
    font-size: 0.9rem;
    padding: 1rem;
  }

  /* Toast container positioning */
  .toast-container {
    top: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .toast {
    width: 100%;
  }

  /* AppBar improvements */
  .md-appbar {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
  }

  .md-appbar-title {
    font-size: 1.35rem;
  }

  .md-appbar-subtitle {
    font-size: 0.85rem;
  }

  .md-icon-button {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .md-icon-button .material-icons-outlined {
    font-size: 20px;
  }

  /* Metric cards mobile - Grid layout: Row 1: Chaînes actives + Jobs surveillés, Row 2: Prochaine exécution full width */
  #dashboard-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 0.75rem;
    row-gap: 0.35rem;
    margin-bottom: 2rem;
  }

  /* Reduce space above Prochaine exécution card */
  #dashboard-metrics > .col-12:nth-child(2) .md-metric-card {
    margin-top: 0;
  }

  /* Chaînes actives - top left */
  #dashboard-metrics > .col-12:nth-child(1) {
    grid-column: span 1;
    order: 1;
  }

  /* Prochaine exécution - bottom full width */
  #dashboard-metrics > .col-12:nth-child(2) {
    grid-column: 1 / -1;
    order: 3;
  }

  /* Jobs surveillés - top right */
  #dashboard-metrics > .col-12:nth-child(3) {
    grid-column: span 1;
    order: 2;
  }

  .md-metric-card {
    padding: 1rem 1.1rem;
    gap: 0.85rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .md-metric-icon {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .md-metric-label {
    font-size: 0.7rem;
    margin-bottom: 0.15rem;
  }

  .md-metric-value {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .md-metric-card--next .md-metric-stack {
    width: 100%;
  }

  .md-metric-value--compact {
    font-size: 1.1rem;
  }

  .md-metric-subvalue {
    font-size: 0.8rem;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
  }

  /* Card improvements */
  .md-card {
    border-radius: 16px;
    margin-top: 0;
  }

  .md-card:first-of-type {
    margin-top: 0;
  }

  .md-card-header {
    padding: 1.5rem 1.5rem 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .md-card-title {
    font-size: 1.15rem;
  }

  .md-card-subtitle {
    font-size: 0.85rem;
  }

  .md-card-actions {
    width: 100%;
    margin-left: 0;
    margin-top: 0.75rem;
  }

  .md-card-body {
    padding: 0 1.5rem 1.5rem;
  }

  /* Mobile card view for channels table */
  #channels-table {
    display: none;
  }

  .md-table-shell {
    background: transparent;
  }

  /* Mobile channel cards */
  .mobile-channel-cards {
    display: flex !important;
    flex-direction: column;
    gap: 1rem;
  }

  .mobile-channel-card {
    background: var(--md-surface);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 8px 20px rgba(15, 76, 129, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }

  .mobile-channel-card:active {
    transform: scale(0.98);
  }

  .mobile-channel-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.75rem;
  }

  .mobile-channel-card-title {
    flex: 1;
  }

  .mobile-channel-card-title h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--md-text-primary);
  }

  .mobile-channel-card-title .channel-id {
    font-size: 0.8rem;
    color: var(--md-text-muted);
    font-family: monospace;
    word-break: break-all;
  }

  .mobile-channel-card-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    white-space: nowrap;
  }

  .mobile-channel-card-status.text-success {
    background: rgba(46, 125, 50, 0.12);
    color: var(--md-success);
  }

  .mobile-channel-card-status.text-danger {
    background: rgba(211, 47, 47, 0.12);
    color: var(--md-danger);
  }

  .mobile-channel-card-status .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: currentColor;
  }

  .mobile-channel-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(26, 115, 232, 0.1);
  }

  .mobile-channel-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .mobile-channel-info-label {
    font-size: 0.75rem;
    color: var(--md-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
  }

  .mobile-channel-info-value {
    font-size: 0.9rem;
    color: var(--md-text-primary);
    font-weight: 500;
  }

  .mobile-channel-info-value code {
    background: rgba(26, 115, 232, 0.08);
    color: var(--md-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
  }

  .mobile-channel-card-schedule {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.85rem;
    background: var(--md-surface-alt);
    border-radius: 12px;
  }

  .mobile-channel-schedule-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
  }

  .mobile-channel-schedule-label {
    color: var(--md-text-muted);
    font-weight: 500;
  }

  .mobile-channel-schedule-value {
    color: var(--md-text-primary);
    font-weight: 600;
    text-align: right;
  }

  .mobile-channel-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    align-items: stretch;
  }

  .mobile-channel-card-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    white-space: nowrap;
  }

  .mobile-channel-card-actions .btn:last-child {
    padding: 0.7rem 0.95rem;
    min-width: auto;
  }

  .mobile-channel-card-actions .btn .material-icons-outlined {
    font-size: 18px;
  }

  .mobile-channel-card-actions .btn span:not(.material-icons-outlined) {
    display: inline;
  }

  /* Mobile logs table improvements */
  #logs-table thead th,
  #logs-table tbody td {
    font-size: 0.8rem;
    padding: 0.75rem 0.5rem;
  }

  #logs-table tbody td.text-break {
    word-break: break-word;
    max-width: 150px;
  }

  /* Mobile settings/channel modals */
  .md-settings-modal .modal-dialog,
  .md-channel-modal .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .md-settings-modal .modal-content,
  .md-channel-modal .modal-content {
    border-radius: 20px;
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
  }

  .md-settings-form .modal-header {
    padding: 1.5rem 1.5rem 1rem;
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, rgba(240, 244, 255, 0.98), rgba(255, 255, 255, 0.98));
    z-index: 1;
    backdrop-filter: blur(10px);
  }

  .md-settings-form .modal-header .modal-title {
    font-size: 1.25rem;
  }

  .md-settings-subtitle {
    font-size: 0.85rem;
  }

  .md-settings-body {
    padding: 0 1.5rem 1.5rem;
    gap: 1.25rem;
  }

  .md-settings-section {
    padding: 1.2rem 1.3rem;
    border-radius: 16px;
  }

  .md-settings-header {
    margin-bottom: 0.9rem;
  }

  .md-settings-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .md-settings-title {
    font-size: 0.95rem;
  }

  .md-settings-description {
    font-size: 0.8rem;
  }

  .md-field-label {
    font-size: 0.9rem;
  }

  .md-field-input {
    font-size: 0.95rem;
    padding: 0.75rem 0.85rem;
  }

  .md-settings-footer {
    padding: 1.25rem 1.5rem 1.5rem;
    position: sticky;
    bottom: 0;
    background: linear-gradient(135deg, rgba(240, 244, 255, 0.98), rgba(255, 255, 255, 0.98));
    backdrop-filter: blur(10px);
  }

  /* Touch-friendly buttons */
  .btn {
    min-height: 44px;
    padding: 0.7rem 1.2rem;
  }

  .btn-sm {
    min-height: 38px;
  }

  .md-elevated {
    padding: 0.75rem 1.35rem;
  }

  /* Dropdown improvements for mobile */
  .table-actions .dropdown-toggle {
    min-width: 44px;
    min-height: 44px;
    padding: 0.6rem;
  }

  .table-actions .dropdown-menu {
    min-width: 200px;
  }

  .table-actions .dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  /* Badge improvements */
  .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .md-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }

  /* Pagination mobile */
  .md-pagination .page-link {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Login improvements */
  .md-login {
    padding: 1.5rem 1rem;
  }

  .md-login-card {
    padding: 2rem 1.5rem;
  }

  .md-brand-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .md-login-title {
    font-size: 1.5rem;
  }

  .md-login-subtitle {
    font-size: 0.9rem;
  }

  /* Status indicator */
  .status-indicator {
    font-size: 0.85rem;
  }

  .status-indicator .dot {
    width: 8px;
    height: 8px;
  }
}

/* Extra small mobile (< 360px) */
@media (max-width: 359px) {
  .mobile-channel-card-actions {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }

  .mobile-channel-card-actions .btn:first-child {
    grid-column: 1 / -1;
  }

  .mobile-channel-card-actions .btn span:not(.material-icons-outlined) {
    font-size: 0.8rem;
  }

  .md-card-header {
    padding: 1.25rem 1.25rem 0.85rem;
  }

  .md-card-body {
    padding: 0 1.25rem 1.25rem;
  }

  .mobile-channel-card {
    padding: 1rem;
  }
}
