﻿/* ═══════════════════════════════════════════════════════════════
   masters-shared.css
   ───────────────────────────────────────────────────────────────
   GLOBAL (non-scoped) styles used across the entire Masters section.
   Import this in app.css:  @import 'masters-shared.css';

   WHY THIS FILE EXISTS SEPARATELY:
   Masters.razor uses __builder.AddMarkupContent() to render hub
   cards — Blazor does NOT inject its scope attribute into
   AddMarkupContent() output. Therefore .master-card and all mc-*
   classes MUST live here (global) not in Masters.razor.css (scoped).
   Likewise MasterFormShell child content is scoped to MasterFormShell,
   but detail-page classes like .field-input must be global.
═══════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════
   KEYFRAMES  (global — referenced by both scoped and global rules)
═══════════════════════════════════════════════════════════════ */
@keyframes masters-card-pop {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.45;
    }
}

@keyframes overlay-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════
   HUB CARD  — MUST be global (bypasses Blazor scope)
   Matches sfon-pos-v3.html exactly.
═══════════════════════════════════════════════════════════════ */
.master-card {
    background: var(--surface-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px 18px;
    cursor: pointer;
    transition: all 230ms ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(28,20,16,.07), 0 1px 2px rgba(28,20,16,.04);
    animation: masters-card-pop 0.32s ease both;
    display: flex;
    flex-direction: column;
}

    /* Copper top accent on hover */
    .master-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--brand-700);
        opacity: 0;
        transition: opacity 150ms ease;
    }

    .master-card:hover {
        border-color: rgba(192, 74, 26, 0.28);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(28,20,16,.09), 0 2px 4px rgba(28,20,16,.05);
    }

        .master-card:hover::before {
            opacity: 1;
        }

        .master-card:hover .mc-arrow {
            transform: translateX(4px);
        }

/* Icon box */
.mc-ico {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--surface-active);
    border: 1px solid var(--border-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
    line-height: 1;
    flex-shrink: 0;
}

.mc-title {
    font-size: 16px;
    font-weight: 740;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.mc-desc {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0 0 12px;
    flex: 1;
}

.mc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.mc-tag {
    display: inline-block;
    font-size: 12.4px;
    padding: 2px 9px;
    background: var(--surface-hover);
    border: 1px solid var(--border-subtle);
    border-radius: 5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.mc-count {
    display: inline-block;
    font-size: 11px;
    padding: 2px 9px;
    border-radius: 5px;
    background: var(--surface-hover);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-weight: 500;
}

.mc-arrow {
    color: var(--brand-700);
    background: var(--surface-active);
    transition: transform 150ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    
}

    .mc-arrow svg {
        width: 14px;
        height: 14px;
        stroke: var(--brand-700);
    }

/* ═══════════════════════════════════════════════════════════════
   MASTERFORMSHELL LAYOUT
   masters-detail-wrap → md-topbar → md-form → mdf-actions
═══════════════════════════════════════════════════════════════ */
.masters-detail-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: var(--surface-page);
}

/* Top bar: title + Add button */
.md-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px 16px;
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.md-title-block {
}

.md-topbar h2 {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
    line-height: 1.3;
}

.md-topbar p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

.md-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Main form / list area */
.md-form {
    flex: 1;
    padding: 24px;
    overflow-x: hidden;
}

/* Save / Cancel action bar (sticky at bottom of shell) */
.mdf-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: var(--surface-card);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

/* ═══════════════════════════════════════════════════════════════
   TOOLBAR (search bar + filter dropdowns)
═══════════════════════════════════════════════════════════════ */
.mdf-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
}

.mdf-search-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-input);
    border: 1.5px solid var(--border-default);
    border-radius: 10px;
    padding: 0 12px;
    height: 38px;
    flex: 1;
    min-width: 180px;
    max-width: 340px;
    transition: border-color 80ms ease;
    box-sizing: border-box;
    overflow: hidden;
}

    .mdf-search-wrap:focus-within {
        border-color: var(--border-brand);
        box-shadow: 0 0 0 3px var(--border-focus);
    }

.mdf-search {
    flex: 0 0 220px;
    border: none;
    background: transparent;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    min-width: 0;
    max-width: 450px !important;
    padding: 0;
    box-shadow: none;
}

    .mdf-search::placeholder {
        color: #C4B8B0;
    }

