/* =====================================================
   PÉPINIÈRE DU ROUGE-GORGE — Administration Stylesheet
   ===================================================== */

:root {
  /* Design Tokens - Harmonisés avec la charte graphique */
  --color-orange:       #FF6C36;
  --color-orange-hover: #e0531e;
  --color-peach:        #FFE0D5;
  --color-peach-light:  #FFF5F1;
  --color-green:        #7DCE58;
  --color-green-hover:  #68b943;
  --color-blue:         #89DCFF;
  --color-brown:        #763B07;
  --color-brown-dark:   #4A2200;
  --color-gray-dark:    #4A4A4A;
  --color-gray-medium:  #9E9E9E;
  --color-gray-light:   #EAEAEA;
  --color-white:        #FFFFFF;
  --color-bg:           #FAF6F0;
  
  /* System colors for admin */
  --color-success:      #10B981;
  --color-warning:      #F59E0B;
  --color-danger:       #EF4444;
  --color-info:         #3B82F6;

  /* Typography */
  --font-title:         'Amatic SC', cursive;
  --font-body:          'Inter', sans-serif;

  /* Shadows and curves */
  --shadow-sm:          0 1px 3px rgba(118, 59, 7, 0.05);
  --shadow-md:          0 4px 6px -1px rgba(118, 59, 7, 0.08), 0 2px 4px -1px rgba(118, 59, 7, 0.04);
  --shadow-lg:          0 10px 15px -3px rgba(118, 59, 7, 0.1), 0 4px 6px -2px rgba(118, 59, 7, 0.05);
  --shadow-premium:     0 20px 40px rgba(118, 59, 7, 0.12);
  --radius-sm:          6px;
  --radius-md:          12px;
  --radius-lg:          20px;
  
  --transition-fast:    0.15s ease;
  --transition-normal:  0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Resets & Base Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-brown);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* --- Loader Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(118, 59, 7, 0.1);
  border-top-color: var(--color-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Authentication Screen --- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at top left, var(--color-peach-light), var(--color-peach));
}

.login-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  width: 100%;
  max-width: 440px;
  padding: 40px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 108, 54, 0.15);
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--color-orange), var(--color-green));
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo img {
  height: 70px;
  width: auto;
}

.login-card h1 {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-brown);
  margin-bottom: 8px;
}

