:root {
    --brand: #0d6efd;
    --sidebar-bg: #101a2b;
    --sidebar-fg: #c7d0dd;
    --sidebar-active: #1b2a45;
}

body {
    background-color: #f4f6f9;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-fg);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 1.25rem 1.25rem;
    font-weight: 600;
    font-size: 1.1rem;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: var(--sidebar-fg);
    font-size: 1.1rem;
    line-height: 1;
    padding: .35rem;
    border-radius: .4rem;
}

.sidebar-close:hover {
    color: #fff;
    background-color: var(--sidebar-active);
}

.sidebar-nav {
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .6rem .85rem;
    border-radius: .5rem;
    color: var(--sidebar-fg);
    text-decoration: none;
    font-size: .925rem;
    transition: background-color .15s ease;
}

.sidebar-nav a:hover {
    background-color: var(--sidebar-active);
    color: #fff;
}

.sidebar-nav a.active {
    background-color: var(--brand);
    color: #fff;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    display: flex;
    align-items: center;
    padding: .75rem 1.5rem;
    background-color: #fff;
    border-bottom: 1px solid #e5e9ef;
    position: sticky;
    top: 0;
    z-index: 10;
}

.app-content {
    padding: 1.5rem;
    flex: 1;
}

.stat-card {
    border: none;
    border-radius: .75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: .65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.guest-body {
    background: linear-gradient(135deg, #0d6efd 0%, #101a2b 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.guest-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.guest-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0,0,0,.2);
}

.guest-logo {
    font-size: 2.25rem;
    color: var(--brand);
}

.medicine-row td {
    vertical-align: middle;
}

.rx-preview {
    background: #fff;
    border: 1px solid #dee2e6;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.rx-preview .rx-header {
    border-bottom: 2px solid #212529;
}

.rx-preview .rx-signature-box {
    min-height: 70px;
}

.rx-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 45%;
    transform: translate(-50%, -50%);
    opacity: 0.06;
    filter: grayscale(100%);
    pointer-events: none;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        left: -260px;
        z-index: 1050;
        transition: left .2s ease;
    }

    .app-sidebar.show {
        left: 0;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background-color: rgba(15, 20, 30, .5);
        z-index: 1049;
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease;
    }

    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

    body.sidebar-open {
        overflow: hidden;
    }
}

@media (min-width: 992px) {
    .sidebar-backdrop {
        display: none;
    }
}

/* Stack page-title headers (title/description + action button) on narrow
   screens instead of squeezing them into one row. */
@media (max-width: 575.98px) {
    .app-content > .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: stretch !important;
    }

    .app-content > .d-flex.justify-content-between.align-items-center > *:not(:last-child) {
        margin-bottom: .75rem;
    }
}

/* Let icon-only action button groups in tables wrap onto a second line
   instead of forcing the whole table to scroll just to reach them. */
@media (max-width: 767.98px) {
    .table-responsive .btn-group {
        flex-wrap: wrap;
        row-gap: .25rem;
    }
}
