/* Keep table cells auto-height; we'll only force header height to 25px and add padding for readability */
.admin-table th, .admin-table td {
    height: auto !important;
    line-height: normal !important;
    padding: 0.75rem 1.25rem !important; /* Top/Bottom: 0.75rem, Left/Right: 1.25rem */
    padding-left: 1.25rem !important; /* Ensure extra left spacing */
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Sora:wght@400;600;700&display=swap');

:root {
    --bg-color: #050508;
    --card-bg: #0f0f16;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --danger: #ef4444;

    --font-main: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: 'Sora', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

    --container-width: 1200px;
    --spacing-section: 6rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MDAiIGhlaWdodD0iNTAwIj48ZmlsdGVyIGlkPSJub2lzZSI+PGZlVHVyYnVsZW5jZSB0eXBlPSJmcmFjdGFsTm9pc2UiIGJhc2VGcmVxdWVuY3k9IjAuNjUiIG51bU9jdGF2ZXM9IjMiIHN0aXRjaFRpbGVzPSJzdGl0Y2giLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWx0ZXI9InVybCgjbm9pc2UpIiBvcGFjaXR5PSIwLjAzIi8+PC9zdmc+');
    pointer-events: none;
    z-index: 9999;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s ease;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 600;
    line-height: 1.2;
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(to right, #fff, #a0a0a0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 0;
    background: rgba(5, 5, 8, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 3rem;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
}

/* Nav dropdown wrapper for header */
.nav-wrapper { position: relative; }
.nav-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.04);
    padding: 0.6rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
    z-index: 250;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.nav-dropdown .nav-link { padding: 0.5rem 0.6rem; }
.nav-dropdown .nav-logout { width: 100%; text-align: left; }


.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.nav-link:hover {
    color: #fff;
}

/* Button reset so it can use nav-link styles */
.nav-button {
    background: transparent;
    border: none;
    padding: 0.4rem 0; /* keep spacing compact */
    cursor: pointer;
    font-family: inherit;
}

.nav-button:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
    border-radius: 6px;
}

/* Navigation toggle / mobile menu */
.nav-toggle {
    display: inline-flex; /* show menu toggle so nav lives inside it */
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.nav-toggle .hamburger {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff; /* ensure white bars */
    position: relative;
}
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #fff; /* ensure white bars */
}
.nav-toggle .hamburger::before { top: -6px; }
.nav-toggle .hamburger::after { top: 6px; }

/* Toggle open state -> convert to cross */
.nav-toggle.open .hamburger {
    background: transparent;
}
.nav-toggle.open .hamburger::before {
    transform: rotate(45deg) translate(4px, 4px);
    top: 0;
}
.nav-toggle.open .hamburger::after {
    transform: rotate(-45deg) translate(4px, -4px);
    top: 0;
}

.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Mobile behaviour */
@media (max-width: 768px) {
    .nav {
        gap: 0.75rem;
    }

    /* Always show CTA (Audit Gratuit) */
    .nav-cta {
        display: inline-flex;
        margin-right: 0.5rem;
    }

    /* Hide the nav menu by default, show toggle */
    .nav-toggle { display: inline-flex; }
    .nav-menu {
        position: absolute;
        top: 64px; /* below header */
        right: 1rem;
        background: var(--card-bg);
        z-index: 110;
        border: 1px solid rgba(255,255,255,0.05);
        padding: 1rem;
        border-radius: 12px;
        display: none;
        flex-direction: column;
        gap: 0.5rem;
        min-width: 200px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    }
    .nav-menu.open { display: flex; }

    /* Make nav-link items appear stacked in the menu */
    .nav-menu .nav-link,
    .nav-menu .nav-button { display: block; }
}

/* Mobile-specific adjustments for admin toolbar and table */
@media (max-width: 768px) {
    .section-title { font-size: 1.6rem; margin-bottom: 1rem; text-align: left; }

    /* Make the toolbar stack and be non-sticky on small screens */
    .toolbar {
        position: static !important;
        top: auto !important;
        box-shadow: none !important;
        padding: 0.75rem 0.5rem;
        margin-bottom: 1rem;
        border-radius: 10px;
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    .toolbar-left, .toolbar-right { width: 100%; justify-content: space-between; }
    .toolbar .table-input { width: 100%; max-width: none; }
    #openAddUser { width: 100%; }

    /* Slightly tighter table cells so rows fit better on small widths */
    .admin-table th, .admin-table td { padding: 0 !important; }
    .table-wrap { margin-top: 0.5rem; }

    /* Ensure the inline manage panel doesn't overflow the viewport */
    .inline-panel { padding: 0.85rem; }
}

/* Convert table to stacked cards to avoid horizontal scrolling on narrow screens */
@media (max-width: 900px) {
  .table-wrap { overflow: visible; background: transparent; box-shadow: none; border: none; }
  .admin-table { display: block; }
  .admin-table thead { display: none; }
  .admin-table tbody { display: block; }
  .admin-table tr {
    display: block;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(15,15,22,0.8), rgba(20,20,30,0.6));
    border: 1px solid rgba(255,255,255,0.06);
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .admin-table tr:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,0.25); }
    .admin-table td {
        /* allow variable height so long emails can wrap */
        padding: 0 !important;
        border: none;
        height: auto !important;
        line-height: normal !important;
        display: block; /* ensure each cell behaves as a block in stacked layout */
    }
    .admin-table td::before { content: attr(data-label); color: var(--text-muted); font-weight: 600; display: block; margin-bottom: 0.35rem; margin-right: 0.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* Actions: place action buttons to the right (no divider) */
    .admin-table td.col-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 0.5rem;
        padding-top: 0; /* remove spacing that looked like a divider */
        border-top: none; /* remove the subtle bar */
    }
    .admin-table td.col-actions::before {
        /* hide the Actions label in mobile stacked layout */
        display: none;
    }
    .admin-table td.col-actions .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.45rem 0.7rem;
        border-radius: 8px;
        margin-right: 0;
        min-width: 0;
        width: auto;
    }
    .admin-table td.col-actions .btn:last-child { margin-right: 0; }

    /* Make inline manage panel full width and fit nicely */
    .inline-manage-row td { padding: 0; }
    .inline-panel { margin: 0.5rem 0; }

    /* On very small screens stack action buttons vertically for touch friendliness */
    @media (max-width: 420px) {
        .admin-table td { flex-direction: column; align-items: flex-start; }
        .admin-table td::before { flex: none; max-width: none; margin-bottom: 0.35rem; }
        .admin-table td.col-actions .btn { width: 100%; margin: 0 0 0.5rem 0; }
        .admin-table td.col-actions .btn:last-child { margin-bottom: 0; }
    }

    /* Reorder columns within stacked cards for readability */
    .admin-table td.name-cell { order: 1; width: 48% !important; display: inline-block !important; }
    .admin-table td.formule-cell { order: 2; width: 48% !important; display: inline-block !important; }
    .admin-table td.email-cell { order: 3; width: 100% !important; display: block !important; white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; }
    .admin-table td.created-cell { order: 4; width: 48% !important; display: inline-block !important; }
    .admin-table td.col-actions { order: 5; width: 48% !important; display: inline-block !important; }
}