.mdf-filter-select {
    height: 38px;
    padding: 6px 16px;
    border: 1.5px solid var(--border-default);
    border-radius: 10px;
    background: var(--surface-card);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 140px;
    appearance: auto;
}

/* ═══════════════════════════════════════════════════════════════
   FORM LAYOUT
═══════════════════════════════════════════════════════════════ */
.mdf-group {
    margin-bottom: 20px;
}

.mdf-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: start;
}

.mdf-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #9A8A7A;
    margin-bottom: 12px;
    display: block;
}

/* ── Field components ──────────────────────────────────────── */
.field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #6B5E52;
    margin-bottom: 6px;
}

.field-input {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border-radius: 9px;
    background: var(--surface-input);
    color: var(--text-primary);
    border: 1.5px solid var(--border-default);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13.5px;
    outline: none;
    transition: border-color 80ms ease, box-shadow 80ms ease;
    box-sizing: border-box;
    line-height: 1.4;
}

    .field-input:focus {
        border-color: #C04A1A;
        box-shadow: 0 0 0 3px rgba(192,74,26,.10);
    }

    .field-input::placeholder {
        color: #C4B8B0;
    }

.field-select {
    appearance: auto;
    cursor: pointer;
    padding-right: 28px;
}

.field-textarea {
    resize: vertical;
    min-height: 68px;
    line-height: 1.55;
}

.field-hint {
    display: block;
    font-size: 11.5px;
    color: #9A8A7A;
    margin-top: 5px;
    line-height: 1.45;
}

.req {
    color: #DC2626;
    margin-left: 2px;
}

.input-error {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,.10) !important;
}

/* ── FieldError text ── */
.field-error {
    display: block;
    font-size: 11.5px;
    color: #DC2626;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS  (btn system)
═══════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 9px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
    background: var(--surface-card);
    color: var(--text-primary);
    border: 1.5px solid var(--border-default);
    line-height: 1.2;
    white-space: nowrap;
}

    .btn:hover:not(:disabled) {
        border-color: rgba(28,20,16,.25);
        background: var(--surface-hover);
    }

    .btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

.btn-primary {
    background: #C04A1A;
    border-color: #C04A1A;
    color: #FFFFFF;
    width: fit-content;
}

    .btn-primary:hover:not(:disabled) {
        background: #A83D14;
        border-color: #A83D14;
    }

.btn-danger {
    background: rgba(220,38,38,.08);
    border-color: rgba(220,38,38,.25);
    color: #DC2626;
}

    .btn-danger:hover:not(:disabled) {
        background: rgba(220,38,38,.14);
        border-color: rgba(220,38,38,.40);
    }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: #6B5E52;
}

    .btn-ghost:hover:not(:disabled) {
        background: #F3EEE8;
        color: #1C1410;
    }

.btn-sm {
    padding: 5px 12px;
    font-size: 12.5px;
    border-radius: 7px;
    gap: 5px;
}

