:root {
    --app-bg: #f4f6f8;
    --app-surface: #ffffff;
    --app-text: #17202a;
    --app-muted: #667085;
    --app-border: #d9e2ec;
    --app-border-soft: #edf1f5;
    --app-primary: #198754;
    --app-primary-dark: #146c43;
    --app-radius: 8px;
    --app-shadow: 0 10px 24px rgba(16, 24, 40, 0.07);
}

html {
    min-height: 100%;
}

body.bg-light {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.7), rgba(244,246,248,0) 220px),
        var(--app-bg) !important;
    color: var(--app-text);
}

.navbar.bg-dark {
    background: #111827 !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.16);
}

.navbar {
    --bs-navbar-padding-y: 0.55rem;
}

.navbar .container-fluid {
    gap: 0.5rem;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    font-weight: 700;
    letter-spacing: 0;
}

.navbar-toggler {
    min-width: 42px;
    min-height: 42px;
    border-radius: var(--app-radius);
}

.navbar .btn,
.nav-primary-shortcuts .nav-action {
    border-radius: var(--app-radius) !important;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.navbar .form-select-sm {
    min-height: 40px;
    border-radius: var(--app-radius);
}

.container,
.container-fluid {
    --bs-gutter-x: 1rem;
}

.container.pb-5,
.container-fluid.pb-5 {
    padding-bottom: 4.5rem !important;
}

.card {
    border-color: var(--app-border);
    border-radius: var(--app-radius);
}

.card.shadow-sm {
    box-shadow: var(--app-shadow) !important;
}

.card-header {
    border-bottom-color: var(--app-border-soft);
    font-weight: 700;
}

.card-header:first-child {
    border-radius: var(--app-radius) var(--app-radius) 0 0;
}

.btn {
    border-radius: var(--app-radius);
}

.btn-sm {
    min-height: 34px;
}

.form-control,
.form-select,
.input-group-text {
    border-color: var(--app-border);
    border-radius: var(--app-radius);
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text,
.input-group > .btn {
    border-radius: 0;
}

.input-group > :first-child {
    border-top-left-radius: var(--app-radius);
    border-bottom-left-radius: var(--app-radius);
}

.input-group > :last-child {
    border-top-right-radius: var(--app-radius);
    border-bottom-right-radius: var(--app-radius);
}

.form-label {
    color: #344054;
    font-weight: 600;
}

.alert {
    border-radius: var(--app-radius);
}

.nav-pills {
    gap: 0.35rem;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
}

.nav-pills .nav-link {
    border-radius: var(--app-radius);
    white-space: nowrap;
}

.table-responsive {
    border-radius: var(--app-radius);
    scrollbar-width: thin;
}

.table {
    vertical-align: middle;
}

.table thead th {
    color: #344054;
    font-size: 0.78rem;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

.table thead.table-dark th {
    color: #ffffff;
    background-color: #212529;
    border-color: #373b3e;
}

.table thead.table-dark th.table-danger {
    color: #58151c;
    background-color: #f8d7da;
    border-color: #f1aeb5;
}

.table td,
.table th {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.badge {
    border-radius: 6px;
    font-weight: 700;
}

.modal-content {
    border: 0;
    border-radius: var(--app-radius);
    box-shadow: 0 24px 60px rgba(16, 24, 40, 0.24);
}

.modal-header,
.modal-footer {
    border-color: var(--app-border-soft);
}

#pos-live-clock {
    border: 1px solid rgba(17,24,39,0.1);
    min-height: 32px;
    border-radius: 8px;
    font-weight: 700;
    white-space: nowrap;
    flex: 0 0 auto;
}

#pos-live-clock.pos-live-clock-fixed {
    position: fixed;
    left: 0.75rem;
    bottom: 0.75rem;
    z-index: 1080;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.16);
}

@media (max-width: 767.98px) {
    .navbar .container-fluid {
        align-items: center;
    }

    .navbar-brand {
        max-width: 48vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nav-primary-shortcuts {
        max-width: calc(100vw - 118px) !important;
    }

    .navbar-collapse .navbar-nav {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 0.45rem !important;
        padding-top: 0.75rem !important;
    }

    .navbar-collapse .navbar-nav .btn,
    .navbar-collapse .navbar-nav form,
    .navbar-collapse .navbar-nav select {
        width: 100%;
    }

    .navbar-collapse .navbar-nav form {
        align-items: stretch !important;
    }

    .container,
    .container-fluid {
        --bs-gutter-x: 0.75rem;
    }

    .card {
        margin-bottom: 0.75rem;
    }

    .card-body {
        padding: 0.85rem;
    }

    .table-responsive {
        margin-left: -0.35rem;
        margin-right: -0.35rem;
        border-radius: 0;
    }

    .table {
        font-size: 0.86rem;
    }

    .table td,
    .table th {
        padding: 0.55rem 0.6rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }
}