.login-card p.subtitle {
  text-align: center;
  color: var(--color-gray-dark);
  font-size: 0.95rem;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: var(--color-brown);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper input {
  width: 100%;
  padding: 12px 16px;
  padding-right: 44px;
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--radius-md);
  outline: none;
  font-size: 1rem;
  background-color: var(--color-peach-light);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-icon-wrapper input:focus {
  border-color: var(--color-orange);
  box-shadow: 0 0 0 3px rgba(255, 108, 54, 0.15);
}

.toggle-password-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-gray-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.toggle-password-btn:hover {
  color: var(--color-brown);
}

.btn-primary {
  width: 100%;
  background-color: var(--color-orange);
  color: var(--color-white);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 4px 6px rgba(255, 108, 54, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover {
  background-color: var(--color-orange-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
  box-shadow: 0 4px 6px rgba(255, 108, 54, 0.2), 0 0 0 4px rgba(255, 108, 54, 0.12);
}

.btn-primary:disabled {
  background-color: var(--color-gray-medium);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-orange);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: color var(--transition-fast);
  display: inline-block;
  margin-top: 15px;
}

.btn-link:hover {
  color: var(--color-orange-hover);
}

.btn-link:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
  border-radius: 3px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  border-top: 1px solid var(--color-gray-light);
  padding-top: 16px;
}

.error-message {
  background-color: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: none;
  align-items: center;
  gap: 8px;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* --- Admin Layout --- */
.admin-container {
  display: none; /* Révélé en JS après authentification */
  min-height: 100vh;
  grid-template-columns: 280px 1fr;
}

@media (max-width: 1024px) {
  .admin-container {
    grid-template-columns: 210px 1fr;
  }
}

@media (max-width: 860px) {
  .admin-container {
    grid-template-columns: 68px 1fr;
  }
}

@media (max-width: 768px) {
  .admin-container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* --- Sidebar --- */
.sidebar {
  background: linear-gradient(180deg, var(--color-brown-dark) 0%, var(--color-brown) 100%);
  color: var(--color-white);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.sidebar-header img {
  height: 40px;
  width: auto;
  background-color: var(--color-white);
  border-radius: 50%;
  padding: 4px;
}

.sidebar-header-text h2 {
  font-family: var(--font-title);
  font-size: 1.8rem;
  line-height: 1;
  color: var(--color-peach);
  letter-spacing: 0.05em;
}

.sidebar-header-text p {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 1024px) {
  .sidebar-header-text h2 {
    font-size: 1.4rem;
  }
  .sidebar-header-text p {
    display: none;
  }
  .sidebar-header {
    padding-bottom: 16px;
  }
}

@media (max-width: 860px) {
  .sidebar-header-text {
    display: none;
  }
  .sidebar-header {
    justify-content: center;
  }
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
}

.nav-item.active {
  background-color: var(--color-orange);
  color: var(--color-white);
  box-shadow: 0 4px 12px rgba(255, 108, 54, 0.3);
}

.nav-item:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
}

.nav-label {
  transition: opacity var(--transition-fast);
}

@media (max-width: 1024px) {
  .nav-item {
    padding: 10px 12px;
    gap: 8px;
    font-size: 0.88rem;
  }
}

/* Tablet-only icon rail: narrow sidebar, icons + hover tooltip. Scoped to
   stop at 769px so it doesn't fight the phone hamburger-drawer styles
   below 768px, which show full labels instead. */
@media (min-width: 769px) and (max-width: 860px) {
  .nav-label {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
    font-size: 1rem;
    gap: 0;
    position: relative;
  }
  .nav-item::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-brown-dark);
    color: var(--color-white);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
    z-index: 50;
    box-shadow: var(--shadow-sm);
  }
  .nav-item:hover::after {
    opacity: 1;
  }
  .nav-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    margin-left: 0 !important;
    min-width: 16px;
    height: 16px;
    padding: 0 4px !important;
    font-size: 0.65rem !important;
  }
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 16px;
}

/* Wraps .nav-menu + .sidebar-footer so the mobile drawer can show/hide and
   position both as one unit. display:contents keeps it invisible to layout
   on desktop, so .nav-menu and .sidebar-footer act as direct flex children
   of .sidebar exactly as before (nav-menu grows, footer sticks to bottom). */
.sidebar-drawer {
  display: contents;
}

.sidebar-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.sidebar-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.sidebar-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.sidebar-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.sidebar-hamburger:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
}

/* Dims the page behind the open mobile drawer so it reads as a temporary
   overlay rather than content silently appearing on top. Hidden entirely
   outside the phone breakpoint since the drawer never opens there. */
.sidebar-backdrop {
  display: none;
}

/* Moved after the base sidebar rules on purpose: a max-width media query
   only wins the cascade if it's declared after the rule it overrides —
   this block used to sit above .sidebar's base declaration, so the plain
   (always-on) rule always won and the mobile layout below never applied. */
@media (max-width: 768px) {
  .sidebar {
    flex-direction: row;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  }
  .sidebar-header {
    border-bottom: none;
    margin-bottom: 0;
    padding: 0;
    flex-shrink: 0;
    width: 100%;
  }
  .sidebar-header img {
    height: 32px;
  }
  .sidebar-header-text {
    display: none;
  }

  .sidebar-hamburger {
    display: flex;
    margin-left: auto;
  }

  /* Closed: kept out of layout and non-interactive, faded/shifted up a touch.
     Open: becomes a real positioned box (instead of display:contents) that
     drops down below the compact top bar, holding the full nav — icon and
     label both — plus the logout link. Animated via opacity/transform (not
     display) so the drawer can transition instead of snapping open. */
  .sidebar-drawer {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-brown-dark);
    padding: 10px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    transform: translateY(-6px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-normal), transform var(--transition-normal),
      visibility 0s linear 0.25s;
  }
  .sidebar.nav-open .sidebar-drawer {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0);
    /* Must stay below .sidebar's z-index (10) — .sidebar is a positioned
       stacking context, so anything above it here also covers its drawer
       (z-index: 100 there only wins comparisons inside that context). A
       higher value here previously sat on top of the whole sidebar and
       silently swallowed clicks meant for the nav links. */
    z-index: 9;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: background-color var(--transition-normal), opacity var(--transition-normal),
      visibility 0s linear 0.25s;
  }
  .sidebar-backdrop.visible {
    background-color: rgba(0, 0, 0, 0.35);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: background-color var(--transition-normal), opacity var(--transition-normal);
  }

  .nav-menu {
    flex-direction: column;
    gap: 4px;
  }
  .nav-item {
    padding: 13px 14px;
    font-size: 1rem;
  }
  .nav-item svg {
    width: 22px;
    height: 22px;
  }

  .sidebar-footer {
    margin-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 10px;
  }
  .logout-link {
    width: 100%;
    padding: 13px 14px;
  }
}