/* ═══════════════════════════════════════════════════════════════
   DATA TABLE
═══════════════════════════════════════════════════════════════ */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    font-family: 'DM Sans', system-ui, sans-serif;
}

    .data-table th {
        padding: 10px 14px;
        text-align: left;
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-bottom: 2px solid rgba(28,20,16,.08);
        background: var(--surface-soft);
        color: var(--text-muted);
        white-space: nowrap;
    }

    .data-table td {
        padding: 13px 14px;
        border-bottom: 1px solid rgba(28,20,16,.07);
        vertical-align: middle;
        color: var(--text-primary);
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

    .data-table tbody tr:hover td {
        background: rgba(192,74,26,.025);
    }

.cell-primary {
    font-weight: 600;
    color: var(--text-primary);
}

.cell-muted {
    color: var(--text-muted);
    font-size: 13px;
}

.cell-sub {
    font-size: 11.5px;
    color: #9A8A7A;
    margin-top: 2px;
}

.action-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   STATUS BADGE  (.status-badge fallback if component missing)
═══════════════════════════════════════════════════════════════ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   FILTER TAB STRIP  (.shift-filter-tabs / .per-tab)
   Used in Shifts, Tables, Devices pages.
═══════════════════════════════════════════════════════════════ */
.shift-filter-tabs {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(28,20,16,.04);
    border: 1px solid rgba(28,20,16,.10);
    border-radius: 10px;
    padding: 3px;
    flex-wrap: wrap;
}

.per-tab {
    padding: 5px 14px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: #6B5E52;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 150ms ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

    .per-tab.active {
        background: #C04A1A;
        color: #FFFFFF;
        font-weight: 700;
        box-shadow: 0 1px 4px rgba(192,74,26,.25);
    }

    .per-tab:not(.active):hover {
        background: rgba(28,20,16,.06);
        color: #1C1410;
    }

/* ═══════════════════════════════════════════════════════════════
   PAGINATION
═══════════════════════════════════════════════════════════════ */
.master-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 16px 0 8px;
    border-top: 1px solid rgba(28,20,16,.07);
    margin-top: 16px;
}

.pag-btn {
    height: 36px;
    padding: 0 16px;
    border: 1.5px solid rgba(28,20,16,.14);
    border-radius: 8px;
    background: #FFFFFF;
    color: #6B5E52;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 80ms ease, color 80ms ease;
}

    .pag-btn:hover:not(:disabled) {
        border-color: #C04A1A;
        color: #C04A1A;
    }

    .pag-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.pag-info {
    font-size: 13px;
    color: #9A8A7A;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   ERROR BANNER  /  INFO CALLOUT
═══════════════════════════════════════════════════════════════ */
.master-error-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: rgba(220,38,38,.08);
    border: 1px solid rgba(220,38,38,.22);
    border-radius: 10px;
    color: #DC2626;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.5;
}

.master-error-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #DC2626;
    cursor: pointer;
    font-size: 15px;
    padding: 0 4px;
    opacity: 0.7;
    transition: opacity 80ms ease;
    flex-shrink: 0;
}

    .master-error-close:hover {
        opacity: 1;
    }

.master-info-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px;
    background: rgba(37,99,235,.07);
    border: 1px solid rgba(37,99,235,.18);
    border-radius: 10px;
    color: #2563EB;
    font-size: 13px;
    line-height: 1.55;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADER
═══════════════════════════════════════════════════════════════ */
.master-skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(28,20,16,.07);
}

.skeleton {
    border-radius: 6px;
    background: rgba(28,20,16,.07);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
    height: 14px;
}

.sk-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.sk-name {
    width: 150px;
}

.sk-tag {
    width: 75px;
    height: 22px;
    border-radius: 99px;
}

.sk-price {
    width: 65px;
}

.sk-actions {
    width: 90px;
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════════
   CONFIRM OVERLAY / MODAL
═══════════════════════════════════════════════════════════════ */
.master-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.10);
    backdrop-filter: blur(2px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlay-in 160ms ease both;
}

.master-confirm-card {
    background: #FFFFFF;
    border: 1px solid rgba(28,20,16,.10);
    border-radius: 18px;
    padding: 32px;
    width: min(420px, 90vw);
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,.14);
}

.confirm-icon {
    font-size: 32px;
    text-align: center;
}

.confirm-title {
    font-size: 18px;
    font-weight: 700;
    color: #1C1410;
    text-align: center;
}

.confirm-body {
    font-size: 14px;
    color: #6B5E52;
    text-align: center;
    line-height: 1.55;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   SPINNER
═══════════════════════════════════════════════════════════════ */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}

.spinner-xs {
    width: 13px;
    height: 13px;
    border-width: 1.5px;
}

.spinner-sm {
    width: 15px;
    height: 15px;
    border-width: 2px;
}

.spinner-dark {
    border-color: rgba(28,20,16,.18);
    border-top-color: #C04A1A;
}

/* ═══════════════════════════════════════════════════════════════
   USER AVATAR
═══════════════════════════════════════════════════════════════ */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(192,74,26,.10);
    color: #C04A1A;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1.5px solid rgba(192,74,26,.22);
}

/* ═══════════════════════════════════════════════════════════════
   SHIFT SUMMARY MODAL
═══════════════════════════════════════════════════════════════ */
.shift-summary-card {
    width: min(480px, 90vw);
    gap: 20px;
}

.shift-summary-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.ss-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13.5px;
}

.ss-label {
    color: #9A8A7A;
}

