.donut-chart-wrap {
    position: relative;
    width: 180px;
    height: 180px;
}

.donut-chart {
    width: 180px;
    height: 180px;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    gap: 2px;
}

.donut-value { font-weight: 700; color: #e6e1e8; }
.donut-percent { font-size: 12px; color: #cfcbd6; }
html, body{
    margin: 0;
    padding: 0;
}

.page-section textarea {
    width: 100%;
    padding: 8px;
    margin: 6px 0 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical;
}

.page-section input[type="email"] {
    width: 100%;
    padding: 8px;
    margin: 6px 0 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.page-section label {
    display: block;
    margin-top: 8px;
    font-weight: 500;
}

.status {
    margin-top: 10px;
    color: #2b3a40;
    font-size: 14px;
}
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #27262b; /* new background */
    color: #e6e1e8; /* new text color */
}

.container {
    /* Wider max-width to reduce large side gutters on wide screens.
       Use horizontal padding so the layout breathes on small screens. */
    margin: 0 auto;
    padding: 12px 24px; /* vertical 12px, horizontal 24px */
    box-sizing: border-box;
}

/* When a .container follows the topbar, ensure there's no extra top gap */
.topbar + .container { margin-top: 0; }

/* Auth button in top-right */
.auth-button {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.12);
    padding: 8px 12px;
    border-radius: 6px;
}

/* Auth button links: no underline, bold */
.auth-area .button.auth-button {
  text-decoration: none;
  font-weight: bold;
}

/* Visible state — only toggle visibility, pointer-events and display */
.auth-panel.open,
.auth-panel.show,
.auth-panel.visible,
.auth-panel.active,
.auth-panel.is-open,
.auth-panel[data-open="true"],
.auth-panel[aria-hidden="false"] {
    display: block;        /* <- make element participate in layout when shown */
    visibility: visible;
    pointer-events: auto;
}

/* Auth panel (simplified: hidden by default using visibility & pointer-events) */
.auth-panel {
    position: fixed;
    top: 64px;
    right: 16px;
    width: 320px;
    max-width: 420px;
    background: #2f2e33; /* dark card background */
    border: 1px solid #44434d; /* new border color */
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    z-index: 2200;
    /* Hidden by default: use display + visibility + pointer-events */
    display: none;
    visibility: hidden;
    pointer-events: none;
}

.auth-panel label {
    display: block;
    font-size: 13px;
    margin-top: 8px;
    color: #e6e1e8;
}

.auth-panel input[type="email"],
.auth-panel input[type="password"] {
    width: 100%;
    /* fixed height to ensure both inputs match visually */
    height: 40px;
    line-height: 1.2;
    padding: 8px 12px;
    margin: 6px 0 14px 0; /* extra space below inputs */
    border: 1px solid #44434d; /* new border color */
    border-radius: 6px;
    background: #2a292d; /* darker input background */
    box-sizing: border-box;
    font-size: 14px;
    color: #e6e1e8;
}

.auth-panel input:focus {
    outline: none;
    border-color: #5a5960;
    box-shadow: 0 0 0 3px rgba(68,67,77,0.12);
}

.auth-buttons { display:flex; gap:8px; align-items:center; margin-top: 4px; }

.auth-buttons .button { height: 40px; }

.status { font-size: 12px; color: #e6e1e8; white-space: pre-wrap; max-height:120px; overflow:auto; }

/* Page sections */
.page-section { background: #2f2e33; padding: 18px; border-radius: 6px; margin: 16px 0; }

/* Individual cards: add subtle border and shadow */
.individual {
    border: 1px solid #44434d;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.dashboard-toolbar {
    padding-bottom: 14px;
}

.dashboard-toolbar-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dashboard-status,
.dashboard-empty {
    margin: 12px 0 0;
    font-size: 13px;
    color: #8bd3dd;
}

.dashboard-status {
    min-height: 20px;
    visibility: hidden;
}

.dashboard-status.is-visible {
    visibility: visible;
}

.recipient-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.recipient-header h3 {
    margin: 0;
}

.recipient-header-actions {
    display: flex;
    gap: 8px;
}

.recipient-edit-button {
    min-width: 42px;
    padding: 8px 10px;
}

.recipient-delete-button {
    min-width: 42px;
    padding: 8px 10px;
    background: #5a2e36;
}

.recipient-delete-button:hover {
    background: #74404a;
}

.recipient-add-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.subscription-activate-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #2d7d46;
    text-decoration: none;
}

.subscription-activate-button:hover {
    background: #379757;
}

.recipient-fields p {
    margin: 8px 0;
}

.recipient-edit-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.recipient-edit-form label {
    margin-top: 0;
}

.recipient-edit-form label span {
    display: block;
    margin-bottom: 6px;
    color: #cfcbd6;
    font-size: 13px;
}

.recipient-edit-form input[type="text"],
.recipient-edit-form input[type="email"],
.recipient-edit-form input[type="tel"],
.recipient-edit-form select {
    display: block;
    width: 100%;
    height: 40px;
    line-height: 1.2;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #44434d;
    border-radius: 6px;
    background: #2a292d;
    color: #e6e1e8;
    font-size: 14px;
    box-sizing: border-box;
}

.recipient-edit-form input[type="text"]:focus,
.recipient-edit-form input[type="email"]:focus,
.recipient-edit-form input[type="tel"]:focus,
.recipient-edit-form select:focus {
    outline: none;
    border-color: #5a5960;
    box-shadow: 0 0 0 3px rgba(68,67,77,0.12);
}

.recipient-checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
}

.recipient-checkbox-field input {
    margin: 0;
}

.recipient-checkbox-field span {
    margin-bottom: 0;
}

.recipient-edit-actions {
    display: flex;
    gap: 10px;
    grid-column: 1 / -1;
}

.recipient-edit-actions .button[disabled] {
    opacity: 0.7;
    cursor: wait;
}

.recipient-status {
    min-height: 20px;
    margin: 14px 0 0;
    color: #8bd3dd;
    font-size: 13px;
    visibility: hidden;
}

.recipient-status.is-visible {
    visibility: visible;
}

/* Metric row styling */
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.metric {
    background: #2a292d;
    border: 1px solid #3b3a41;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.metric .label { color: #cfcbd6; }
.metric .value { font-weight: 600; color: #e6e1e8; }
/* Click rate coloring */
.metric .value.rate.rate-low { color: #ffc107 !important; }
.metric .value.rate.rate-high { color: #ff4d4f !important; }

/* Donut cards */
.donut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.donut-card {
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.donut {
    position: relative;
    width: 180px;
    height: 180px;
}

.donut svg { width: 180px; height: 180px; }

.donut-label { margin-top: 8px; color: #e6e1e8; font-weight: 600; text-align: center; }

.button {
    display: inline-block;
    font-size: 14px;
    color: #e6e1e8;
    background: #44434d; /* use border/separator color for controls */
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.button:hover { background: #5a5960; }

@media (max-width:600px) {
    .auth-panel {
        right: 8px;
        left: 8px;
        top: 72px;
        bottom: auto;
        width: auto;
        max-width: none;
        padding: 12px;
        border-radius: 8px;
    }
    .auth-buttons { flex-direction: column; }
    .auth-buttons .button { width: 100%; }
}


.input-field{
    width: calc(100% - 20px);
    height: 20px;
}

.input-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-container .input-icon {
  font-size: 1.1rem;
  flex: 0 0 auto;
}
.input-container .input-field {
  flex: 1 1 auto;
  padding: 8px 10px;
  box-sizing: border-box;
  min-width: 0; /* éviter débordement dans flex */
}

/* Increase size of auth panel / input icons to be more visible */
.auth-panel .input-icon,
.input-container .input-icon,
.input-icon {
  font-size: 1.7rem;
  color: #e8491d;
  margin: 0;
  padding: 10 0 0 0;
}

/* Local icon fallback to replace remote Font Awesome dependency */
.fa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    line-height: 1;
    font-style: normal;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

.fa::before {
    content: "*";
}

.fa-user::before { content: "@"; }
.fa-lock::before { content: "#"; }
.fa-sign-in::before { content: ">"; }
.fa-sign-out::before { content: "<"; }
.fa-plus::before { content: "+"; }
.fa-pencil::before { content: "E"; }
.fa-trash::before { content: "X"; }

/* Ensure the input field keeps good spacing when icon is larger */
.input-container .input-field,
.input-field {
  padding-left: 10px;
  flex: 1 1 auto;
  box-sizing: border-box;
}