/* Shared visual system for the customer, bakery, supplier, and delivery pages. */
:root {
    --patirchi-radius: 18px;
    --patirchi-focus: #ed9121;
}

:root[data-bs-theme="light"] {
    --patirchi-page: #f6f7fa;
    --patirchi-surface: #ffffff;
    --patirchi-border: #e7eaf0;
    --patirchi-shadow: 0 8px 28px rgba(25, 34, 54, .06);
}

:root[data-bs-theme="dark"] {
    --patirchi-page: #101319;
    --patirchi-surface: #1b2029;
    --patirchi-border: #303744;
    --patirchi-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

html { scroll-behavior: smooth; }
body { background-color: var(--patirchi-page) !important; }

.adminuiux-header .navbar {
    border-bottom: 1px solid var(--patirchi-border);
    box-shadow: var(--patirchi-shadow);
}

@media (max-width: 575px) {
    .adminuiux-header.inner-page .navbar {
        padding: calc(5px + env(safe-area-inset-top)) 10px 5px;
        min-height: 50px;
    }
    .adminuiux-header .navbar .navbar-brand { margin-right: 6px; }
    .adminuiux-header .navbar .navbar-brand img { height: 28px; margin-right: 6px; }
    .adminuiux-header .navbar .navbar-brand .h5 { font-size: 1rem; line-height: 20px; margin: 0; }
    .adminuiux-header .navbar .navbar-brand div :first-child { line-height: 20px; margin-bottom: 0; }
    .adminuiux-header .navbar .btn-square { min-width: 36px; min-height: 36px; line-height: 36px; }
}

.adminuiux-content { padding-bottom: 24px; }
.adminuiux-content > .container { padding-inline: clamp(16px, 3vw, 32px); }

.adminuiux-content .card:not(.bg-none) {
    border: 1px solid var(--patirchi-border);
    border-radius: var(--patirchi-radius);
    box-shadow: var(--patirchi-shadow);
    overflow: hidden;
}

.adminuiux-content .card .card-footer {
    border-top-color: var(--patirchi-border);
}

.adminuiux-content .card figure.coverimg,
.adminuiux-content .card .coverimg {
    overflow: hidden;
    border-radius: 14px;
}

.adminuiux-content .card figure.coverimg img,
.adminuiux-content .card .coverimg img {
    transition: transform .2s ease;
}

@media (hover: hover) {
    .adminuiux-content .card:hover figure.coverimg img,
    .adminuiux-content .card:hover .coverimg img { transform: scale(1.035); }
}

.adminuiux-content .btn:not(.btn-square):not(.btn-link) {
    min-height: 42px;
    border-radius: 12px;
    font-weight: 600;
}

.adminuiux-content .form-control,
.adminuiux-content .form-select {
    min-height: 44px;
    border-color: var(--patirchi-border);
    border-radius: 12px;
}

.adminuiux-content .form-control:focus,
.adminuiux-content .form-select:focus {
    border-color: var(--patirchi-focus);
    box-shadow: 0 0 0 3px rgba(237, 145, 33, .16);
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible {
    outline: 3px solid var(--patirchi-focus);
    outline-offset: 3px;
}

.adminuiux-content .text-truncated {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adminuiux-mobile-footer {
    border-top: 1px solid var(--patirchi-border);
    box-shadow: 0 -8px 25px rgba(0, 0, 0, .06);
}

.adminuiux-mobile-footer .nav-link {
    min-width: 58px;
    min-height: 48px;
    border-radius: 12px;
}

.adminuiux-mobile-footer .nav-link.active {
    background-color: rgba(var(--adminuiux-theme-1-rgb), .14);
    color: rgb(var(--adminuiux-theme-1-rgb));
    font-weight: 700;
}

/* Keep all five actions on one row, including in Telegram's narrow webview. */
@media (max-width: 767px) {
    .adminuiux-mobile-footer {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        padding: 5px max(8px, env(safe-area-inset-left)) calc(5px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
        border-radius: 18px 18px 0 0;
    }
    .adminuiux-mobile-footer .nav.nav-pills {
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        flex-wrap: nowrap !important;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .adminuiux-mobile-footer .nav-item { width: auto !important; min-width: 0 !important; margin: 0 !important; }
    .adminuiux-mobile-footer .nav-link {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0 !important;
        width: 100%;
        min-height: 48px;
        padding: 0 3px !important;
        white-space: nowrap;
    }
    .adminuiux-mobile-footer .nav-link > span:not(.badge) { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; }
    .adminuiux-mobile-footer .nav-icon { margin: 0; font-size: 20px; }
    .adminuiux-mobile-footer .nav-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .adminuiux-mobile-footer .nav-link.active { border-radius: 14px; }
}
@media (min-width: 400px) and (max-width: 767px) {
    .adminuiux-mobile-footer .nav-link.active .nav-text {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
    }
}

/* The sign-in and registration screens use their own layout. */
.glass-card {
    border-radius: 22px;
    border-color: rgba(255, 255, 255, .24);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}

.glass-input:focus-visible { outline: 3px solid rgba(237, 145, 33, .8); outline-offset: 2px; }
.settings-item:focus-visible { outline: 3px solid var(--patirchi-focus); outline-offset: -3px; }

/* Customer profile */
.profile-page { max-width: 1040px; padding-bottom: 110px !important; }
.profile-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(24px, 5vw, 48px);
    border-radius: 28px;
    background: radial-gradient(circle at 92% 12%, rgba(255, 240, 205, .65), transparent 34%),
                linear-gradient(135deg, #ffbe64 0%, #ff942b 55%, #ed6b24 100%);
    box-shadow: 0 18px 45px rgba(198, 84, 16, .24);
    color: #3b220e;
}
.profile-hero::after {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    right: -80px;
    bottom: -150px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    pointer-events: none;
}
.profile-hero-top, .profile-identity, .profile-actions, .profile-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.profile-eyebrow { color: #ad5a0a; font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.profile-hero .profile-eyebrow { color: #713b08; }
.profile-settings-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(78, 40, 6, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .23);
    color: inherit;
    font-size: .84rem;
    font-weight: 700;
    text-decoration: none;
}
.profile-settings-link:hover { background: rgba(255, 255, 255, .4); color: inherit; }
.profile-identity { justify-content: flex-start; gap: 18px; margin: 36px 0 32px; }
.profile-avatar {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    flex: 0 0 84px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .6);
    border-radius: 24px;
    background: rgba(255, 255, 255, .5);
    color: #b15c0b;
    font-size: 2.2rem;
    box-shadow: 0 10px 26px rgba(139, 64, 3, .16);
}
.profile-identity-text { min-width: 0; }
.profile-kicker { margin: 0 0 5px; color: #704315; font-size: .9rem; }
.profile-identity h1 { margin: 0 0 10px; font-size: clamp(1.5rem, 3.5vw, 2.3rem); overflow-wrap: anywhere; }
.profile-role {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(75, 35, 5, .12);
    color: #613508;
    font-size: .78rem;
    font-weight: 800;
}
.profile-actions { justify-content: flex-start; flex-wrap: wrap; gap: 10px; }
.profile-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding-inline: 18px;
    text-decoration: none;
}
.profile-primary-action { background: #39220f; border-color: #39220f; color: #fff; }
.profile-primary-action:hover { background: #22150c; border-color: #22150c; color: #fff; }
.profile-secondary-action { background: rgba(255, 255, 255, .3); border-color: rgba(65, 32, 8, .25); color: #39220f; }
.profile-secondary-action:hover { background: rgba(255, 255, 255, .5); color: #39220f; }
.profile-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 14px;
    padding: 22px 26px;
    border: 1px solid var(--patirchi-border);
    border-radius: 20px;
    background: var(--patirchi-surface);
    box-shadow: var(--patirchi-shadow);
}
.profile-meta div { display: grid; gap: 5px; min-width: 0; }
.profile-meta span { color: var(--bs-secondary-color); font-size: .78rem; }
.profile-meta strong { font-size: .94rem; overflow-wrap: anywhere; }
.profile-section-heading { gap: 20px; margin: 38px 0 17px; }
.profile-section-heading h2 { margin: 5px 0 0; font-size: clamp(1.25rem, 2.7vw, 1.7rem); }
.profile-section-heading p { color: var(--bs-secondary-color); font-size: .88rem; }
.profile-role-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.profile-role-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 17px;
    min-height: 170px;
    padding: 20px;
    border: 1px solid var(--patirchi-border);
    border-radius: 20px;
    background: var(--patirchi-surface);
    box-shadow: var(--patirchi-shadow);
    color: inherit;
    text-decoration: none;
    transition: border-color .2s ease, transform .2s ease;
}
.profile-role-card:hover { border-color: #ed9121; color: inherit; transform: translateY(-3px); }
.profile-role-card > span:nth-child(2) { display: grid; gap: 6px; min-width: 0; }
.profile-role-card strong { font-size: 1rem; }
.profile-role-card small { color: var(--bs-secondary-color); line-height: 1.35; }
.profile-role-icon { display: grid; place-items: center; width: 50px; height: 50px; flex: 0 0 50px; border-radius: 15px; font-size: 1.4rem; }
.profile-role-icon-orange { background: #fff0db; color: #ad5e03; }
.profile-role-icon-blue { background: #e7efff; color: #2c61c7; }
.profile-role-icon-green { background: #e5f7ed; color: #198356; }
.profile-role-icon-red { background: #ffebed; color: #c24655; }
.profile-role-arrow { position: absolute; top: 22px; right: 20px; color: var(--bs-secondary-color); }
.profile-reels-link {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 16px;
    padding: 14px 16px;
    border: 1px solid var(--patirchi-border);
    border-radius: 20px;
    background: var(--patirchi-surface);
    color: inherit;
    text-decoration: none;
    box-shadow: var(--patirchi-shadow);
    transition: border-color .18s ease, transform .18s ease;
}
.profile-reels-link:hover { color: inherit; border-color: #ed9121; transform: translateY(-2px); }
.profile-reels-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; background: #ed9121; color: #2a1a0d; font-size: 1.5rem; }
.profile-reels-link span:nth-child(2) { display: grid; gap: 4px; }
.profile-reels-link small { color: var(--bs-secondary-color); }
.profile-reels-link > i { margin-left: auto; }
@media (prefers-reduced-motion: reduce) {
    .profile-reels-link { transition: none; }
    .profile-reels-link:hover { transform: none; }
}

@media (max-width: 767px) {
    .profile-role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
    .profile-hero { padding: 22px; border-radius: 22px; }
    .profile-identity { gap: 14px; margin: 30px 0 26px; }
    .profile-avatar { width: 68px; height: 68px; flex-basis: 68px; border-radius: 19px; font-size: 1.85rem; }
    .profile-actions .btn { flex: 1 1 140px; }
    .profile-meta { grid-template-columns: 1fr 1fr; padding: 20px; }
    .profile-meta div:last-child { grid-column: 1 / -1; }
    .profile-section-heading p { display: none; }
    .profile-role-card { min-height: 148px; padding: 16px; gap: 14px; }
    .profile-role-card strong { font-size: .94rem; }
    .profile-role-card small { font-size: .74rem; }
}
@media (prefers-reduced-motion: reduce) {
    .profile-role-card { transition: none; }
}

@media (max-width: 575px) {
    .adminuiux-content > .container { padding-inline: 16px; }

    .adminuiux-content .row.gx-3,
    .adminuiux-content .row.gx-lg-4 { --bs-gutter-x: 12px; }

    .adminuiux-content .card .card-footer { padding: 12px; }
    .adminuiux-content .card .card-footer h6 { font-size: .94rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .adminuiux-content .card .coverimg img { transition: none; }
}