/* Icon handling inside buttons: hide icons on desktop; show on small screens via media query */
.btn-icon { display: none; font-size: 1.25rem; line-height: 1; margin-left: 0.5rem; }
.btn-text { display: inline; }
.sr-only { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* style the icons to be clear and tappable */
.btn-icon-manage {
    color: inherit;
    background: transparent;
    border-radius: 0;
    padding: 0;
    font-size: 1.25rem;
}
.btn-icon-delete {
    color: var(--danger);
    background: transparent;
    border-radius: 0;
    padding: 0;
    font-size: 1.25rem;
}
.btn-icon-manage:hover, .btn-icon-delete:hover { transform: scale(1.05); }

/* Make pencil and cross icons the same size */
.admin-table .btn-icon-manage,
.admin-table .btn-icon-delete {
    font-size: 1.25rem;
    vertical-align: middle;
    line-height: 1;
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    text-align: center;
}

/* Desktop action button hover improvements */
.admin-table .col-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* make the icon-only buttons visually balanced */
.admin-table td.col-actions .btn { padding: 0.45rem; }

/* Center inline SVGs inside buttons */
.btn .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0; /* prevent baseline shifts */
}
.btn .btn-icon svg { display: block; }

/* Ensure icons are perfectly centered inside u-toggle circles using --u-size */
.u-toggle { position: relative; }
.u-toggle .btn-icon {
    position: absolute;
    left: 42%;
    top: 72%;
    /* allow per-icon optical offsets via CSS vars (only positional adjustments) */
    transform: translate(calc(-50% + var(--icon-offset-x, 0px)), calc(-50% + var(--icon-offset-y, 0px)));
    width: calc(var(--u-size, 44px) * 0.48);
    height: calc(var(--u-size, 44px) * 0.48);
    min-width: calc(var(--u-size, 44px) * 0.48);
    min-height: calc(var(--u-size, 44px) * 0.48);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.u-toggle .btn-icon svg {
    width: 70%;
    height: 70%;
    display: block;
}

/* Optical centering tweaks (only position adjustments) */
/* Nudge manage (wrench) icon slightly down for visual center
     without modifying the SVG itself. Adjust the translateY value if needed. */
/* per-icon wrapper offsets (optical centering only) */
.btn-icon-manage { --icon-offset-x: -2px; --icon-offset-y: 2.5px; }
.btn-icon-delete { --icon-offset-x: 0px; --icon-offset-y: 0px; }

/* Fallback alignment for non-u-toggle action buttons */
.admin-table td.col-actions .btn .btn-icon {
    width: 1.4rem !important;
    height: 1.4rem !important;
}
.admin-table td.col-actions .btn .btn-icon svg {
    width: 100%;
    height: 100%;
}

/* Admin table styles */
.table-wrap {
    overflow-x: hidden; /* prevent horizontal scroll */
    overflow-y: auto; /* allow vertical scrolling when needed */
    -ms-overflow-style: none;  /* Internet Explorer 10+ */
    scrollbar-width: none;  /* Firefox */
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(15,15,22,0.5);
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.table-wrap::-webkit-scrollbar { display: none; } /* Chrome, Safari, Opera */
.admin-table { width: 100%; border-collapse: collapse; table-layout: fixed; overflow-x: hidden; }
.admin-table::-webkit-scrollbar { display: none; }
.admin-table th, .admin-table td { padding: 0 !important; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.04); white-space: normal; word-break: break-word; }
/* Thinner rows for a denser list view */

/* Actions: keep buttons side-by-side; push the delete/cross to the far right */
.admin-table .col-actions {
    width: 100px !important; /* Adjust action column width */
    text-align: center; /* Center align actions for better layout */
    display: table-cell; /* keep table layout consistent so row height matches */
    vertical-align: middle;
}
.admin-table .col-actions .btn {
    min-width: 28px !important;
    width: auto !important;
    padding: 0.18rem 0.35rem !important;
    font-size: 0.95rem !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
/* Make all action buttons sit to the right with small spacing */
.admin-table td.col-actions .btn { margin-left: 0.2rem; }
.admin-table td.col-actions .btn:first-child { margin-left: 0.15rem; }
/* Ensure delete button is pushed to the right even if other rules try to override */
/* remove margin-left auto so buttons remain grouped on the right */
.admin-table .col-actions > .u-toggle--delete,
.admin-table .col-actions > .btn.u-toggle--delete {
    margin-left: 0 !important;
}
/* Ensure actions distribute properly on wider screens */
.admin-table .col-actions { /* placeholder to maintain earlier intent - no CSS needed here */ }
.admin-table thead th {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(139, 92, 246, 0.06));
    font-weight: 600;
    color: #fff;
    border-bottom: 2px solid rgba(59, 130, 246, 0.25);
    text-transform: uppercase;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    /* Header-specific size */
    height: 25px !important;
    line-height: 25px !important;
    padding: 0 1rem !important; /* keep header text away from edges */
    vertical-align: middle;
}

/* Prevent any child elements in headers from expanding the header height */
.admin-table thead th *,
.admin-table thead th button,
.admin-table thead th .btn,
.admin-table thead th .u-toggle {
    max-height: 25px !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
}
.admin-table thead tr {
    height: 35px !important;
}
.admin-table tbody tr { transition: all 0.25s ease; }
.admin-table tbody tr:hover { background: rgba(59, 130, 246, 0.06); transform: translateX(2px); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .col-actions { width: 100px; text-align: center; }
/* Minimal action button sizing and remove the u-toggle background circle in table rows */
.admin-table td.col-actions .u-toggle {
    --u-size: 28px; /* reduce base size for action buttons */
    height: var(--u-size) !important;
    padding: 0.12rem 0.35rem !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}
.admin-table td.col-actions .u-toggle:before { display: none !important; }
.admin-table td.col-actions .btn .btn-icon { font-size: 1.05rem !important; }
.admin-table td.col-actions .btn { background: transparent !important; border: none !important; box-shadow: none !important; }
.table-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.2);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.table-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(59,130,246,0.08);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; transition: all 0.2s ease; }
.btn-sm:hover { transform: translateY(-1px); }
.admin-table .col-actions .btn {
    min-width: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.5rem;
    border-radius: 8px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* On small screens make action buttons share the available space and normalize sizing */
@media (max-width: 900px) {
    .admin-table td.col-actions { gap: 0.5rem; display: flex; }
    .admin-table td.col-actions .btn { min-width: 0; flex: 1 1 48%; padding: 0.55rem 0.6rem; font-size: 0.95rem; border-radius: 8px; }
}
@media (max-width: 900px) {
    /* show icons and hide text on smaller screens (cover up to 900px)
       widened slightly so small-desktop widths (e.g. 882px) also show emojis */
    .btn-icon { display: inline-block; }
    .btn-text { display: none; }
    /* remove extra contour/padding when only icon is visible */
    .admin-table td.col-actions .btn { padding: 0.4rem 0.5rem; }
    .admin-table td.col-actions .btn .btn-icon { margin-left: 0; }
    /* Make icon-only buttons visually minimal: remove grey contour/background/border */
    .admin-table td.col-actions .btn,
    .admin-table td.col-actions .btn.btn-secondary,
    .admin-table td.col-actions .btn.btn-outline {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0.35rem 0.45rem !important;
        min-width: 0 !important;
    }
    /* keep the icon itself clear and slightly larger for tap targets */
    .admin-table td.col-actions .btn .btn-icon { font-size: 1.35rem; line-height: 1; }
}
.sr-only { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(139, 92, 246, 0.04));
  border-radius: 14px;
  margin-bottom: 1.25rem;
  border: 1px solid rgba(255,255,255,0.06);
  position: sticky;
  top: 90px;
  z-index: 120;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Strong mobile overrides: remove divider and enforce right-aligned action buttons */
@media (max-width: 900px) {
    /* remove any residual borders on table cells that create the thin line */
    .admin-table th,
    .admin-table td { border-bottom: none !important; }

    /* ensure actions cell has no top/bottom border and sits to the right */
    .admin-table td.col-actions {
        border-top: none !important;
        border-bottom: none !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        width: 100% !important; /* ensure the actions cell spans the full row so right alignment works */
    }

    /* keep buttons compact and auto-sized, positioned to the right */
    .admin-table td.col-actions .btn {
        flex: 0 0 auto !important;
        width: auto !important;
        margin-left: 0.5rem !important;
        margin-right: 0 !important;
    }
    /* only the first button should consume the remaining space and push the rest to the right */
    .admin-table td.col-actions .btn:first-child { margin-left: auto !important; }
}
.toolbar .table-input { max-width: 380px; background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.08); }
.toolbar .table-input:focus { border-color: var(--primary); background: rgba(59, 130, 246, 0.1); box-shadow: 0 0 0 3px rgba(59,130,246,0.12); }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 1rem; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(2,6,23,0.75);
    backdrop-filter: blur(6px);
    z-index: 2000;
    padding: 2rem; /* give modal more breathing room on large screens */
}
.modal-content {
  background: linear-gradient(145deg, var(--card-bg), rgba(15,15,22,0.95));
  border-radius: 20px;
    padding: 3rem;
    width: 98vw;
    max-width: 1400px; /* much larger landscape modal */
    box-sizing: border-box;
    max-height: 90vh; /* prevent overflow off-screen */
    overflow: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  animation: modalSlideIn 0.25s ease-out;
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Specific override: make the Add User modal landscape and much larger
   Target ID so other modals (signin, delete) keep their compact size. */
#addUserModal .modal-content {
    width: 96vw;
    max-width: 1400px;
    padding: 3rem 3.5rem;
    box-sizing: border-box;
    border-radius: 20px;
    max-height: 92vh;
    overflow: auto;
}

