@import url('https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700,900&display=swap');

:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #172033;
    --text-muted: #5b667a;
    --border: #d8e0ea;
    --primary: #0f766e;
    --primary-hover: #115e59;
    --nav-bg: #0f172a;
    --nav-pill: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-full: 999px;
    --max-width: 1120px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Satoshi', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 28%),
        var(--bg);
}

a {
    color: inherit;
}

.site-header {
    background: var(--nav-bg);
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.site-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px;
}

.site-title {
    margin: 0 0 12px;
    font-size: clamp(1.35rem, 2vw, 2rem);
    line-height: 1.1;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: var(--radius-full);
    background: var(--nav-pill);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 18px 16px 32px;
}

.page-section,
.card,
form,
.table-wrap,
.summary-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.page-section,
.card,
.summary-box {
    padding: 20px;
    margin-bottom: 16px;
}

.card.dashboard-card {
    padding: 12px 0;
}

h1,
h2,
h3 {
    margin-top: 0;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.2rem, 1rem + 1vw, 1.65rem);
    margin-bottom: 14px;
}

h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

p {
    margin-top: 0;
    color: var(--text-muted);
}

form {
    padding: 20px;
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

input,
textarea,
select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text);
    font: inherit;
    outline: none;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

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

button,
.btn,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border: none;
    border-radius: 14px;
    background: var(--primary);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

button:hover,
.btn:hover,
input[type="submit"]:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
}

table {
    width: 100%;
/*    min-width: 680px;*/
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--surface-soft);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
}

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

tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: var(--radius-full);
    background: rgba(15, 118, 110, 0.10);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.two-col {
    display: grid;
    gap: 16px;
}

.help-text,
.small-text {
    font-size: 0.92rem;
    color: var(--text-muted);
}

@media (min-width: 768px) {
    .site-header-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
        padding: 18px 20px;
    }

    .site-title {
        margin: 0;
        max-width: 45%;
    }

    .site-nav {
        justify-content: flex-end;
    }

    .container {
        padding: 28px 20px 40px;
    }

    .two-col {
        grid-template-columns: 1fr 1fr;
    }

    .page-section,
    .card,
    .summary-box,
    form {
        padding: 24px;
    }
}

@media (max-width: 767px) {
    .site-nav a {
        flex: 1 1 auto;
    }
/*
    table {
        min-width: 620px;
    }*/
}

.field-group {
    display: grid;
    gap: 6px;
}

.stack-form {
    gap: 18px;
}

.inline-form {
    display: inline;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.inline-form button {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.92rem;
}

.muted {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.page-header {
    margin-bottom: 16px;
}
/* original code
@media (max-width: 767px) {
    .table-wrap {
        overflow: visible;
    }

    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table th,
    .responsive-table td,
    .responsive-table tr {
        display: block;
        width: 100%;
    }

    .responsive-table {
        min-width: 0;
        background: transparent;
        border: none;
    }

    .responsive-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .responsive-table tbody {
        display: grid;
        gap: 14px;
    }

    .responsive-table tr {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        padding: 8px 14px;
    }

    .responsive-table td {
        display: grid;
        grid-template-columns: 110px 1fr;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border);
        align-items: start;
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-size: 0.8rem;
        font-weight: 700;
        color: var(--text);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .responsive-table td[data-label="Actions"] {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .responsive-table td[data-label="Actions"]::before {
        margin-bottom: 2px;
    }

    .responsive-table td[data-label="Actions"] .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .responsive-table td[data-label="Actions"] .inline-form {
        display: block;
        width: 100%;
    }

    .responsive-table td[data-label="Actions"] button {
        width: 100%;
    }
}

*/

/*
@media (max-width: 767px) {
    .table-wrap {
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 12px;
    }

    .responsive-table {
        display: table;
        width: 100%;
        min-width: 620px;
        border-collapse: collapse;
        background: var(--surface);
    }

    .responsive-table thead {
        display: table-header-group;
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        border: 0;
    }

    .responsive-table tbody {
        display: table-row-group;
    }

    .responsive-table tr {
        display: table-row;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
    }

    .responsive-table th,
    .responsive-table td {
        display: table-cell;
        width: auto;
        padding: 10px 12px;
        border-bottom: 1px solid var(--border);
        text-align: left;
        vertical-align: top;
        white-space: nowrap;
    }

    .responsive-table td::before {
        content: none;
    }

    .responsive-table td[data-label="Actions"] .actions {
        flex-direction: row;
        align-items: center;
    }

    .responsive-table td[data-label="Actions"] .inline-form {
        display: inline;
        width: auto;
    }

    .responsive-table td[data-label="Actions"] button {
        width: auto;
    }
}


/* end of  second  edit */




.eyebrow {
    margin-bottom: 10px;
}

.back-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.back-link:hover,
.back-link:focus-visible {
    text-decoration: underline;
}

.badge-neutral {
    background: rgba(91, 102, 122, 0.12);
    color: var(--text-muted);
}

.section-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.sort-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: var(--radius-full);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.sort-link:hover,
.sort-link:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
}

.sort-link-active {
    background: rgba(15, 118, 110, 0.10);
    border-color: rgba(15, 118, 110, 0.35);
    color: var(--primary);
}



/*  message preview*/
.message-preview {
    background: #f8f9fb;
    border: 1px solid #d9dee7;
    border-radius: 8px;
    padding: 12px;
    overflow-wrap: break-word;
}

.message-preview-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
}