.ss-value {
    font-weight: 500;
    color: #1C1410;
}

.ss-bold {
    font-weight: 700;
}

.ss-brand {
    color: #C04A1A;
}

.ss-success {
    color: #059669;
}

.ss-error {
    color: #DC2626;
}

.ss-divider {
    height: 1px;
    background: rgba(28,20,16,.08);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════
   MODIFIER GROUP CARD  (inline in MenuItemsDetailPage)
═══════════════════════════════════════════════════════════════ */
.mod-group-card {
    border: 1.5px solid rgba(28,20,16,.10);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    background: #FFFFFF;
}

.mod-group-new {
    border-color: rgba(192,74,26,.22);
    background: rgba(192,74,26,.025);
}

.mod-group-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.mod-group-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #1C1410;
}

.mod-options-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 12px;
}

.mod-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: #FAF8F5;
    border-radius: 8px;
    border: 1px solid rgba(28,20,16,.08);
    flex-wrap: wrap;
}

.mod-opt-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #1C1410;
    min-width: 80px;
}

.mod-opt-price {
    font-size: 12px;
    font-weight: 700;
}

.price-pos {
    color: #059669;
}

.price-neg {
    color: #DC2626;
}

.mod-opt-del {
    padding: 0 8px;
    height: 26px;
}

.mod-add-option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(28,20,16,.07);
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   Role Permissions page (RoleSelector + PermissionGroupCard)
═══════════════════════════════════════════════════════════════ */
/* =============================================
   RBAC Permissions Page Styling
   ============================================= */

.rbac-group {
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.rbac-group-header {
    padding: var(--space-5) var(--space-6);
    background: var(--surface-page);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.rbac-group-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.rbac-group-desc {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-left: auto;
}

.rbac-perm-list {
    padding: var(--space-2);
}

.rbac-perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--ease-med);
}

    .rbac-perm-row:last-child {
        border-bottom: none;
    }

    .rbac-perm-row:hover {
        background: var(--surface-page);
    }

.rbac-perm-info {
    flex: 1;
    min-width: 0;
}

.rbac-perm-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rbac-perm-desc {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 6px;
}

.rbac-perm-key {
    font-size: var(--font-size-2xs);
    background: var(--surface-page);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.rbac-perm-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-shrink: 0;
}