/* Slightly increase inner grid spacing for the larger modal */
#addUserModal .modal-grid {
    gap: 1.25rem 1.75rem;
}

/* Ensure mobile still stacks nicely */
@media (max-width: 720px) {
    #addUserModal .modal-content {
        width: 100vw;
        max-width: 100vw;
        padding: 1.25rem;
        border-radius: 12px;
        max-height: 92vh;
    }
    #addUserModal .modal-grid { grid-template-columns: 1fr; }
}
.modal-content h3 {
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(90deg, #fff, #a0a0a0);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.modal-body { margin-bottom: 1.5rem; }
.modal-body { margin-bottom: 1.5rem; }
.modal-body--landscape { padding: 0.5rem 0; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr 0.7fr; gap: 1rem 1.25rem; align-items: start; }
.modal-col { display: flex; flex-direction: column; gap: 0.75rem; }
.modal-col--wide { grid-column: 1 / -1; display: flex; flex-direction: column; }
.modal-body label { display: block; margin-bottom: 0; color: var(--text-muted); font-size: 0.95rem; }
.modal-body input, .modal-body select { width: 100%; margin-top: 0.35rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; }

/* Button refinements */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  transition: all 0.25s ease;
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}
.btn-secondary {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-main);
  border-radius: 12px;
  padding: 0.65rem 1.1rem;
  transition: all 0.25s ease;
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.2);
}
.btn-link { background: transparent; border: none; color: var(--primary); cursor: pointer; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Dashboard hero */
.dashboard-hero {
  padding-top: 120px;
  padding-bottom: 2rem;
  text-align: center;
}
.dashboard-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 0%, #a0a0a0 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dashboard-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}
.dashboard-welcome {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(139,92,246,0.1));
  border-radius: 50px;
  color: #fff;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid rgba(255,255,255,0.08);
}

