:root {
    --bg: #f4f3ef;
    --card: #fffdf8;
    --text: #1f2a2e;
    --muted: #6f7a7e;
    --brand: #0f7c82;
    --brand-dark: #0a4f53;
    --accent: #f39a34;
    --danger: #b3261e;
    --success: #1a7f37;
    --border: #ddd8ce;
    --shadow: 0 10px 30px rgba(23, 31, 36, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Lucida Sans Unicode", sans-serif;
    background:
        radial-gradient(circle at 10% -10%, rgba(15, 124, 130, 0.16), transparent 45%),
        radial-gradient(circle at 90% 0%, rgba(243, 154, 52, 0.2), transparent 35%),
        var(--bg);
    color: var(--text);
}

.shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px 14px 48px;
    animation: shell-enter 360ms ease;
}

@keyframes shell-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.topbar .actions {
    align-items: center;
    justify-content: flex-end;
}

.topbar .actions a {
    display: inline-flex;
    text-decoration: none;
}

.topbar .actions button {
    white-space: nowrap;
}

.brand {
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--brand-dark);
}

.subtitle {
    color: var(--muted);
    font-size: 0.95rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 14px;
    margin-bottom: 14px;
}

.auth-shell {
    max-width: 720px;
    margin: 20px auto 14px;
}

.login-card {
    background:
        radial-gradient(circle at 0 0, rgba(15, 124, 130, 0.08), transparent 45%),
        radial-gradient(circle at 100% 10%, rgba(243, 154, 52, 0.1), transparent 40%),
        var(--card);
}

.auth-head {
    margin-bottom: 10px;
}

.auth-kicker {
    display: inline-block;
    border: 1px solid #d5dfdf;
    background: #f6fbfb;
    color: #2f5f63;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.auth-title {
    margin: 8px 0 4px;
    font-size: 1.35rem;
    line-height: 1.15;
}

.auth-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.auth-grid {
    margin-top: 12px;
}