/* --- Main Content Area --- */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
}

.top-bar {
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-gray-light);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .top-bar {
    padding: 12px 16px;
    gap: 12px;
  }
}

.top-bar h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

@media (max-width: 480px) {
  .top-bar h1 {
    font-size: 1.05rem;
  }
  /* Keep the link as an icon-only tap target so a long tab title never
     collides with it; the label stays in the accessible name. */
  .live-site-link span {
    display: none;
  }
}

.top-bar-actions {
  display: none;
  align-items: center;
  gap: 16px;
}

.top-bar-actions.visible {
  display: flex;
}

.live-site-link {
  color: var(--color-orange);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-site-link:hover {
  text-decoration: underline;
}

.content-body {
  padding: 32px;
  flex-grow: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .content-body {
    padding: 20px;
  }
}

/* --- Tab Panels --- */
.tab-panel {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Dashboard Overview Tab --- */
.welcome-card {
  background: linear-gradient(135deg, var(--color-peach-light) 0%, var(--color-peach) 100%);
  border-radius: var(--radius-lg);
  padding: 32px;
  border: 1px solid rgba(255, 108, 54, 0.1);
  margin-bottom: 32px;
  position: relative;
}

.welcome-card h2 {
  font-family: var(--font-title);
  font-size: 2.8rem;
  color: var(--color-brown-dark);
  margin-bottom: 8px;
}

.welcome-card p {
  color: var(--color-brown);
  max-width: 600px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(118, 59, 7, 0.04);
  transition: transform var(--transition-fast);
}

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

.stat-card:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
  box-shadow: var(--shadow-md), 0 0 0 4px rgba(255, 108, 54, 0.12);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon.orange { background-color: rgba(255, 108, 54, 0.1); color: var(--color-orange); }
.stat-icon.green { background-color: rgba(125, 206, 88, 0.1); color: var(--color-green); }
.stat-icon.blue { background-color: rgba(137, 220, 255, 0.15); color: #00A6EB; }

.stat-icon svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.stat-info h3 {
  font-size: 0.85rem;
  color: var(--color-gray-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-val {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}


.card {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(118, 59, 7, 0.03);
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.diagnostic-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}



/* --- Messages Tab --- */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-light);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background-color: var(--color-white);
}

.admin-table th {
  background-color: var(--color-peach-light);
  padding: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-brown);
  border-bottom: 2px solid var(--color-gray-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: 16px;
  border-bottom: 1px solid var(--color-gray-light);
  vertical-align: top;
}

.admin-table tr:hover td {
  background-color: #FAF9F6;
}

.table-actions-cell {
  text-align: right;
}

@media (max-width: 640px) {
  .table-actions-cell {
    text-align: left;
  }
  /* A wide data table doesn't fit a phone screen; stack each row into its
     own labeled card instead of relying on horizontal scroll, which hides
     columns with no visual cue that there's more to see. Requires each
     <td> to carry a data-label attribute (see js/admin.js). */
  .table-responsive {
    overflow-x: visible;
    border: none;
  }
  .admin-table thead {
    display: none;
  }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
    display: block;
    width: 100%;
  }
  .admin-table tr {
    background-color: var(--color-white);
    border: 1px solid var(--color-gray-light);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
  }
  .admin-table tr:last-child {
    margin-bottom: 0;
  }
  .admin-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-gray-light);
  }
  .admin-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .admin-table td:first-child {
    padding-top: 0;
  }
  .admin-table td:not([data-label]) {
    display: none;
  }
  .admin-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-gray-medium);
    margin-bottom: 6px;
  }
}