.rbac-perm-badge {
    font-size: var(--font-size-xs);
    font-weight: 500;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

    .rbac-perm-badge.granted {
        background: var(--success-bg);
        color: var(--color-success);
        border: 1px solid var(--success-border);
    }

    .rbac-perm-badge.denied {
        background: var(--danger-bg);
        color: var(--color-error);
        border: 1px solid var(--danger-border);
    }

/* Role Selector Tabs */
.per-tab {
    padding: 10px 18px;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: var(--font-size-sm);
    transition: all var(--ease-med);
    border: 1px solid transparent;
    background: var(--surface-card);
    color: var(--text-secondary);
}

    .per-tab:hover {
        background: var(--surface-page);
        color: var(--text-primary);
    }

    .per-tab.active {
        background: var(--brand-700);
        color: white;
        border-color: var(--brand-700);
        box-shadow: var(--shadow-sm);
    }

/* Shift filter tabs container */
.shift-filter-tabs {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* Master Info Callout */
.master-info-callout {
    display: flex;
    gap: var(--space-4);
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

/* Data Table Improvements */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

    .data-table th {
        background: var(--surface-page);
        text-align: left;
        padding: var(--space-4) var(--space-5);
        font-size: var(--font-size-xs);
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 1px solid var(--border-default);
    }

    .data-table td {
        padding: var(--space-4) var(--space-5);
        border-bottom: 1px solid var(--border-subtle);
        vertical-align: middle;
    }

    .data-table tr:last-child td {
        border-bottom: none;
    }

    .data-table tr:hover {
        background: var(--surface-page);
    }

/* Empty State Enhancement */
EmptyState {
    padding: var(--space-12) var(--space-6);
}

/* Loading Skeletons */
.master-skeleton-list .skeleton-row {
    display: flex;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-6);
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
}

.skeleton {
    height: 20px;
    background: linear-gradient(90deg, #f0e6d9 25%, #e8d9c4 50%, #f0e6d9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

    .skeleton.sk-name {
        flex: 2;
    }

    .skeleton.sk-tag {
        flex: 1;
    }

    .skeleton.sk-actions {
        width: 80px;
    }

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}



/* Responsive Adjustments */
@media (max-width: 768px) {
    .rbac-perm-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .rbac-perm-toggle {
        align-self: flex-end;
    }

    .shift-filter-tabs {
        flex-wrap: wrap;
    }
}



/* ====================== DISCOUNT MASTER PAGE ====================== */

.master-page {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Stats Row */
.disc-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.disc-stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.disc-stat-card--green {
    border-left: 5px solid var(--color-success);
}

.disc-stat-card--blue {
    border-left: 5px solid var(--color-info);
}

.disc-stat-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--brand-100);
    border-radius: var(--radius-md);
}

.disc-stat-val {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.disc-stat-lbl {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Toolbar */
.mdf-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.mdf-search {
    flex: 1;
    min-width: 280px;
    padding: 12px 16px;
  
    border-radius: var(--radius-lg);
    font-size: 15px;
    background: var(--surface-input);
}



/* Orange Full-Width Refresh Button */
.refresh-full {
    background: var(--brand-700) !important;
    color: white !important;
    font-weight: 600;
    padding: 7px;
    border-radius: var(--radius-lg);
    border: none;
    width: 100%;
    font-size: 14px;
    cursor: pointer;
    margin: 8px 0;
    transition: all 0.2s;
}

    .refresh-full:hover {
        background: #9E3A13 !important;
    }

/* Form Styling */
.disc-form {
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.mdf-section {
    margin-bottom: 32px;
}

.mdf-section-header {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.mdf-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.mdf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.field-input, .field-select {
    padding: 3px 16px;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-lg);
    font-size: 15px;
    background: var(--surface-input);
    transition: all 0.2s;
}

    .field-input:focus, .field-select:focus {
        outline: none;
        border-color: var(--brand-700);
        box-shadow: 0 0 0 3px var(--border-focus);
    }

/* Radio Group for Applies To */
.disc-radio-group {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

    .radio-option input[type="radio"] {
        accent-color: var(--brand-700);
    }

/* Toggle Rows */
.toggle-list, .toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

    .toggle-row strong {
        display: block;
    }

.hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Preview Box */
.discount-preview {
    margin-top: 32px;
    padding: 20px;
    background: var(--brand-50);
    border: 2px dashed var(--brand-400);
    border-radius: var(--radius-xl);
    text-align: center;
}

.preview-content {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.preview-icon {
    font-size: 28px;
}

.preview-value {
    font-weight: 700;
    color: var(--brand-700);
    font-size: 18px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ApplicableItemsSelector Styles */
.applicable-selector {
    margin-top: 24px;
}

.dual-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 16px;
}

.selector-pane {
    background: var(--surface-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 420px;
}

.selected-pane {
    background: rgba(192, 74, 26, 0.03);
    border-color: var(--brand-400);
}

.pane-header {
    padding: 14px 18px;
    background: var(--surface-input);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.search-input {
    margin: 12px 12px 8px;
    padding: 10px 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 14px;
    width: calc(100% - 24px);
}

.items-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
}

.item-row {
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    transition: all 0.15s;
}

    .item-row:hover {
        background: var(--brand-50);
        color: var(--brand-700);
    }

.chips-container {
    padding: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
}

.chip {
    background: var(--brand-100);
    color: var(--brand-800);
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.chip-remove {
    background: none;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: var(--brand-700);
    padding: 0 4px;
}

.empty-selected {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 14px;
}
/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .md-form {
        padding: 16px;
    }

    .md-topbar {
        padding: 14px 16px 12px;
    }

    .mdf-actions {
        padding: 12px 16px;
    }

    .mdf-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .mdf-search-wrap {
        max-width: 100%;
    }

    .mdf-filter-select {
        width: 100%;
    }

    .shift-filter-tabs {
        flex-wrap: wrap;
    }

    .master-pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .master-confirm-card {
        padding: 20px;
    }

    .confirm-actions {
        flex-direction: column;
    }

        .confirm-actions .btn {
            width: 100%;
            justify-content: center;
        }

    .mdf-row {
        grid-template-columns: 1fr;
    }
}