.auth-actions {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-note {
    color: var(--muted);
    font-size: 0.84rem;
}

.grid {
    display: grid;
    gap: 10px;
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 700px) {
    .grid.cols-2,
    .grid.cols-3 {
        grid-template-columns: 1fr;
    }
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.field label {
    color: var(--muted);
    font-size: 0.88rem;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #fff;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(15, 124, 130, 0.25);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 124, 130, 0.08);
}

button {
    border: 0;
    border-radius: 11px;
    padding: 10px 14px;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

button:hover {
    transform: translateY(-1px);
}

button,
.actions a {
    min-height: 42px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    box-shadow: 0 8px 20px rgba(15, 124, 130, 0.32);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #c86b11);
    color: #fff;
    box-shadow: 0 8px 20px rgba(243, 154, 52, 0.3);
}

.btn-soft {
    background: #f4f0e8;
    color: var(--text);
}

.btn-danger {
    background: #fce8e6;
    color: var(--danger);
}

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.92rem;
}

.pill.active {
    background: var(--brand-dark);
    color: #fff;
    border-color: transparent;
}

.barber-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.barber-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    border-radius: 14px;
    padding: 10px;
    background: #fff;
}

.barber-media {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 46px;
    border: 1px solid var(--border);
    background: #eef2f3;
}

.barber-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.barber-avatar {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #36545a;
    background: linear-gradient(145deg, #d7e9ec, #eef4f5);
}

.barber-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.barber-name {
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.barber-hint {
    color: var(--muted);
    font-size: 0.78rem;
}

.barber-card.active {
    border-color: var(--brand-dark);
    box-shadow: 0 10px 18px rgba(15, 124, 130, 0.17);
}

.barber-card.active .barber-hint {
    color: #d9f3f5;
}

.steps {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.step {
    font-size: 0.82rem;
    color: var(--muted);
    border: 1px dashed var(--border);
    border-radius: 999px;
    padding: 6px 9px;
}

.step.active {
    border-style: solid;
    color: #fff;
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.section-title {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.status-shell {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 12px;
    display: grid;
    gap: 10px;
    animation: status-enter 280ms ease;
}

@keyframes status-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status-head {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
}

.status-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.82rem;
    letter-spacing: 0.6px;
}

.status-title {
    font-weight: 700;
    font-size: 1rem;
}

.status-text {
    color: var(--muted);
    line-height: 1.35;
    margin-top: 2px;
}

.status-meta {
    border: 1px solid #e8e2d8;
    border-radius: 12px;
    padding: 10px;
    background: #f8f5ee;
    display: grid;
    gap: 6px;
}

.status-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.status-key {
    color: var(--muted);
    font-size: 0.84rem;
}

.status-value {
    font-size: 0.92rem;
    font-weight: 700;
    text-align: right;
}

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

.status-actions a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 11px;
    min-height: 42px;
}

.status-success {
    border-color: #c9e8d4;
    background: linear-gradient(180deg, #ffffff, #f6fbf7);
}

.status-success .status-icon {
    background: #d9f2e1;
    color: #1a7f37;
}

.status-notice {
    border-color: #d8e7ea;
    background: linear-gradient(180deg, #ffffff, #f4fbfc);
}

.status-notice .status-icon {
    background: #dff1f4;
    color: #0a4f53;
}

.status-error {
    border-color: #f0d0cc;
    background: linear-gradient(180deg, #ffffff, #fff6f5);
}

.status-error .status-icon {
    background: #f7ddda;
    color: #b3261e;
}

.notice {
    border-left: 4px solid var(--accent);
    background: #fff6ea;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.92rem;
}

.error {
    border-left: 4px solid var(--danger);
    background: #fce8e6;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.92rem;
}

.success {
    border-left: 4px solid var(--success);
    background: #e6f4ea;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.92rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(20, 28, 33, 0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    z-index: 40;
}

.modal-card {
    width: min(560px, 100%);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 14px;
    display: grid;
    gap: 8px;
}

.service-chip {
    border: 1px solid #d6e1e3;
    background: #f4fafb;
    color: #23464c;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.88rem;
}

.hidden {
    display: none !important;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.table th,
.table td {
    border-bottom: 1px solid var(--border);
    padding: 9px 6px;
    text-align: left;
}

.cards {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.mini-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    background: #fff;
}

.mini-card .label {
    color: var(--muted);
    font-size: 0.78rem;
}

.mini-card .value {
    font-weight: 700;
    margin-top: 2px;
}

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

.gateway-card .gateway-intro {
    margin: 0 0 10px;
    color: var(--muted);
}

.gateway-actions {
    margin-top: 2px;
}

.gateway-actions .btn-primary {
    min-width: 220px;
}

.gateway-field-note {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.35;
}

.gateway-diagnostics {
    margin-top: 8px;
    border: 1px dashed #d8d2c8;
    border-radius: 10px;
    padding: 8px 10px;
    background: #fbf8f2;
}

.gateway-diagnostics summary {
    cursor: pointer;
    font-weight: 700;
    color: #304247;
}

.app-footer {
    margin-top: 18px;
    border-top: 1px solid #d8dcd4;
    padding-top: 12px;
    color: var(--muted);
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.app-footer-dot {
    color: #a1acae;
}

.image-preview {
    width: 100%;
    min-height: 90px;
    border: 1px dashed #d0d5cc;
    border-radius: 12px;
    background: #faf8f2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.image-preview-lg {
    max-width: 220px;
    min-height: 140px;
}

.image-preview-avatar {
    width: 92px;
    height: 92px;
    min-height: 92px;
    border-radius: 50%;
    margin-top: 4px;
}

.image-preview-avatar img {
    border-radius: 50%;
}

.image-empty {
    color: var(--muted);
    font-size: 0.86rem;
    padding: 8px;
    text-align: center;
}

.table-thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #d8dfdf;
    display: block;
}

.saas-strip {
    margin-top: 12px;
    border: 1px solid #d8ddd3;
    background: #faf8f1;
    border-radius: 12px;
    padding: 10px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
    align-items: stretch;
}

.saas-chip {
    border: 1px solid #e2e1d7;
    border-radius: 10px;
    background: #fffdf9;
    padding: 8px;
}

.saas-chip .label {
    color: var(--muted);
    font-size: 0.74rem;
}

.saas-chip .value {
    margin-top: 2px;
    font-weight: 700;
    font-size: 0.9rem;
    word-break: break-word;
}

.saas-cta {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-height: 42px;
}

.mono {
    font-family: "Courier New", monospace;
}

.tenant-home-page .shell {
    max-width: 920px;
}

.tenant-brand-block {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tenant-logo-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid #d3ddde;
    overflow: hidden;
    background: #fff;
    flex: 0 0 48px;
}

.tenant-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tenant-logo-fallback {
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: #0f575d;
    background: linear-gradient(145deg, #dbecef, #f3f8f8);
}

.tenant-shop-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 320px;
}

.tenant-chip {
    border: 1px solid #d5dfdf;
    background: #f6fbfb;
    color: #2f5f63;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.82rem;
    font-weight: 700;
}

.tenant-hero {
    background:
        radial-gradient(circle at 8% 0, rgba(15, 124, 130, 0.08), transparent 35%),
        radial-gradient(circle at 90% 12%, rgba(243, 154, 52, 0.1), transparent 45%),
        var(--card);
}

.tenant-eyebrow {
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #477175;
    font-size: 0.74rem;
    font-weight: 700;
}

.tenant-title {
    margin: 6px 0 6px;
    font-size: 1.55rem;
    line-height: 1.15;
}

.tenant-actions-grid {
    margin-top: 14px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.access-tile {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    display: grid;
    gap: 4px;
    text-decoration: none;
    color: var(--text);
    background: #fff;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.access-tile strong {
    font-size: 1.03rem;
    line-height: 1.2;
}

.access-kicker {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #5f6a6e;
    font-weight: 700;
}

.access-meta {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

.access-client {
    border-color: #b7dde0;
}

.access-admin {
    border-color: #ebcca8;
}

.access-barber {
    border-color: #d7d4cf;
}

.access-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(28, 39, 43, 0.1);
}

.access-client:hover {
    border-color: #0f7c82;
}

.access-admin:hover {
    border-color: #d1822c;
}

.access-barber:hover {
    border-color: #788589;
}

.tenant-saas {
    background: #fffdf9;
}

.tenant-saas-head {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
}

.tenant-domain {
    display: inline-block;
    margin-top: 2px;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid #d6dfe0;
    background: #f5fbfb;
    font-size: 0.86rem;
    color: #355d62;
}

.tenant-saas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-top: 8px;
}

@media (max-width: 700px) {
    .shell {
        padding: 14px 12px 36px;
    }

    .topbar {
        align-items: flex-start;
    }

    .topbar .actions {
        width: 100%;
        gap: 6px;
    }

    .topbar .actions button {
        padding: 8px 11px;
        font-size: 0.95rem;
    }

    .card {
        padding: 14px 12px;
        border-radius: 14px;
    }

    .auth-shell {
        margin-top: 14px;
    }

    .auth-title {
        font-size: 1.18rem;
    }

    .barber-grid {
        grid-template-columns: 1fr;
    }

    .tenant-title {
        font-size: 1.35rem;
    }

    .tenant-logo-wrap {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 11px;
    }

    .tenant-shop-name {
        max-width: 170px;
    }

    .tenant-chip {
        padding: 6px 11px;
        font-size: 0.76rem;
    }

    .tenant-actions-grid {
        grid-template-columns: 1fr;
    }

    .tenant-saas-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .status-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 1px;
    }

    .status-value {
        text-align: left;
    }

    .status-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .saas-strip {
        grid-template-columns: 1fr;
    }

    .subtitle {
        line-height: 1.3;
    }

    .gateway-actions .btn-primary,
    .gateway-actions .btn-soft {
        width: 100%;
    }

    .modal-card {
        padding: 12px;
    }

    .app-footer {
        justify-content: center;
        text-align: center;
    }

    .app-footer-dot {
        display: none;
    }
}