.email-link {
  font-weight: 600;
  color: var(--color-orange);
  text-decoration: none;
}

.email-link:hover {
  text-decoration: underline;
}

.message-date {
  font-size: 0.8rem;
  color: var(--color-gray-medium);
}

.message-text {
  font-size: 0.9rem;
  color: var(--color-gray-dark);
  white-space: pre-line;
  max-width: 400px;
}

/* Statut Select Styles */
.status-badge-select {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
}

.status-badge-select.status-nouveau {
  background-color: rgba(59, 130, 246, 0.1);
  color: var(--color-info);
}

.status-badge-select.status-encours {
  background-color: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.status-badge-select.status-traite {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

/* Notes Textarea in Table */
.notes-textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 0.85rem;
  resize: vertical;
  background-color: var(--color-peach-light);
  outline: none;
  transition: border-color var(--transition-fast);
}

.notes-textarea:focus {
  border-color: var(--color-orange);
  background-color: var(--color-white);
}

/* Action Buttons */
.btn-action-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1.5px solid var(--color-orange);
  color: var(--color-orange);
  background: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-action-outline:hover {
  background-color: var(--color-orange);
  color: var(--color-white);
}

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

.btn-action-outline:disabled {
  border-color: var(--color-gray-medium);
  color: var(--color-gray-medium);
  cursor: not-allowed;
}

.btn-action-outline svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* --- Catalogue Tab --- */
.catalogue-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

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

.catalogue-actions-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 480px) {
  /* flex-end reads fine once there's room to wrap onto a couple of rows,
     but on a phone-width column stack it leaves a lopsided empty gap on
     the left of every wrapped row. */
  .catalogue-actions-buttons {
    justify-content: flex-start;
  }
}

.search-input-wrapper {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-input-wrapper input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--radius-md);
  outline: none;
  background-color: var(--color-white);
  transition: border-color var(--transition-fast);
}

.search-input-wrapper input:focus {
  border-color: var(--color-orange);
}

.search-input-wrapper svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-gray-medium);
}

.filter-select {
  padding: 10px 16px;
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  outline: none;
  cursor: pointer;
  font-weight: 500;
}

.filter-select:focus {
  border-color: var(--color-orange);
}

/* --- Catalogue view toggle --- */
.view-toggle {
  display: flex;
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.view-toggle-btn {
  background: none;
  border: none;
  padding: 7px 10px;
  cursor: pointer;
  color: var(--color-gray-medium);
  display: flex;
  align-items: center;
  transition: color var(--transition-fast), background-color var(--transition-fast);
}

.view-toggle-btn.active {
  background-color: var(--color-orange);
  color: var(--color-white);
}

.view-toggle-btn:not(.active):hover {
  background-color: var(--color-gray-light);
  color: var(--color-brown);
}

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

/* --- Catalogue table view --- */
.plant-table-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  display: block;
}

.plant-table-name {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
}

.plant-table-species {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--color-gray-medium);
  margin-top: 1px;
}

.plants-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.plant-admin-card {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(118, 59, 7, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast);
}

.plant-admin-card:hover {
  transform: translateY(-2px);
}

.plant-admin-img {
  height: 160px;
  width: 100%;
  overflow: hidden;
  position: relative;
  background-color: var(--color-peach);
}

.plant-admin-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plant-admin-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}


.plant-admin-body {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.plant-admin-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.plant-admin-species {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--color-gray-medium);
  margin-bottom: 12px;
}

.plant-admin-desc {
  font-size: 0.85rem;
  color: var(--color-gray-dark);
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em;
}

.plant-admin-toggles {
  margin-top: auto;
  border-top: 1px solid var(--color-gray-light);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* iOS Style Switch */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toggle-row span {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
}

.star-btn,
.star-card-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--color-gray-medium);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.2s, transform 0.15s;
  border-radius: 4px;
}

