/* Rift Retail UI foundation
 * Visual-only overrides shared by the back office. POS-specific styling remains
 * isolated in its existing view partials.
 */
:root {
    --rift-navy-950: #071522;
    --rift-navy-900: #0b2135;
    --rift-navy-800: #123653;
    --rift-blue-600: #176b9c;
    --rift-emerald-600: #059669;
    --rift-emerald-500: #10b981;
    --rift-amber-500: #f59e0b;
    --rift-red-500: #ef4444;
    --rift-canvas: #f3f7fa;
    --rift-surface: #ffffff;
    --rift-border: #dce6ed;
    --rift-text: #102a3d;
    --rift-muted: #647b8c;
    --rift-radius-sm: 9px;
    --rift-radius: 14px;
    --rift-radius-lg: 20px;
    --rift-shadow-sm: 0 2px 8px rgba(11, 33, 53, 0.06);
    --rift-shadow: 0 10px 30px rgba(11, 33, 53, 0.08);
}

body.rift-retail-ui:not(.lockscreen) {
    background: var(--rift-canvas) !important;
    color: var(--rift-text);
    letter-spacing: -0.005em;
}

body.rift-retail-ui:not(.lockscreen) main,
body.rift-retail-ui:not(.lockscreen) #scrollable-container {
    background:
        radial-gradient(circle at 92% 4%, rgba(16, 185, 129, 0.055), transparent 24rem),
        var(--rift-canvas) !important;
}

/* Application chrome */
body.rift-retail-ui:not(.lockscreen) .theme-header-bg {
    background-color: var(--rift-navy-900) !important;
    background-image:
        linear-gradient(115deg, rgba(7, 21, 34, 0.98), rgba(18, 54, 83, 0.96) 64%, rgba(5, 150, 105, 0.88)) !important;
}

body.rift-retail-ui:not(.lockscreen) main > .theme-header-bg,
body.rift-retail-ui:not(.lockscreen) main > div > .theme-header-bg {
    box-shadow: 0 6px 24px rgba(7, 21, 34, 0.18);
}

body.rift-retail-ui:not(.lockscreen) .theme-btn-bg {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.13) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.rift-retail-ui:not(.lockscreen) .theme-btn-bg:hover,
body.rift-retail-ui:not(.lockscreen) .theme-btn-bg:focus {
    background-color: rgba(255, 255, 255, 0.16) !important;
}

body.rift-retail-ui:not(.lockscreen) .side-bar {
    border-right: 1px solid var(--rift-border);
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfdfe 72%, #f4faf7 100%) !important;
    box-shadow: 8px 0 28px rgba(11, 33, 53, 0.045);
}

body.rift-retail-ui:not(.lockscreen) .side-bar > a:first-child {
    height: 68px !important;
    border: 0 !important;
    background:
        radial-gradient(circle at 82% 18%, rgba(16, 185, 129, 0.34), transparent 42%),
        linear-gradient(135deg, var(--rift-navy-950), var(--rift-navy-800)) !important;
}

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

.rift-brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.95), rgba(23, 107, 156, 0.9));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 7px 16px rgba(5, 150, 105, 0.22);
}

.rift-brand-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: left;
}

.rift-brand-name {
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rift-brand-edition {
    color: rgba(209, 250, 229, 0.78);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1.4;
    text-transform: uppercase;
}

.rift-online-dot {
    width: 8px;
    height: 8px;
    margin-left: 2px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 999px;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15);
}

body.rift-retail-ui:not(.lockscreen) #side-bar {
    padding: 8px 9px 18px;
}

body.rift-retail-ui:not(.lockscreen) #side-bar > li {
    margin: 2px 0;
}

body.rift-retail-ui:not(.lockscreen) #side-bar a {
    min-height: 40px;
    border-radius: 10px;
    transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

body.rift-retail-ui:not(.lockscreen) #side-bar a:hover {
    transform: translateX(2px);
}

body.rift-retail-ui:not(.lockscreen) #side-bar .theme-sidebar-active {
    background: linear-gradient(90deg, rgba(5, 150, 105, 0.14), rgba(23, 107, 156, 0.08)) !important;
    color: #087b5c !important;
    box-shadow: inset 3px 0 0 var(--rift-emerald-500);
}

body.rift-retail-ui:not(.lockscreen) #sidebar-search {
    color: var(--rift-text) !important;
}

/* Shared surfaces */
body.rift-retail-ui:not(.lockscreen) .content {
    padding: 18px 20px 26px;
}

body.rift-retail-ui:not(.lockscreen) .content-header {
    padding: 18px 20px 8px;
}

body.rift-retail-ui:not(.lockscreen) .content-header h1,
body.rift-retail-ui:not(.lockscreen) .content > h1 {
    color: var(--rift-navy-900);
    font-weight: 750;
    letter-spacing: -0.025em;
}

body.rift-retail-ui:not(.lockscreen) .box,
body.rift-retail-ui:not(.lockscreen) .nav-tabs-custom,
body.rift-retail-ui:not(.lockscreen) .modal-content {
    border: 1px solid var(--rift-border);
    border-radius: var(--rift-radius);
    box-shadow: var(--rift-shadow-sm);
}

body.rift-retail-ui:not(.lockscreen) .box {
    border-top: 1px solid var(--rift-border);
}

body.rift-retail-ui:not(.lockscreen) .box-header,
body.rift-retail-ui:not(.lockscreen) .modal-header {
    border-bottom-color: #e8eff3;
}

body.rift-retail-ui:not(.lockscreen) .box-title,
body.rift-retail-ui:not(.lockscreen) .modal-title {
    color: var(--rift-navy-900);
    font-weight: 700;
}

body.rift-retail-ui:not(.lockscreen) .modal-content {
    overflow: hidden;
    box-shadow: 0 24px 65px rgba(7, 21, 34, 0.2);
}