/* Row hover */
.admin-table tbody tr:hover { background: rgba(255,255,255,0.015); }

/* Responsive tweaks */
@media (max-width: 900px) {
    .col-actions { width: 160px; }
}

/* Desktop: show nav menu inline */
@media (min-width: 769px) {
    .nav-menu { display: flex !important; }
    .nav-toggle { display: none; }
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-family: var(--font-display);
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
}

/* Uiverse-inspired rounded toggle/button adapted to theme colors */
.u-toggle {
    --u-size: 44px; /* default action button size */
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: var(--u-size);
    padding: 0.25rem 0.8rem;
    border-radius: calc(var(--u-size) * 1.2);
    overflow: visible;
    cursor: pointer;
    transition: transform 220ms cubic-bezier(0.23,1,0.32,1), box-shadow 220ms;
}
.u-toggle:before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(var(--u-size) * 0.72);
    height: calc(var(--u-size) * 0.72);
    border-radius: 999px;
    background: #fff;
    opacity: 0.06;
    pointer-events: none;
}
.u-toggle .btn-text { font-weight: 700; }
.u-toggle .btn-icon { margin-left: 0.6rem; }
.u-toggle { /* make u-toggle icon-first style on desktop too */
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.u-toggle:not(.u-toggle--add) .btn-text { display: none !important; }
.u-toggle .btn-icon { display: inline-block !important; }
.u-toggle:active { transform: translateY(1px) scale(0.995); }

/* Variants (use theme colors) */
.u-toggle--add { /* primary CTA: keep original visual with text on desktop */
    --u-size: 56px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 10px 30px rgba(59,130,246,0.18);
}
.u-toggle--manage { color: var(--text-main); }
.u-toggle--delete { color: var(--danger); }

/* When icon-only (mobile), keep circular and minimal */
@media (max-width: 900px) {
    .u-toggle { padding: 0.15rem 0.4rem; }
    .u-toggle .btn-text { display: none; }
    .u-toggle { --u-size: 46px; }
    .u-toggle:before { opacity: 0.04; }
    .u-toggle .btn-icon { font-size: 1.35rem; margin-left: 0; }
}

/* Make modal full-width-ish on small screens but keep readable padding */
@media (max-width: 720px) {
    .modal { padding: 0.75rem; }
    .modal-content { width: 100vw; max-width: 100vw; border-radius: 12px; padding: 1.25rem; max-height: 92vh; }
    .modal-grid { grid-template-columns: 1fr; }
    .modal-col--wide { grid-column: auto; }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.btn-secondary:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Outline button for sign-in */
.btn-outline {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 9999px;
    font-weight: 600;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.03);
    transform: translateY(-2px);
}

.full-width {
    width: 100%;
    text-align: center;
}

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 10;
    max-width: 1100px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 4rem;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.hero-line-1,
.hero-line-2 {
    display: block;
}

.text-gradient {
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
    z-index: 1;
}

/* Services */
.section {
    padding: var(--spacing-section) 0;
}

.grid {
    display: grid;
    gap: 2rem;
}

.services-grid {
    /* Force a 3-column layout on larger screens, fall back to single column on small screens */
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.1);
    background: #13131c;
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card p {
    color: var(--text-muted);
}

/* About */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Center the about section content horizontally and its text */
.about-content {
    justify-items: center;
}

.about-text {
    text-align: center;
    max-width: 560px; /* keep readable line length */
}

.about-text p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.about-text strong {
    color: #fff;
}

.gradient-sphere {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    filter: blur(80px);
    opacity: 0.6;
    margin: 0 auto;
    animation: float 6s ease-in-out infinite;
}

/* Center the about section in the viewport and overlay sphere behind text */
.about {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh; /* center vertically within the browser */
    position: relative;
}

.about-content {
    position: relative; /* allow absolute child positioning */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.about-content .container {
    position: relative;
    width: 100%;
    max-width: var(--container-width);
    padding: 2rem 1.5rem;
}

.about-visual {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
}

.about-text {
    position: relative;
    z-index: 2; /* ensure text sits above the sphere */
    grid-column: 1 / -1;
    /* don't use width:100% as it prevents centering via margin auto; use max-width and auto margin */
    width: auto;
    max-width: 560px;
    margin: 0 auto;
    text-align: center; /* ensure inner text is centered */
}

/* Extra safeguard: ensure the about section title is centered on all sizes */
.about-text .section-title {
    text-align: center !important;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Contact */
.contact-wrapper {
    display: flex;
    justify-content: center;
}

.contact-box {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-box h2 {
    margin-bottom: 1rem;
}

.contact-box>p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.5);
}

/* Footer */
.footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    margin-left: 2rem;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #fff;
}

/* Modal styles */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 200ms ease-out;
}
.modal.show {
    display: flex;
}
.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}
.modal-content {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, rgba(15,15,22,0.98), rgba(8,8,12,0.99));
    border: 1px solid rgba(59,130,246,0.2);
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px rgba(59, 130, 246, 0.15), 0 8px 32px rgba(0,0,0,0.4);
    animation: slideUp 300ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin: 1.5rem 0;
}
.modal-body label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}
.modal-body input, .modal-body select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    color: var(--text-main);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: inherit;
}
.modal-body input:focus, .modal-body select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.04);
}
.modal-close {
    position: absolute;
    right: 0.6rem;
    top: 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    cursor: pointer;
}
.signin-form .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}
.signin-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Side panel (rolling manage menu) */
.side-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 420px;
    max-width: 94%;
    background: linear-gradient(180deg, rgba(15, 15, 22, 0.98), rgba(8, 8, 10, 0.98));
    border-left: 1px solid rgba(255,255,255,0.04);
    transform: translateX(110%);
    transition: transform 300ms cubic-bezier(.2,.9,.2,1);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
}
.side-panel[aria-hidden="false"] {
    transform: translateX(0);
}
.side-panel-header { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.side-panel-body { display:flex; flex-direction:column; gap:0.75rem; overflow:auto; padding-right:0.5rem; }
.side-panel-actions { display:flex; gap:0.75rem; justify-content:flex-end; margin-top:0.75rem; }
.side-panel .table-input { width:100%; }

/* make overlay visible when panel open */
.modal-overlay.show { display:block; }

/* Inline rolling manage panel that appears under a table row */
.inline-manage-row td { padding: 0; border: none; background: transparent; }
.inline-panel {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(15,15,22,0.96), rgba(8,8,12,0.98));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    margin: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 20px 60px rgba(59, 130, 246, 0.1), 0 8px 32px rgba(0,0,0,0.4);
    transform-origin: top;
    animation: inlineSlide 320ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.inline-panel > div:first-child { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.inline-panel label { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.inline-panel .table-input { width: 100%; padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); background: rgba(0,0,0,0.3); color: var(--text-main); font-size: 0.9rem; transition: all 0.2s ease; }
.inline-panel .table-input:focus { outline: none; border-color: var(--primary); background: rgba(59, 130, 246, 0.08); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.inline-panel-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.04); }
.inline-panel-actions .btn { transition: all 0.2s ease; }
.inline-panel-actions .btn:hover { transform: translateY(-1px); }

@keyframes inlineSlide {
    from { opacity: 0; transform: translateY(-10px) scaleY(0.95); }
    to   { opacity: 1; transform: translateY(0) scaleY(1); }
}
.modal-content h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}
.modal-close {
    position: absolute;
    right: 0.6rem;
    top: 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    cursor: pointer;
}
.signin-form .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}
.signin-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.copyright {
    text-align: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.8rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
        align-items: flex-start; /* ensure title appears earlier than paragraph on mobile */
        padding-top: 2rem; /* small top padding so title isn't flush to viewport */
    }

    /* Keep overlay centered behind text on mobile */
    .about-visual {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 1;
        pointer-events: none;
        width: 100%;
        height: auto;
    }
    
    .about-text {
        position: relative;
        z-index: 2;
        grid-column: 1 / -1;
    }

    .header-content {
        /* Keep the header inline on mobile: logo left, CTA + menu on the right */
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0 1rem;
    }

    .nav {
        gap: 0.75rem;
        align-items: center;
        margin-left: auto; /* push nav to the right of header */
    }

    .hero-actions {
        flex-direction: column;
    }

    /* Services: stack into single column on smaller screens */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-links a {
        margin: 0 1rem;
    }
}