.star-btn:hover,
.star-card-btn:hover {
  color: var(--color-orange);
  transform: scale(1.15);
}

.star-btn[aria-pressed="true"],
.star-card-btn[aria-pressed="true"] {
  color: var(--color-green);
}

.star-btn:focus-visible,
.star-card-btn:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-gray-medium);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: var(--color-green);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* --- Textes du Site Tab --- */
.section-accordion {
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-light);
  overflow: hidden;
}

.accordion-header {
  padding: 18px 24px;
  background-color: var(--color-peach-light);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: background-color var(--transition-fast);
}

.accordion-header:hover {
  background-color: var(--color-peach);
}

.accordion-header-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-section-icon {
  opacity: 0.65;
  flex-shrink: 0;
}

.accordion-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.accordion-content-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-gray-medium);
  background-color: rgba(0,0,0,0.05);
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.accordion-icon {
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

.section-accordion.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 24px;
  display: none;
  border-top: 1px solid var(--color-gray-light);
}

.section-accordion.active .accordion-body {
  display: block;
}

.text-edit-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-subgroup-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: -4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-gray-medium);
  text-transform: uppercase;
}

.field-subgroup-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-gray-light);
}

/* Hours group block */
.hours-group-block {
  background: var(--color-white);
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.hours-group-label {
  padding: 10px 16px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-gray-medium);
  border-bottom: 1px solid var(--color-gray-light);
  background: var(--color-peach-light);
}

.hours-group-block .editable-item {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--color-gray-light);
  background: transparent;
  padding: 14px 16px;
}

.hours-group-block .editable-item:last-child {
  border-bottom: none;
}

/* Social network rows */
.social-network-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
}

.social-network-icon-col {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-gray-light);
  flex-shrink: 0;
  color: var(--color-gray-dark);
}

.social-network-body {
  flex: 1;
  min-width: 0;
}

.social-network-toprow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.social-network-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-black);
}

.social-network-visibility {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.social-toggle-label {
  font-size: 0.75rem;
  color: var(--color-gray-medium);
}

.editable-item {
  background-color: var(--color-peach-light);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid rgba(255, 108, 54, 0.05);
}

.editable-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.editable-item-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.editable-item-key {
  font-size: 0.75rem;
  color: var(--color-gray-medium);
  font-family: monospace;
}

.input-control {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--color-gray-light);
  border-radius: var(--radius-sm);
  outline: none;
  background-color: var(--color-white);
  transition: border-color var(--transition-fast);
  font-size: 0.95rem;
}

.input-control:focus {
  border-color: var(--color-orange);
}

textarea.input-control {
  resize: vertical;
}

.editable-item-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn-save {
  background-color: var(--color-orange);
  color: var(--color-white);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color var(--transition-fast);
}

.btn-save:hover {
  background-color: var(--color-orange-hover);
}

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

.btn-save:disabled {
  background-color: var(--color-gray-medium);
  cursor: not-allowed;
}

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

.btn-secondary-outline:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary-outline {
  background: none;
  border: 1.5px solid var(--color-gray-medium);
  color: var(--color-gray-dark);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary-outline:hover {
  background-color: var(--color-gray-light);
  color: var(--color-brown);
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  width: 100%;
}

@media (max-width: 480px) {
  /* With only "right" set, width:100% resolves against the viewport, not
     the leftover space, and pushes the container off the left edge on
     narrow screens. Anchor both edges instead so it always fits. */
  .toast-container {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }
}

.toast {
  background-color: var(--color-white);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--color-gray-light);
  transform: translateX(120%);
  opacity: 0;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.3s, opacity 0.3s;
}

@keyframes slideIn {
  to { transform: translateX(0); opacity: 1; }
}

.toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.toast.success { border-color: rgba(16, 185, 129, 0.35); background-color: #f0fdf4; }
.toast.error   { border-color: rgba(239, 68, 68, 0.35);   background-color: #fef2f2; }
.toast.info    { border-color: rgba(59, 130, 246, 0.35);  background-color: #eff6ff; }
.toast.warning { border-color: rgba(245, 158, 11, 0.35);  background-color: #fffbeb; }

.toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.toast.success .toast-icon { color: var(--color-success); }
.toast.error .toast-icon { color: var(--color-danger); }
.toast.info .toast-icon { color: var(--color-info); }
.toast.warning .toast-icon { color: var(--color-warning); }

.toast-icon svg { width: 20px; height: 20px; fill: currentColor; }

.toast-content {
  flex-grow: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.toast-desc {
  font-size: 0.8rem;
  color: var(--color-gray-dark);
  margin-top: 2px;
}

.toast-close {
  background: none;
  border: none;
  color: var(--color-gray-medium);
  cursor: pointer;
  padding: 4px;
}

.toast-close:hover {
  color: var(--color-brown);
}

/* --- V2 Administration Features Styling --- */

/* Small discrete Logout link */
.logout-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  padding: 8px 12px;
  transition: color var(--transition-fast);
  width: auto;
  margin-top: 10px;
}

.logout-link:hover {
  color: var(--color-danger);
}

.logout-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

@media (max-width: 1024px) {
  .logout-link {
    font-size: 0.82rem;
    padding: 8px 10px;
  }
}

/* Same tablet-only scoping as the nav-item icon rail above. */
@media (min-width: 769px) and (max-width: 860px) {
  .logout-link {
    justify-content: center;
    width: 100%;
    padding: 8px 0;
  }
  .logout-link .nav-label {
    display: none;
  }
}

/* --- Sélection multiple & actions groupées sur le catalogue --- */
.bulk-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background-color: var(--color-peach-light);
  border: 1.5px solid rgba(255, 108, 54, 0.15);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
}

.bulk-select-all {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-gray-dark);
}

.bulk-select-all input[type="checkbox"],
.select-all-checkbox,
.plant-select-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--color-orange);
  cursor: pointer;
}

.bulk-actions-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bulk-actions-buttons .btn-secondary-outline {
  padding: 8px 14px;
  font-size: 0.85rem;
}

.btn-bulk-delete {
  background: none;
  border: 1.5px solid rgba(239, 68, 68, 0.35);
  color: var(--color-danger);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

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

.btn-bulk-delete.confirming {
  background-color: var(--color-danger);
  color: var(--color-white);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
  animation: pop-in 0.2s ease;
}

.bulk-actions-buttons svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 576px) {
  .bulk-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .bulk-actions-buttons {
    justify-content: flex-start;
  }
}

/* Per-card selection checkbox — sits opposite the edit/delete buttons */
.plant-select-checkbox-wrap {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  width: 28px;
  height: 28px;
  background-color: var(--color-white);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Delete button on cards */
.btn-delete-plant {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-white);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.btn-delete-plant:hover {
  background-color: var(--color-danger);
  color: var(--color-white);
  transform: scale(1.05);
}

.btn-delete-plant svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Image preview and upload container for Textes & Images editor */
.image-edit-container {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 10px;
  background-color: var(--color-white);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--color-gray-light);
}

@media (max-width: 576px) {
  .image-edit-container {
    flex-direction: column;
    align-items: stretch;
  }
}

.card-group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.card-group-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-group-col .editable-item {
  flex: 1;
}

@media (max-width: 900px) {
  .card-group-grid {
    grid-template-columns: 1fr;
  }
}

.image-edit-preview {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-gray-light);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-peach-light);
  position: relative;
}

.image-edit-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-edit-preview svg {
  width: 28px;
  height: 28px;
  color: var(--color-gray-medium);
}

.image-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.image-edit-buttons-row {
  display: flex;
  gap: 8px;
}

/* Slider hero gallery management */
.slider-gallery-container {
  margin-top: 12px;
}

.slider-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.slider-gallery-item {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1.5px solid var(--color-gray-light);
  box-shadow: var(--shadow-sm);
}

.slider-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-slide {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: rgba(239, 68, 68, 0.9);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: background-color var(--transition-fast);
}

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

.slider-gallery-add {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--color-gray-medium);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: var(--color-white);
  color: var(--color-gray-medium);
  transition: all var(--transition-fast);
}

.slider-gallery-add:hover {
  border-color: var(--color-orange);
  color: var(--color-orange);
  background-color: var(--color-peach-light);
}

.slider-gallery-add svg {
  width: 24px;
  height: 24px;
  margin-bottom: 4px;
}

