/* PayRetail: темна тема із зеленими акцентами.
   Підключається тільки в layout-ах шаблону PayRetail, поверх bootstrap.css і site.css */

:root {
    --pr-bg: #0d1013;
    --pr-surface: #151a1f;
    --pr-surface-2: #1b2127;
    --pr-surface-3: #232a31;
    --pr-border: #262e36;
    --pr-text: #e6ebef;
    --pr-muted: #8b96a1;
    --pr-green: #22c55e;
    --pr-green-hover: #2fd66c;
    --pr-green-soft: rgba(34, 197, 94, 0.14);
    --pr-green-2: #10b981;
    --pr-gradient: linear-gradient(135deg, #22c55e 0%, #10b981 55%, #0ea5a4 100%);
    --pr-danger: #f87171;
    --pr-danger-soft: rgba(248, 113, 113, 0.14);
    --pr-warning: #fbbf24;
    --pr-info: #38bdf8;
    --pr-radius: 16px;
    --pr-radius-sm: 10px;
    --pr-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

html {
    color-scheme: dark;
}

body {
    background-color: var(--pr-bg);
    background-image: radial-gradient(1200px 500px at 10% -10%, rgba(34, 197, 94, 0.08), transparent 60%);
    background-attachment: fixed;
    color: var(--pr-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--pr-green);
}

a:hover {
    color: var(--pr-green-hover);
}

h1, h2, h3, h4, h5, h6 {
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.01em;
}

hr {
    border-top-color: var(--pr-border);
}

.text-muted {
    color: var(--pr-muted) !important;
}

.text-success {
    color: var(--pr-green) !important;
}

.text-danger {
    color: var(--pr-danger) !important;
}

.bg-light,
.bg-white {
    background-color: var(--pr-surface-2) !important;
}

/* ---------- Навбар ---------- */

#navbar-top .pr-navbar {
    /* backdrop-filter створює окремий шар, тому без z-index випадаюче меню ховається під вмістом сторінки */
    position: relative;
    z-index: 1030;
    background: rgba(13, 16, 19, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--pr-border);
    padding-top: 12px;
    padding-bottom: 12px;
}

.pr-navbar .nav-link {
    color: var(--pr-muted) !important;
    font-weight: 500;
    border-radius: 999px;
    padding: 6px 14px !important;
    transition: background-color .15s, color .15s;
}

.pr-navbar .nav-link:hover,
.pr-navbar .nav-link:focus,
.pr-navbar .show > .nav-link {
    color: #fff !important;
    background: var(--pr-surface-3);
}

.pr-navbar a.text-white {
    color: var(--pr-text) !important;
}

.pr-navbar a.text-white:hover {
    color: var(--pr-green) !important;
    text-decoration: none;
}

.pr-cashier-ops {
    color: var(--pr-muted);
    background: var(--pr-surface-2);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius-sm);
    white-space: nowrap;
}

.pr-cashier-ops:hover,
.pr-cashier-ops:focus {
    color: var(--pr-text);
    background: var(--pr-surface-3);
}

.pr-cashier-ops.active {
    color: var(--pr-green);
    background: var(--pr-green-soft);
    border-color: transparent;
}

/* ---------- Логотип ---------- */

.pr-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
}

.pr-logo-mark {
    display: block;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.pr-logo-text {
    color: #fff;
    font-size: 21px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1;
}

.pr-logo-text b {
    font-weight: 800;
    color: var(--pr-green);
}

/* ---------- Dropdown ---------- */

.dropdown-menu {
    background: var(--pr-surface-2);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius-sm);
    box-shadow: var(--pr-shadow);
    padding: 6px;
}

.dropdown-item {
    color: var(--pr-text);
    border-radius: 8px;
    padding: 7px 12px;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--pr-surface-3);
    color: #fff;
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--pr-green-soft);
    color: var(--pr-green);
}

.dropdown-divider {
    border-top-color: var(--pr-border);
}

/* ---------- Картки ---------- */

.card {
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    box-shadow: var(--pr-shadow);
    overflow: hidden;
}

.card.table-responsive {
    overflow-x: auto;
}

