/* ============================================================
   NiXel Booking — Admin design system
   All rules scoped under .nixel-app so WP admin chrome is untouched.
   ============================================================ */

.nixel-app {
    --nx-bg:        #f5f6fc;
    --nx-card:      #ffffff;
    --nx-ink:       #191b2e;
    --nx-muted:     #6b7192;
    --nx-faint:     #9aa0bd;
    --nx-line:      #e9ebf5;
    --nx-brand1:    #6d5efc;
    --nx-brand2:    #4f8bff;
    --nx-brand-ink: #4b3fd6;
    --nx-brand-soft:#eef0ff;
    --nx-danger:    #e5484d;
    --nx-danger-soft:#fdecec;
    --nx-ok:        #16a34a;
    --nx-ok-soft:   #e7f6ec;
    --nx-warn:      #d98a00;
    --nx-warn-soft: #fbf1dc;
    --nx-radius:    18px;
    --nx-radius-sm: 11px;
    --nx-shadow:    0 12px 34px rgba(28,30,74,.09), 0 2px 6px rgba(28,30,74,.05);
    --nx-shadow-sm: 0 4px 14px rgba(28,30,74,.07);

    max-width: 1180px;
    margin: 18px 20px 60px 2px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
    color: var(--nx-ink);
}
.nixel-app * { box-sizing: border-box; }

/* ---------- Hero ---------- */
.nx-hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--nx-radius);
    padding: 30px 34px;
    color: #fff;
    background: linear-gradient(120deg, #6d5efc 0%, #5f7cff 48%, #38bdf8 100%);
    box-shadow: var(--nx-shadow);
    margin-bottom: 26px;
}
/* Decorative circles must NEVER intercept clicks (they overlap the top-right
   corner where buttons like "Sign out" live) — pointer-events:none is load-bearing. */
.nx-hero::after {
    content: "";
    position: absolute; right: -60px; top: -60px;
    width: 260px; height: 260px; border-radius: 50%;
    background: rgba(255,255,255,.12);
    pointer-events: none;
}
.nx-hero::before {
    content: "";
    position: absolute; right: 70px; bottom: -110px;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255,255,255,.08);
    pointer-events: none;
}
/* Keep real hero content (buttons, links) above the decorations. */
.nx-hero > * { position: relative; z-index: 1; }
.nx-hero h1 {
    color: #fff; font-size: 27px; font-weight: 800; margin: 0 0 6px;
    letter-spacing: -.4px; padding: 0;
}
.nx-hero p { margin: 0; color: rgba(255,255,255,.86); font-size: 14px; max-width: 620px; }
.nx-hero .nx-eyebrow {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
    background: rgba(255,255,255,.18); padding: 5px 11px; border-radius: 40px; margin-bottom: 14px;
}

/* ---------- Stat row ---------- */
.nx-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.nx-stat {
    flex: 1; min-width: 170px; background: var(--nx-card); border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius-sm); padding: 18px 20px; box-shadow: var(--nx-shadow-sm);
}
.nx-stat .n { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.nx-stat .l { font-size: 12.5px; color: var(--nx-muted); margin-top: 7px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.nx-stat .ic { float: right; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 19px; background: var(--nx-brand-soft); }

/* ---------- Cards ---------- */
.nx-card {
    background: var(--nx-card); border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius); box-shadow: var(--nx-shadow); padding: 26px 28px; margin-bottom: 26px;
}
.nx-card > h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -.2px; }
.nx-card > .sub { margin: 0 0 22px; color: var(--nx-muted); font-size: 13.5px; }
.nx-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.nx-section-head h2 { margin: 0; font-size: 18px; font-weight: 700; }