body.rift-retail-ui:not(.lockscreen) .modal-header {
    padding: 16px 20px;
    background: linear-gradient(180deg, #fff, #f8fbfc);
}

body.rift-retail-ui:not(.lockscreen) .form-control,
body.rift-retail-ui:not(.lockscreen) .select2-container .select2-selection--single,
body.rift-retail-ui:not(.lockscreen) .select2-container .select2-selection--multiple {
    min-height: 38px;
    border-color: #cfdce5;
    border-radius: var(--rift-radius-sm);
    box-shadow: none;
}

body.rift-retail-ui:not(.lockscreen) .form-control:focus,
body.rift-retail-ui:not(.lockscreen) .select2-container--focus .select2-selection {
    border-color: var(--rift-blue-600);
    box-shadow: 0 0 0 3px rgba(23, 107, 156, 0.12);
}

body.rift-retail-ui:not(.lockscreen) .btn {
    border-radius: var(--rift-radius-sm);
    font-weight: 650;
    transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

body.rift-retail-ui:not(.lockscreen) .btn:hover {
    box-shadow: 0 5px 12px rgba(11, 33, 53, 0.1);
}

body.rift-retail-ui:not(.lockscreen) .btn:active {
    transform: translateY(1px);
}

body.rift-retail-ui:not(.lockscreen) .btn-primary,
body.rift-retail-ui:not(.lockscreen) .bg-blue,
body.rift-retail-ui:not(.lockscreen) .bg-light-blue {
    border-color: var(--rift-blue-600) !important;
    background-color: var(--rift-blue-600) !important;
}

body.rift-retail-ui:not(.lockscreen) .btn-success {
    border-color: var(--rift-emerald-600);
    background-color: var(--rift-emerald-600);
}

/* Tables and statuses */
body.rift-retail-ui:not(.lockscreen) .table-responsive,
body.rift-retail-ui:not(.lockscreen) .dataTables_wrapper {
    border-radius: 12px;
}

body.rift-retail-ui:not(.lockscreen) table.table {
    color: #294457;
}

body.rift-retail-ui:not(.lockscreen) table.table > thead > tr > th {
    border-bottom: 1px solid #dbe6ed;
    background: #f5f9fb;
    color: #526b7c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

body.rift-retail-ui:not(.lockscreen) table.table > tbody > tr > td {
    border-top-color: #e7eef2;
    vertical-align: middle;
}

body.rift-retail-ui:not(.lockscreen) table.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #fbfdfe;
}

body.rift-retail-ui:not(.lockscreen) table.table-hover > tbody > tr:hover,
body.rift-retail-ui:not(.lockscreen) table.table > tbody > tr:hover {
    background-color: #f0f8f6;
}

body.rift-retail-ui:not(.lockscreen) .label {
    padding: 0.34em 0.65em;
    border-radius: 999px;
    font-weight: 700;
}

body.rift-retail-ui:not(.lockscreen) .label-success {
    background: #d1fae5 !important;
    color: #047857 !important;
}

body.rift-retail-ui:not(.lockscreen) .label-warning {
    background: #fef3c7 !important;
    color: #a16207 !important;
}

body.rift-retail-ui:not(.lockscreen) .label-danger {
    background: #fee2e2 !important;
    color: #b91c1c !important;
}

/* Dashboard */
.rift-dashboard {
    position: relative;
    padding-bottom: 24px !important;
}

.rift-dashboard.theme-header-bg {
    position: relative;
    overflow: hidden;
    border-radius: 0 0 28px 28px;
}

.rift-dashboard.theme-header-bg::after {
    position: absolute;
    top: -90px;
    right: -70px;
    width: 360px;
    height: 360px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    content: '';
    box-shadow:
        0 0 0 54px rgba(255, 255, 255, 0.025),
        0 0 0 108px rgba(255, 255, 255, 0.018);
    pointer-events: none;
}

.rift-dashboard .rift-dashboard-kicker {
    margin-bottom: 5px;
    color: #a7f3d0;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.rift-dashboard [class*="tw-rounded-xl"][class*="tw-bg-white"] {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(220, 230, 237, 0.92);
    border-radius: 16px !important;
    box-shadow: var(--rift-shadow-sm) !important;
}

.rift-dashboard [class*="tw-rounded-xl"][class*="tw-bg-white"]:hover {
    border-color: #bed4df;
    box-shadow: var(--rift-shadow) !important;
}

.rift-dashboard [class*="tw-grid-cols-4"] > div:nth-child(4n + 1) {
    border-top: 3px solid #38bdf8;
}

.rift-dashboard [class*="tw-grid-cols-4"] > div:nth-child(4n + 2) {
    border-top: 3px solid var(--rift-emerald-500);
}

.rift-dashboard [class*="tw-grid-cols-4"] > div:nth-child(4n + 3) {
    border-top: 3px solid var(--rift-amber-500);
}

.rift-dashboard [class*="tw-grid-cols-4"] > div:nth-child(4n + 4) {
    border-top: 3px solid #818cf8;
}

.rift-dashboard .nav-tabs-custom,
.rift-dashboard .box {
    border-radius: 16px;
    box-shadow: var(--rift-shadow-sm);
}

.rift-dashboard .nav-tabs-custom > .nav-tabs > li.active {
    border-top-color: var(--rift-emerald-500);
}

@media (max-width: 767px) {
    body.rift-retail-ui:not(.lockscreen) .content {
        padding: 12px 12px 22px;
    }

    body.rift-retail-ui:not(.lockscreen) .content-header {
        padding: 14px 12px 6px;
    }

    .rift-dashboard.theme-header-bg {
        border-radius: 0 0 20px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.rift-retail-ui * {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