.phone-preview {
    max-width: 420px;
    border: 1px solid #cfd6df;
    border-radius: 20px;
    background: #111827;
    padding: 12px;
    margin-top: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.phone-preview-header {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.phone-preview-screen {
    background: #f3f4f6;
    border-radius: 14px;
    padding: 16px;
    min-height: 140px;
}

.message-bubble {
    max-width: 100%;
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #dbe1e8;
    border-radius: 16px 16px 16px 6px;
    padding: 12px 14px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.message-preview-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.45;
}

.flash-messages { margin: 1rem 0; }
.flash { padding: 0.75rem 1rem; border-radius: 4px; margin-bottom: 0.5rem; }
.flash-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ===== DASHBOARD LIST TABLE OVERRIDE ===== */
.list-table {
    min-width: 0 !important;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.list-table th,
.list-table td {
    padding: 6px 6px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-table th {
    background: var(--surface-soft);
    font-weight: 700;
    font-size: 0.78rem;
}

.col-check { width: 28px; }
.col-name { max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
.col-phone { width: 105px; }
.col-status { width: 75px; }
.col-date { width: 110px; }
.col-action { width: 45px; text-align: right; }

.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
}

.status-badge.waiting {
    background: #fff3cd;
    color: #856404;
}

.btn-sm {
    min-height: 30px !important;
    padding: 3px 8px !important;
    font-size: 0.78rem !important;
    border-radius: 8px !important;
}

.bulk-action-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.bulk-action-bar select {
    min-height: 36px;
    padding: 6px 10px;
    width: auto;
}

.bulk-action-bar button {
    min-height: 36px !important;
    padding: 6px 14px !important;
}

.record-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pagination {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.82rem;
}

.page-btn:hover { background: var(--surface-soft); }

.page-btn-active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.empty-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .col-date { display: none; }
    .col-phone { width: 95px; }
}


/*
mobile override boxes remove
*/
@media (max-width: 767px) {
    .container {
        padding: 12px 8px 24px;
    }

    .page-section,
    .card,
    .summary-box,
    form,
    .table-wrap {
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding-left: 0;
        padding-right: 0;
    }

    .page-section,
    .card,
    .summary-box {
        padding-top: 12px;
        padding-bottom: 12px;
        margin-bottom: 10px;
    }

    form {
        padding: 12px 0;
        margin-bottom: 12px;
    }
}



/* scrolling  on mobile */
@media (max-width: 767px) {
    .table-wrap.client-list-scroll {
        max-height: 65vh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap.client-list-scroll thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--surface-soft);
    }
}

/* Default: show everything on desktop */
.list-table {
  /* optional: desktop styles here */
}

.hide-on-mobile {
  display: table-cell;
}
.hide-on-desktop {
  display: none;
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .list-table {
    width: 100%;
    table-layout: fixed;
 /*   background-color: rgba(255, 0, 0, 0.05); /* TEMP: debug */
  }

  .hide-on-mobile {
    display: none;
  }

  .hide-on-desktop {
    display: table-cell;
  }

  .list-table th.col-check,
  .list-table td.col-check {
    width: 40px;
  }
  .list-table th.col-action,
  .list-table td.col-action {
    width: 70px;
  }
}

.notification-history-mobile {
  display: none;
}

.notification-history-desktop {
  display: block;
}

.notification-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 14px;
  margin-top: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.notification-card-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #eef2f7;
}

.notification-card-row:last-of-type {
  border-bottom: none;
}

.notification-card-row .label {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.85rem;
}

.notification-card-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 768px) {
  .notification-history-desktop {
    display: none !important;
  }

  .notification-history-mobile {
    display: block !important;
  }
}