/* ---------- Business grid ---------- */
.nx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.nx-biz {
    position: relative; background: var(--nx-card); border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius); padding: 20px 20px 16px; box-shadow: var(--nx-shadow-sm);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.nx-biz:hover { transform: translateY(-3px); box-shadow: var(--nx-shadow); border-color: #d9ddf2; }
.nx-biz-top { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.nx-avatar {
    width: 46px; height: 46px; border-radius: 13px; flex: none; display: grid; place-items: center;
    color: #fff; font-weight: 800; font-size: 18px; letter-spacing: -.5px;
    background: linear-gradient(135deg, #6d5efc, #38bdf8);
}
.nx-biz-name { font-weight: 700; font-size: 15.5px; line-height: 1.2; }
.nx-biz-slug { color: var(--nx-faint); font-size: 12px; margin-top: 2px; }
.nx-biz-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.nx-chip {
    font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 30px;
    background: #f1f2f9; color: #565c81;
}
.nx-shortcode {
    display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px;
    background: #f6f7fc; border: 1px dashed #d5d9ee; color: #5a5f82; border-radius: 9px;
    padding: 8px 11px; margin-bottom: 15px; overflow-x: auto; white-space: nowrap;
}
.nx-biz-actions { display: flex; gap: 8px; }

/* ---------- Badges ---------- */
.nx-badge { font-size: 11.5px; font-weight: 700; padding: 4px 11px; border-radius: 30px; display: inline-flex; align-items: center; gap: 5px; }
.nx-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.nx-badge.ok     { background: var(--nx-ok-soft); color: var(--nx-ok); }
.nx-badge.paused { background: var(--nx-warn-soft); color: var(--nx-warn); }
/* Per-status colours — Confirmed and Completed used to share one green and were
   impossible to tell apart at a glance. Each lifecycle state now owns a hue. */
.nx-badge.st-pending   { background: var(--nx-warn-soft); color: var(--nx-warn); }
.nx-badge.st-confirmed { background: var(--nx-ok-soft);   color: var(--nx-ok); }
.nx-badge.st-seated    { background: #e6f0ff;             color: #1d63d1; }
.nx-badge.st-completed { background: #ece9fd;             color: #5b45d6; }
.nx-badge.st-cancelled { background: var(--nx-danger-soft); color: var(--nx-danger); }
.nx-badge.st-noshow    { background: #eceef3;             color: #6b7280; }

/* ---------- Buttons ---------- */
.nixel-app .nx-btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    font-size: 13.5px; font-weight: 600; padding: 9px 16px; border-radius: 10px;
    border: 1px solid var(--nx-line); background: #fff; color: var(--nx-ink);
    text-decoration: none; line-height: 1.2; transition: all .15s ease;
}
/* Every :hover keeps an explicit colour so button text never washes out under a
   theme/WP `a:hover` override (front-end especially). */
.nixel-app .nx-btn:hover { border-color: #c8cdea; background: #fafbff; color: var(--nx-ink); }
.nixel-app .nx-btn-primary {
    border: 0; color: #fff;
    background: linear-gradient(120deg, #6d5efc, #4f8bff);
    box-shadow: 0 8px 18px rgba(97,88,255,.32);
}
.nixel-app .nx-btn-primary, .nixel-app .nx-btn-primary:hover, .nixel-app .nx-btn-primary:focus { color: #fff; }
.nixel-app .nx-btn-primary:hover { background: linear-gradient(120deg, #5b4ef0, #3f7df5); }
.nixel-app .nx-btn-review { color: #b8860b; border-color: #f0d78a; background: #fff; }
.nixel-app .nx-btn-review:hover { background: #fdf6e3; border-color: #e6c86a; color: #966d09; }
/* "Mark completed" — matches the violet Completed badge so the action and the
   resulting status read as the same thing. */
.nixel-app .nx-btn-done { color: #5b45d6; border-color: #d6cffb; background: #fff; }
.nixel-app .nx-btn-done:hover { background: #ece9fd; border-color: #c4b9f7; color: #4a36bd; }
.nixel-app .nx-btn-danger { color: var(--nx-danger); border-color: #f3d3d4; background: #fff; }
.nixel-app .nx-btn-danger:hover { background: var(--nx-danger-soft); border-color: #ecbfc0; color: var(--nx-danger); }
.nixel-app .nx-btn-white { background: #fff; border: 0; color: var(--nx-brand-ink); font-weight: 700; box-shadow: 0 6px 16px rgba(20,22,60,.16); }
.nixel-app .nx-btn-white:hover { background: #fff; color: var(--nx-brand-ink); transform: translateY(-1px); }
.nixel-app .nx-btn-lg { padding: 12px 22px; font-size: 14.5px; }
.nixel-app .nx-btn-sm { padding: 7px 12px; font-size: 12.5px; }

/* ---------- Forms ---------- */
.nx-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 22px; }
.nx-field { display: flex; flex-direction: column; gap: 7px; }
.nx-field.full { grid-column: 1 / -1; }
.nx-field label { font-size: 13px; font-weight: 600; color: #3a3f5c; }
.nx-field .hint { font-size: 12px; color: var(--nx-faint); font-weight: 400; }
.nixel-app .nx-field input[type=text],
.nixel-app .nx-field input[type=email],
.nixel-app .nx-field input[type=tel],
.nixel-app .nx-field input[type=number],
.nixel-app .nx-field input[type=time],
.nixel-app .nx-field input[type=date],
.nixel-app .nx-field select,
.nixel-app .nx-field textarea {
    width: 100%; padding: 11px 13px; border: 1.5px solid #e2e5f2; border-radius: 11px;
    background: #fbfbfe; font-size: 14px; color: var(--nx-ink); box-shadow: none; min-height: 0;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; line-height: 1.3;
}
.nixel-app .nx-field select { height: auto; }
.nixel-app .nx-field input:focus,
.nixel-app .nx-field select:focus,
.nixel-app .nx-field textarea:focus {
    outline: none; border-color: var(--nx-brand1); background: #fff;
    box-shadow: 0 0 0 4px rgba(109,94,252,.14);
}
.nx-field textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical; }

/* toggle */
.nx-toggle { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: #3a3f5c; }
.nx-toggle input { position: absolute; opacity: 0; }
.nx-toggle .track { width: 42px; height: 24px; border-radius: 40px; background: #d6d9ec; position: relative; transition: background .18s ease; flex: none; }
.nx-toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .18s ease; }
.nx-toggle input:checked + .track { background: linear-gradient(120deg, #6d5efc, #4f8bff); }
.nx-toggle input:checked + .track::after { transform: translateX(18px); }

.nx-form-actions { margin-top: 24px; display: flex; gap: 10px; align-items: center; }

/* ---------- Notices ---------- */
.nx-notice { border-radius: 12px; padding: 14px 18px; margin-bottom: 22px; font-size: 14px; display: flex; align-items: center; gap: 11px; box-shadow: var(--nx-shadow-sm); }
.nx-notice.ok  { background: var(--nx-ok-soft); color: #14612e; border: 1px solid #c6e9d2; }
.nx-notice.err { background: var(--nx-danger-soft); color: #a3282b; border: 1px solid #f2cdce; }
.nx-notice .em { font-weight: 700; }
.nx-notice code { background: rgba(0,0,0,.06); padding: 2px 8px; border-radius: 6px; font-size: 13px; }

/* ---------- Empty state ---------- */
.nx-empty { text-align: center; padding: 46px 20px; color: var(--nx-muted); }
.nx-empty .big { width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; font-size: 28px; background: var(--nx-brand-soft); }
.nx-empty h3 { margin: 0 0 6px; color: var(--nx-ink); font-size: 17px; }
.nx-empty p { margin: 0; font-size: 13.5px; }

/* ---------- Editor layout ---------- */
.nx-back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--nx-muted); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.nx-back:hover { color: var(--nx-brand-ink); }
.nx-danger-zone { border: 1.5px solid #f3d3d4; border-radius: var(--nx-radius); padding: 22px 26px; background: #fffafa; }
.nx-danger-zone h2 { color: var(--nx-danger); margin: 0 0 4px; font-size: 16px; }
.nx-danger-zone .sub { color: #b26; opacity: .8; font-size: 13px; margin: 0 0 16px; }

/* weekday hours rows */
.nx-hours { display: flex; flex-direction: column; gap: 10px; }
.nx-hour-row { display: grid; grid-template-columns: 46px 84px 1fr; gap: 14px; align-items: start; padding: 12px 14px; border: 1px solid var(--nx-line); border-radius: 12px; background: #fff; }
.nx-hour-row.closed { background: #f7f8fc; }
.nx-hour-row .wd { font-weight: 700; font-size: 13.5px; color: #3a3f5c; padding-top: 7px; }
.nx-day-toggle { gap: 0 !important; padding-top: 5px; }
.nx-day-toggle .track { margin: 0; }
.nx-day-body { display: flex; flex-direction: column; gap: 8px; }
.nx-sessions { display: flex; flex-direction: column; gap: 8px; }
.nx-session { display: flex; align-items: center; gap: 10px; }
.nx-session .to { color: var(--nx-muted); font-size: 13px; }
.nixel-app .nx-session select { min-width: 122px; padding: 9px 11px; border: 1.5px solid #e2e5f2; border-radius: 10px; background: #fbfbfe; font-size: 13.5px; }
.nixel-app .nx-session-remove { border: 0; background: #f1f2f9; color: #8a90ad; width: 26px; height: 26px; border-radius: 8px; cursor: pointer; font-size: 10px; line-height: 1; }
.nixel-app .nx-session-remove:hover { background: #fde8e8; color: #c0392b; }
.nx-session:only-child .nx-session-remove { visibility: hidden; }
.nixel-app .nx-add-session { align-self: flex-start; background: none; border: 1px dashed #cfd4ea; color: var(--nx-brand-ink); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.nixel-app .nx-add-session:hover { background: var(--nx-brand-soft); }
.nx-closed-tag { display: none; color: var(--nx-faint); font-size: 13px; font-weight: 600; padding-top: 7px; }
.nx-hour-row.closed .nx-sessions, .nx-hour-row.closed .nx-add-session { display: none; }
.nx-hour-row.closed .nx-closed-tag { display: inline-block; }

/* inline add + chips */
.nx-inline-add { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.nixel-app .nx-inline-add input, .nixel-app .nx-inline-add select { padding: 10px 12px; border: 1.5px solid #e2e5f2; border-radius: 10px; background: #fbfbfe; font-size: 14px; color: var(--nx-ink); }
.nixel-app .nx-inline-add input:focus, .nixel-app .nx-inline-add select:focus { outline: none; border-color: var(--nx-brand1); box-shadow: 0 0 0 4px rgba(109,94,252,.14); }
.nx-chip-list { display: flex; flex-wrap: wrap; gap: 9px; min-height: 10px; }
.nx-chip2 { display: inline-flex; align-items: center; gap: 9px; background: var(--nx-brand-soft); color: var(--nx-brand-ink); font-weight: 600; font-size: 13px; padding: 7px 8px 7px 14px; border-radius: 30px; }
.nixel-app .nx-chip-x { border: 0; background: rgba(75,63,214,.14); color: var(--nx-brand-ink); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; font-size: 10px; line-height: 1; display: grid; place-items: center; padding: 0; }
.nixel-app .nx-chip-x:hover { background: rgba(75,63,214,.28); }
.nx-chip-empty { color: var(--nx-faint); font-size: 13px; font-style: italic; }

/* simple data table */
.nixel-app .nx-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--nx-muted); font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--nx-line); }
.nixel-app .nx-table td { padding: 12px; border-bottom: 1px solid var(--nx-line); font-size: 14px; vertical-align: middle; }
/* keep the final row's rule visible (it was being clipped by the scroll box) */
.nixel-app .nx-table tr:last-child td { border-bottom: 1px solid var(--nx-line); }
.nx-table-scroll { overflow-x: auto; padding-bottom: 2px; }
.nixel-app .nx-mini-input { width: 100%; max-width: 260px; padding: 8px 10px; border: 1.5px solid #e2e5f2; border-radius: 9px; background: #fbfbfe; font-size: 13px; color: var(--nx-ink); }

/* Image upload live previews */
.nx-img-preview { display: flex; flex-wrap: wrap; gap: 10px; }
.nx-img-preview:not(:empty) { margin-top: 10px; }
.nx-img-preview img { height: 76px; max-width: 200px; width: auto; object-fit: contain; border-radius: 10px; background: #f6f7fc; padding: 4px; box-shadow: var(--nx-shadow-sm); }

/* Template picker */
.nx-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 14px; }
.nx-tpl { cursor: pointer; text-align: center; }
.nx-tpl input { position: absolute; opacity: 0; }
.nx-tpl .sw { display: block; height: 58px; box-shadow: 0 4px 12px rgba(28,30,74,.16); transition: transform .14s ease, outline .14s ease; outline: 3px solid transparent; outline-offset: 3px; }
.nx-tpl:hover .sw { transform: translateY(-2px); }
.nx-tpl input:checked + .sw { outline-color: var(--nx-brand1); }
.nx-tpl .lb { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: #3a3f5c; }

/* ---------- Bookings table: column balance + stacked actions ---------- */
/* Fixed px on the tight columns so buttons/refs never wrap; Guest absorbs the
   slack. The table scrolls inside .nx-table-scroll on narrow screens. */
.nx-bookings-table { table-layout: fixed; }
.nx-bookings-table .c-when    { width: 132px; }
.nx-bookings-table .c-guest   { width: auto; min-width: 150px; }
.nx-bookings-table .c-party   { width: 168px; }  /* holds 4 stacked lines */
.nx-bookings-table .c-contact { width: 200px; }
.nx-bookings-table .c-ref     { width: 122px; }  /* refs never wrap */
.nx-bookings-table .c-status  { width: 112px; }
.nx-bookings-table .c-actions { width: 132px; }  /* fits a full-width button */
.nx-bookings-table th.c-actions, .nx-bookings-table th.c-status { white-space: nowrap; }
.nx-bookings-table td.c-ref code { white-space: nowrap; font-size: 12.5px; }
.nx-bookings-table td.c-party { white-space: nowrap; }

/* Actions stack vertically; display:contents lets the <form>'s buttons join
   the same column flow as the View/Edit links. */
.nixel-app td.nx-actions-cell { display: flex; flex-direction: column; gap: 8px; align-items: stretch; vertical-align: top; padding: 12px 10px; }
/* display:contents dissolves the form so its buttons become flex items of the
   cell and inherit its gap. !important because an inline style="display:inline"
   would otherwise win and collapse the whole form into one gap-less item. */
.nixel-app td.nx-actions-cell > form { display: contents !important; }
.nixel-app td.nx-actions-cell .nx-btn {
    width: 100%; box-sizing: border-box; justify-content: center;
    padding: 7px 10px; font-size: 12px; gap: 5px;
    white-space: nowrap;      /* keep "✓ Confirm" on one line */
    line-height: 1.25; text-decoration: none;
}

/* Booking detail view */
.nx-view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 780px) { .nx-view-grid { grid-template-columns: 1fr; } }
.nx-bookings-table td { vertical-align: top; }

/* icon-labelled detail list */
.nx-dlist { display: flex; flex-direction: column; }
.nx-drow { display: flex; align-items: flex-start; gap: 14px; padding: 13px 0; border-bottom: 1px solid #f0f2f8; }
.nx-drow:last-child { border-bottom: 0; }
.nx-dlabel { display: flex; align-items: center; gap: 9px; width: 150px; flex: none; color: #8a94a6; font-size: 13px; font-weight: 600; }
.nx-dicon { width: 30px; height: 30px; border-radius: 9px; background: var(--nx-brand-soft); display: grid; place-items: center; font-size: 14px; }
.nx-dval { font-size: 14.5px; font-weight: 600; color: var(--nx-ink); padding-top: 4px; word-break: break-word; }
.nx-dval a { color: var(--nx-brand-ink); text-decoration: none; }

/* party at-a-glance band */
.nx-party-band { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.nx-party-total { background: linear-gradient(135deg, #6d5efc, #4f8bff); color: #fff; border-radius: 16px; padding: 18px 26px; text-align: center; min-width: 120px; box-shadow: 0 10px 24px rgba(97,88,255,.28); }
.nx-party-total .n { font-size: 40px; font-weight: 800; line-height: 1; }
.nx-party-total .l { font-size: 12px; margin-top: 6px; opacity: .9; text-transform: uppercase; letter-spacing: .6px; }
.nx-party-split { display: flex; gap: 14px; flex-wrap: wrap; flex: 1; }
.nx-pchip { display: flex; align-items: center; gap: 12px; background: #f7f8fc; border: 1px solid var(--nx-line); border-radius: 13px; padding: 14px 20px; }
.nx-pchip .ic { font-size: 24px; }
.nx-pchip .pn { font-size: 22px; font-weight: 800; line-height: 1; color: var(--nx-ink); }
.nx-pchip .pl { font-size: 11.5px; color: var(--nx-muted); margin-top: 4px; font-weight: 600; }
.nx-view-hero h1 { margin-top: 4px; }

/* Front-end account + dashboard — full-bleed out of the theme's narrow column.
   NOTE: 100vw INCLUDES the scrollbar while the content box does not, so this
   overflows by the scrollbar width unless we clip it. overflow-x:hidden is
   load-bearing here (inner content is capped at 1180px, so nothing is lost). */
.nixel-front { width: 100vw; margin-left: calc(50% - 50vw); padding: 26px 24px 40px; box-sizing: border-box; max-width: none; overflow-x: hidden; }
.nixel-front > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
/* A row wrapper for inline links (e.g. "← Back"): auto margins only centre
   BLOCK boxes, so an inline-flex link placed directly here would escape to the
   far left of the full-bleed container. Keep such links inside this wrapper. */
.nx-backrow { display: block; }
.nixel-front > .nx-back { display: flex; max-width: 1180px; } /* safety net if one is ever unwrapped */
.nx-account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 820px) { .nx-account-grid { grid-template-columns: 1fr; } }
.nx-guest .nx-field { margin-bottom: 14px; }
.nx-guest-card { border-top: 1px solid var(--nx-line); padding-top: 16px; }
.nx-guest-card .g-when { color: var(--nx-muted); font-size: 13px; margin: 4px 0 14px; }
.nx-guest-card .g-lbl { display: block; font-size: 13px; font-weight: 600; color: #3a3f5c; margin-bottom: 6px; }
.nixel-app .nx-guest input[type=datetime-local] { width: 100%; padding: 11px 13px; border: 1.5px solid #e2e5f2; border-radius: 11px; background: #fbfbfe; font-size: 14px; }
.g-result.err { color: var(--nx-danger); font-size: 14px; }
.nx-guest-ok { background: var(--nx-ok-soft); color: #14612e; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }

/* ---------- Branded confirm modal (replaces native confirm()) ---------- */
.nx-modal { position: fixed; inset: 0; background: rgba(15,18,45,.55); backdrop-filter: blur(3px); z-index: 2147483600; display: none; align-items: center; justify-content: center; padding: 20px; }
.nx-modal.on { display: flex; animation: nxFade .16s ease; }
@keyframes nxFade { from { opacity: 0; } to { opacity: 1; } }
.nx-modal-box { background: #fff; border-radius: 18px; padding: 30px 30px 24px; max-width: 430px; width: 100%; text-align: center;
    box-shadow: 0 24px 70px rgba(15,18,45,.32); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: nxPop .18s cubic-bezier(.2,.9,.3,1.2); }
@keyframes nxPop { from { transform: scale(.94) translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.nx-modal-icon { width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center;
    font-size: 26px; font-weight: 800; color: #6d5efc; background: #eef0ff; }
.nx-modal-icon.danger { color: #e5484d; background: #fdecec; }
.nx-modal-title { margin: 0 0 8px; font-size: 19px; font-weight: 800; color: #191b2e; }
.nx-modal-msg { margin: 0 0 24px; font-size: 14.5px; line-height: 1.55; color: #6b7192; }
.nx-modal-actions { display: flex; gap: 10px; justify-content: center; }
.nx-modal-actions .nx-btn { min-width: 120px; justify-content: center; cursor: pointer;
    display: inline-flex; align-items: center; font-size: 13.5px; font-weight: 600; padding: 11px 18px; border-radius: 10px;
    border: 1px solid #e9ebf5; background: #fff; color: #191b2e; text-decoration: none; }
.nx-modal-actions .nx-btn-primary { border: 0; color: #fff; background: linear-gradient(120deg,#6d5efc,#4f8bff); }
.nx-modal-actions .nx-btn-danger { border: 0; color: #fff; background: linear-gradient(120deg,#e5484d,#f0705a); }
@media (max-width: 480px) { .nx-modal-actions { flex-direction: column-reverse; } .nx-modal-actions .nx-btn { width: 100%; } }

/* ---------- Table toolbar: search + sortable headers ---------- */
.nx-tbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.nixel-app .nx-tsearch { flex: 1; min-width: 220px; max-width: 380px; padding: 10px 14px; border: 1.5px solid #e2e5f2;
    border-radius: 10px; background: #fbfbfe; font-size: 14px; color: var(--nx-ink); }
.nixel-app .nx-tsearch:focus { outline: none; border-color: var(--nx-brand1); box-shadow: 0 0 0 4px rgba(109,94,252,.14); }
.nx-tcount { font-size: 12.5px; color: var(--nx-faint); font-weight: 600; }
.nixel-app th.nx-sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.nixel-app th.nx-sortable::after { content: "↕"; opacity: .3; margin-left: 6px; font-size: 11px; }
.nixel-app th.nx-sortable:hover::after { opacity: .65; }
.nixel-app th.nx-sortable.sorted { color: var(--nx-brand-ink); }
.nixel-app th.nx-sortable[data-dir="asc"]::after { content: "▲"; opacity: 1; }
.nixel-app th.nx-sortable[data-dir="desc"]::after { content: "▼"; opacity: 1; }

.nx-divider { height: 1px; background: var(--nx-line); margin: 26px 0; border: 0; }

/* ============================================================
   Mobile / tablet — applies to EVERY NiXel screen
   ============================================================ */
@media (max-width: 900px) {
    .nixel-app { margin: 12px 10px 40px; }
    /* Drop the full-bleed trick on phones — the theme column is already ~full
       width there, and 100vw only reintroduces scrollbar overflow. */
    .nixel-front { width: auto; margin-left: 0; margin-right: 0; padding: 16px 14px 32px; }
    .nixel-front > * { max-width: none; }
    .nx-card { padding: 20px 18px; border-radius: 14px; }
    .nx-hero { padding: 22px 20px !important; border-radius: 14px; }
    .nx-hero h1 { font-size: 21px !important; }
    .nx-hero p { font-size: 13.5px; }
    .nx-form-grid { grid-template-columns: 1fr; gap: 14px; }
    .nx-view-grid, .nx-account-grid { grid-template-columns: 1fr; }
    .nx-stats { flex-direction: column; }
    .nx-grid { grid-template-columns: 1fr; }
    /* stacked, readable detail rows */
    .nx-drow { flex-direction: column; gap: 6px; }
    .nx-dlabel { width: auto; }
    .nx-dval { padding-top: 0; }
    /* hours editor stacks so selects never overflow */
    .nx-hour-row { grid-template-columns: 44px 1fr; row-gap: 10px; }
    .nx-hour-row .wd { padding-top: 6px; }
    .nx-day-body { grid-column: 1 / -1; }
    /* keep "open to close" on ONE line: min-width:120px forced the close select
       onto its own row and orphaned the "to", which read as two separate fields */
    .nx-session { flex-wrap: nowrap; gap: 7px; }
    .nixel-app .nx-session select { flex: 1 1 0; min-width: 0; width: 100%; padding: 9px 6px 9px 9px; font-size: 13px; }
    .nx-session .to { flex: none; font-size: 12px; }
    .nixel-app .nx-session-remove { flex: none; }
    .nx-inline-add { flex-direction: column; align-items: stretch; }
    .nixel-app .nx-inline-add input, .nixel-app .nx-inline-add select { width: 100%; }
    /* party band + buttons wrap cleanly */
    .nx-party-band { flex-direction: column; align-items: stretch; gap: 14px; }
    .nx-party-split { flex-direction: column; }
    .nx-pchip { justify-content: flex-start; }
    .nx-form-actions { flex-direction: column; align-items: stretch; }
    .nixel-app .nx-form-actions .nx-btn { justify-content: center; width: 100%; }
    .nx-section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .nixel-app .nx-mini-input { max-width: none; }
}
@media (max-width: 560px) {
    .nx-hero h1 { font-size: 19px !important; }
    .nx-tpl-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .nx-btn { font-size: 13px; padding: 9px 13px; }
}

/* ============================================================
   Phones: turn wide data tables into stacked cards.
   Every <td> carries data-label, which becomes its row label —
   no more sideways scrolling to read a booking.
   ============================================================ */
@media (max-width: 820px) {
    .nx-table-scroll { overflow-x: visible; }
    /* border:0 — the theme's own table/cell borders otherwise draw stray rules
       around the cards once rows stop behaving like table rows. */
    .nixel-app table.nx-table { min-width: 0 !important; width: 100% !important; table-layout: auto !important; border-collapse: separate; border-spacing: 0; border: 0 !important; background: transparent; }
    .nixel-app table.nx-table tbody, .nixel-app table.nx-table tfoot { display: block; border: 0 !important; }
    .nixel-app table.nx-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* a11y-hidden, sort still available via toolbar */
    .nixel-app table.nx-table tr { display: block; border: 1px solid var(--nx-line); border-radius: 14px; padding: 6px 14px; margin-bottom: 14px; background: #fff; box-shadow: var(--nx-shadow-sm); }
    /* Label ABOVE value — side-by-side is far too cramped at 375px and clips
       long values like emails. */
    .nixel-app table.nx-table td {
        display: block; width: auto !important; max-width: 100%; box-sizing: border-box;
        padding: 10px 0;
        /* theme puts border-right on every td — it draws a stray vertical rule
           down the card once cells become blocks */
        border: 0 !important; border-bottom: 1px solid #f2f4fa !important;
        text-align: left !important; white-space: normal !important;
        overflow-wrap: anywhere; word-break: normal;
    }
    /* beats the desktop `tr:last-child td` rule that keeps the final rule visible */
    .nixel-app table.nx-table tr td:last-child,
    .nixel-app table.nx-table tr:last-child td:last-child { border-bottom: 0 !important; }
    .nixel-app table.nx-table td::before {
        content: attr(data-label); display: block; margin-bottom: 4px;
        font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--nx-muted);
    }
    .nixel-app table.nx-table td:not([data-label])::before { content: none; }
    /* long emails/URLs wrap on word boundaries, never one-char-per-line */
    .nixel-app table.nx-table td a { overflow-wrap: anywhere; word-break: normal !important; }
    .nixel-app table.nx-table td.c-party { white-space: normal !important; }
    /* actions: full-width buttons in their own block, no label column */
    .nixel-app td.nx-actions-cell { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; padding: 12px 0 4px; }
    .nixel-app td.nx-actions-cell::before { content: ""; display: none; }
    .nixel-app td.nx-actions-cell .nx-btn { width: auto; flex: 1 1 auto; min-width: 96px; }
    /* search toolbar stacks */
    .nx-tbar { flex-direction: column; align-items: stretch; }
    .nixel-app .nx-tsearch { max-width: none; width: 100%; }
}
.nx-sub-h { font-size: 14px; font-weight: 700; margin: 0 0 4px; color: var(--nx-ink); }
.nx-sub-p { font-size: 12.5px; color: var(--nx-muted); margin: 0 0 14px; }