/* Intersection Observer visibility helper (fade-in) */
.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ----------------------------------------
    Base Typographic & Helper Utilities
    ---------------------------------------- */

/* ----------------------------------------
    Navigation
    ---------------------------------------- */

/* ----------------------------------------
    Hero
    ---------------------------------------- */

/* ========================================
   DASHBOARD STYLES
   ======================================== */

.dashboard-main {
    padding-top: 80px;
    min-height: 100vh;
}

/* Dashboard Navigation */
.dashboard-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dashboard-nav .nav-link {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.dashboard-nav .nav-link:hover {
    color: var(--primary);
}

/* Dashboard Hero */
.dashboard-hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.dashboard-title {
    font-family: var(--font-display);
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.dashboard-welcome {
    font-size: 1.1rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Dashboard Sections */
.dashboard-section {
    padding: 3rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--text-main);
}

/* Gains Section */
.gains-section {
    background: linear-gradient(180deg, transparent 0%, rgba(59, 130, 246, 0.03) 100%);
}

.gains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.gain-card {
    background: var(--card-bg);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.gain-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.gain-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.gain-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.gain-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.gain-period {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.gain-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Subscription Section */
.subscription-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.subscription-info {
    flex: 1;
    min-width: 300px;
}

.subscription-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.subscription-row:last-child {
    border-bottom: none;
}

.subscription-label {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.subscription-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.subscription-badge {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.subscription-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 200px;
}

/* Automations Section */
.automations-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.automation-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.automation-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.automation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.automation-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
}

.automation-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-maintenance {
    background: rgba(249, 115, 22, 0.2);
    color: #f97316;
}

.status-optimization {
    background: rgba(59, 130, 246, 0.2);
    color: var(--primary);
}

.automation-objective {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.automation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.automation-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* History Section */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.history-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 2rem;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.3s ease;
}

.history-item:hover {
    border-color: var(--primary);
}

.history-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
}

.history-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.history-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.history-result {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.history-actions {
    text-align: center;
}

/* Support Section */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.support-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.support-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
}

.support-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.support-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.support-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Responsive Dashboard */
@media (max-width: 768px) {
    .dashboard-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-title {
        font-size: 2rem;
    }

    .dashboard-subtitle {
        font-size: 1rem;
    }

    .gains-grid {
        grid-template-columns: 1fr;
    }

    .subscription-card {
        flex-direction: column;
    }

    .automations-list {
        grid-template-columns: 1fr;
    }

    .history-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .support-grid {
        grid-template-columns: 1fr;
    }
}

/* Align text in table cells to match column headers */
.admin-table th, .admin-table td {
    text-align: left !important; /* Force horizontal alignment */
    vertical-align: middle !important; /* Force vertical alignment */
}

/* Enforce left padding for table cells */
.admin-table td {
    padding-left: 1rem !important; /* Ensure spacing from left edge */
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    .admin-table th, .admin-table td {
        padding: 0.5rem 1rem !important; /* Reduce padding for smaller screens */
        font-size: 0.85rem; /* Adjust font size for readability */
    }

    .admin-table {
        width: 100%; /* Ensure table fits within screen */
        overflow-x: auto; /* Allow horizontal scrolling if needed */
    }

    .admin-table .col-actions {
        width: auto !important; /* Adjust action column width */
        text-align: center; /* Center align actions for better layout */
    }
}

/* Responsive layout for two data points per line */
@media (max-width: 768px) {
    .admin-table {
        display: flex;
        flex-direction: column;
    }

    .admin-table tr {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        margin-bottom: 1rem;
    }

    .admin-table td {
        width: 48%; /* Two columns per row */
        padding: 0.5rem 1rem !important;
        box-sizing: border-box;
    }
    /* Reorder columns for mobile: Name + Formule on first line, Email full width on second, Created + Actions on third */
    .admin-table td.name-cell { order: 1; width: 48% !important; }
    .admin-table td.formule-cell { order: 2; width: 48% !important; }
    .admin-table td.email-cell { order: 3; width: 100% !important; white-space: normal !important; overflow-wrap: anywhere; word-break: break-word; }
    .admin-table td.created-cell { order: 4; width: 48% !important; }
    .admin-table td.col-actions { order: 5; width: 48% !important; }

    /* Ensure email and other text wraps properly */
    .admin-table td.email-cell, .admin-table td.name-cell, .admin-table td.formule-cell {
        white-space: normal !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        hyphens: auto !important;
    }

    .admin-table th {
        display: none; /* Hide headers on mobile */
    }
}

/* Hide horizontal scrollbar in user list */
.table-wrap {
    overflow-x: hidden !important;
}
.admin-table {
    width: 100%;
    table-layout: fixed;
    overflow-x: hidden;
}
.admin-table::-webkit-scrollbar {
    display: none;
}

/* User name in admin table: white, not hoverable/clickable */
.admin-table .name-cell {
    color: #fff !important;
    transition: none !important;
}
.admin-table .name-cell:hover {
    color: #fff !important;
    background: none !important;
    cursor: default !important;
}

/* Username in nav (index page): greyed and not hoverable */
.nav-link.nav-button.signed-in {
    color: #888 !important;
    background: none !important;
    cursor: default !important;
    pointer-events: none;
    transition: none !important;
}
.nav-link.nav-button.signed-in:hover {
    color: #888 !important;
    background: none !important;
}