.slider-gallery-add span {
  font-size: 0.7rem;
  font-weight: 600;
  text-align: center;
}

/* --- Plant Admin Modal (form overlay) --- */
.plant-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(14, 28, 20, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--transition-normal);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.plant-modal.show {
  display: flex;
  opacity: 1;
}

.plant-modal-content {
  background-color: var(--color-white);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-premium);
  position: relative;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}


.plant-modal.show .plant-modal-content {
  transform: scale(1) translateY(0);
}

.plant-modal-close {
  position: absolute;
  right: 20px;
  top: 16px;
  color: var(--color-gray-medium);
  font-size: 30px;
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast), transform var(--transition-fast);
  z-index: 1;
  background: none;
  border: none;
  padding: 4px 8px;
}

.plant-modal-close:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.plant-modal-body {
  display: block;
  padding: 30px;
}

#plant-form-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--color-peach);
  padding-bottom: 8px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 560px) {
  .plant-modal {
    padding: 0;
  }
  .plant-modal-content {
    width: 100%;
    max-width: none;
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
  }
  .plant-modal-body {
    padding: 24px 20px;
  }
  #plant-form-title {
    font-size: 1.7rem;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.plant-modal-close:hover {
  color: var(--color-danger);
  transform: scale(1.15);
}

/* Edit button on plant admin cards */
.btn-edit-plant {
  position: absolute;
  top: 12px;
  right: 50px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--color-white);
  border: 1px solid rgba(255, 108, 54, 0.25);
  color: var(--color-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.btn-edit-plant:hover {
  background-color: var(--color-orange);
  color: var(--color-white);
  transform: scale(1.08);
}

.btn-edit-plant svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Edit/delete buttons inside the table view — the card-view rules above
   position them absolutely, which escapes the table row entirely since
   no ancestor in the table layout is position:relative. Reset them to
   flow normally inside the actions cell. */
.admin-table .btn-edit-plant,
.admin-table .btn-delete-plant {
  position: static;
  top: auto;
  right: auto;
}

/* Delete button — two-step confirmation state */
.btn-delete-plant.confirming {
  background-color: var(--color-danger);
  color: var(--color-white);
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.22);
  animation: pop-in 0.2s ease;
}

@keyframes pop-in {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1.05); }
}

/* Recent unread messages preview widget */
.recent-msg-item {
  padding: 12px;
  border-radius: var(--radius-sm);
  background-color: var(--color-peach-light);
  margin-bottom: 8px;
  border: 1px solid rgba(255, 108, 54, 0.08);
}

.recent-msg-item:last-child {
  margin-bottom: 0;
}

.recent-msg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
}

.recent-msg-email {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-orange);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-msg-date {
  font-size: 0.75rem;
  color: var(--color-gray-medium);
  flex-shrink: 0;
}

.recent-msg-text {
  font-size: 0.82rem;
  color: var(--color-gray-dark);
  margin-bottom: 6px;
  line-height: 1.4;
}

.recent-msg-reply {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-orange);
  text-decoration: none;
}

.recent-msg-reply:hover {
  text-decoration: underline;
}

/* Autosave indicator (Modification site web tab) */
.autosave-indicator {
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  transition: opacity 0.3s;
}

.autosave-indicator.saving { color: var(--color-gray-medium); }
.autosave-indicator.saved  { color: var(--color-success); }
.autosave-indicator.error  { color: var(--color-danger); }

/* Messages empty state on dashboard */
.msg-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--color-success);
}

.msg-empty-state svg {
  fill: var(--color-success);
  margin-bottom: 12px;
  opacity: 0.65;
}

.msg-empty-state p {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--color-success);
}

.msg-empty-state span {
  font-size: 0.85rem;
  color: var(--color-gray-medium);
}

/* Plant count badge in catalogue toolbar */
.catalogue-count {
  font-size: 0.82rem;
  color: var(--color-gray-medium);
  white-space: nowrap;
  padding: 6px 12px;
  background-color: var(--color-white);
  border: 1px solid var(--color-gray-light);
  border-radius: var(--radius-md);
  align-self: center;
  font-weight: 500;
}