.card-header,
.card-footer {
    background: var(--pr-surface-2);
    border-color: var(--pr-border);
}

/* ---------- Таблиці ---------- */

.table {
    color: var(--pr-text);
}

.table thead th {
    border-top: none;
    border-bottom: 1px solid var(--pr-border);
    color: var(--pr-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.table td,
.table th {
    border-top-color: var(--pr-border);
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-hover tbody tr:hover {
    background-color: var(--pr-surface-3);
    color: var(--pr-text);
}

.table-bordered,
.table-bordered td,
.table-bordered th {
    border-color: var(--pr-border);
}

.table-success, .table-success > td, .table-success > th {
    background-color: var(--pr-green-soft);
}

.table-danger, .table-danger > td, .table-danger > th {
    background-color: var(--pr-danger-soft);
}

.table-warning, .table-warning > td, .table-warning > th {
    background-color: rgba(251, 191, 36, 0.12);
}

.table-active, .table-active > td, .table-active > th,
.table-secondary, .table-secondary > td, .table-secondary > th {
    background-color: var(--pr-surface-3);
}

/* ---------- Кнопки ---------- */

.btn {
    border-radius: 999px;
    font-weight: 600;
    padding-left: 18px;
    padding-right: 18px;
}

.btn-sm {
    padding-left: 12px;
    padding-right: 12px;
}

.btn-success,
.btn-primary {
    background: var(--pr-green);
    border-color: var(--pr-green);
    color: #04210f;
}

.btn-success:hover,
.btn-primary:hover,
.btn-success:focus,
.btn-primary:focus {
    background: var(--pr-green-hover);
    border-color: var(--pr-green-hover);
    color: #04210f;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.btn-dark,
.btn-secondary,
.btn-light {
    background: var(--pr-surface-3);
    border-color: var(--pr-border);
    color: var(--pr-text);
}

.btn-dark:hover,
.btn-secondary:hover,
.btn-light:hover {
    background: #2c353e;
    border-color: #36414b;
    color: #fff;
}

.btn-danger {
    background: var(--pr-danger-soft);
    border-color: transparent;
    color: var(--pr-danger);
}

.btn-danger:hover,
.btn-danger:focus {
    background: rgba(248, 113, 113, 0.24);
    border-color: transparent;
    color: #fca5a5;
}

.btn-outline-success,
.btn-outline-primary {
    color: var(--pr-green);
    border-color: var(--pr-green);
}

.btn-outline-success:hover,
.btn-outline-primary:hover {
    background: var(--pr-green);
    border-color: var(--pr-green);
    color: #04210f;
}

.btn-outline-secondary,
.btn-outline-dark {
    color: var(--pr-text);
    border-color: var(--pr-border);
}

.btn-outline-secondary:hover,
.btn-outline-dark:hover {
    background: var(--pr-surface-3);
    color: #fff;
}

.btn-link {
    color: var(--pr-green);
}

/* ---------- Форми ---------- */

.form-control,
.custom-select {
    background-color: var(--pr-surface-2);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius-sm);
    color: var(--pr-text);
}

.form-control:focus,
.custom-select:focus {
    background-color: var(--pr-surface-2);
    border-color: var(--pr-green);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.form-control::placeholder {
    color: #5f6a75;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--pr-surface);
    color: var(--pr-muted);
}

.input-group-text {
    background: var(--pr-surface-3);
    border-color: var(--pr-border);
    color: var(--pr-muted);
}

.form-check-input,
.custom-control-input {
    accent-color: var(--pr-green);
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--pr-green);
    border-color: var(--pr-green);
}

/* ---------- Бокове меню (Cabinet / Cashier) ---------- */

.list-group {
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    padding: 6px;
}

.list-group-item {
    background: transparent;
    border: none;
    border-radius: var(--pr-radius-sm) !important;
    margin-bottom: 2px;
    color: var(--pr-text);
    font-weight: 500;
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background: var(--pr-surface-3);
    color: #fff;
}

.list-group-item.active {
    background: var(--pr-green-soft);
    color: var(--pr-green);
    box-shadow: inset 3px 0 0 var(--pr-green);
}

.list-group-item-secondary {
    background: transparent;
    color: var(--pr-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ---------- Алерти, бейджі ---------- */

.alert {
    border: 1px solid transparent;
    border-radius: var(--pr-radius-sm);
}

.alert-success {
    background: var(--pr-green-soft);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.alert-danger {
    background: var(--pr-danger-soft);
    border-color: rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fcd34d;
}

.alert-info,
.alert-primary,
.alert-secondary {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.25);
    color: #7dd3fc;
}

.close {
    color: #fff;
    text-shadow: none;
}

.badge {
    border-radius: 999px;
    font-weight: 600;
}

.badge-success,
.badge-primary {
    background: var(--pr-green-soft);
    color: var(--pr-green);
}

.badge-dark,
.badge-secondary {
    background: var(--pr-surface-3);
    color: var(--pr-text);
}

.badge-danger {
    background: var(--pr-danger-soft);
    color: var(--pr-danger);
}

/* ---------- Модалки, пагінація, вкладки ---------- */

.modal-content {
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    color: var(--pr-text);
}

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

.page-link {
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    color: var(--pr-text);
}

.page-link:hover {
    background: var(--pr-surface-3);
    border-color: var(--pr-border);
    color: #fff;
}

.page-item.active .page-link {
    background: var(--pr-green);
    border-color: var(--pr-green);
    color: #04210f;
}

.page-item.disabled .page-link {
    background: var(--pr-surface);
    border-color: var(--pr-border);
    color: #4b5560;
}

.nav-tabs {
    border-bottom-color: var(--pr-border);
}

.nav-tabs .nav-link {
    color: var(--pr-muted);
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #fff;
}

.nav-tabs .nav-link.active {
    background: transparent;
    border-color: transparent transparent var(--pr-green);
    border-bottom-width: 2px;
    color: #fff;
}

/* ---------- Дерево структури (site.css) ---------- */

.tree li a,
.tree li button,
.tree li button:active,
.tree li button:focus {
    color: var(--pr-green);
}

.tree ul li:last-child:before {
    background: var(--pr-surface);
}

/* ---------- Каса (Market) ---------- */

.pr-terminal-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 32px;
    padding: 14px 20px;
    background: var(--pr-surface);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
}

.pr-terminal-info-item {
    display: flex;
    flex-direction: column;
}

.pr-terminal-info-label {
    color: var(--pr-muted);
    font-size: 12px;
}

.pr-terminal-info-item b {
    color: #fff;
    font-size: 16px;
}

.pr-terminal-info-accent b {
    color: var(--pr-green);
}

/* Сітка: плитки як на терміналах самообслуговування */
.pr-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.pr-product-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px 14px;
    background: var(--pr-surface-2);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius);
    color: var(--pr-text);
    cursor: pointer;
    transition: border-color .15s, background-color .15s, transform .15s;
}

.pr-product-tile:hover,
.pr-product-tile:focus {
    background: var(--pr-surface-3);
    border-color: var(--pr-green);
    outline: none;
    transform: translateY(-2px);
}

.pr-product-tile-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    font-size: 26px;
}

.pr-product-tile-name {
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

/* Список: маленький значок і назва */
.pr-product-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pr-product-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 12px;
    background: var(--pr-surface-2);
    border: 1px solid var(--pr-border);
    border-radius: var(--pr-radius-sm);
    color: var(--pr-text);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}

.pr-product-row:hover,
.pr-product-row:focus {
    background: var(--pr-surface-3);
    border-color: var(--pr-green);
    outline: none;
}

.pr-product-row-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 13px;
}

.pr-product-row-name {
    flex: 1;
    font-weight: 500;
}

.pr-product-row-arrow {
    color: var(--pr-muted);
    font-size: 12px;
}

/* Значок продукту: логотип або літери назви */
.pr-product-icon-logo,
.pr-product-icon-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.pr-product-icon-logo {
    background: #fff;
    padding: 6px;
}

.pr-product-icon-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.pr-product-icon-initials {
    color: #fff;
    font-weight: 700;
    letter-spacing: .02em;
}

.pr-selected-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ---------- Скролбар ---------- */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--pr-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--pr-surface-3);
    border-radius: 999px;
}
