/* ==========================================================================
   Price Board — application shell
   Everything here is local; no external fonts, CDNs or trackers.
   ========================================================================== */

:root {
    --pb-primary: #0b5ed7;
    --pb-primary-dark: #084298;
    --pb-accent: #00a67d;
    --pb-ink: #16202c;
    --pb-muted: #6b7a8d;
    --pb-line: #e4e9f0;
    --pb-bg: #f4f6fa;
    --pb-radius: 14px;
    --pb-shadow: 0 1px 2px rgba(16, 32, 54, .04), 0 8px 24px rgba(16, 32, 54, .07);
    --pb-shadow-lg: 0 2px 4px rgba(16, 32, 54, .05), 0 18px 42px rgba(16, 32, 54, .13);
}

body {
    background: var(--pb-bg);
    color: var(--pb-ink);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ---------- top bar ---------- */
.pb-nav {
    background: #fff;
    border-bottom: 1px solid var(--pb-line);
    box-shadow: 0 1px 3px rgba(16, 32, 54, .05);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.pb-brand {
    font-weight: 800;
    letter-spacing: -.4px;
    color: var(--pb-ink);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .6rem;
}

.pb-brand .mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pb-primary), var(--pb-accent));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .95rem;
}

.pb-nav .nav-link {
    color: var(--pb-muted);
    font-weight: 600;
    border-radius: 9px;
    padding: .45rem .8rem;
    transition: background .15s ease, color .15s ease;
}

.pb-nav .nav-link:hover { background: #eef2f8; color: var(--pb-ink); }
.pb-nav .nav-link.active { background: #e7f0ff; color: var(--pb-primary-dark); }

.pb-user-chip {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .3rem .7rem .3rem .35rem;
    border: 1px solid var(--pb-line);
    border-radius: 999px;
    background: #fff;
}

.pb-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pb-primary), var(--pb-accent));
    color: #fff;
    display: grid; place-items: center;
    font-size: .78rem; font-weight: 700;
}

/* ---------- generic surfaces ---------- */
.pb-card {
    background: #fff;
    border: 1px solid var(--pb-line);
    border-radius: var(--pb-radius);
    box-shadow: var(--pb-shadow);
}

.pb-page-title { font-weight: 800; letter-spacing: -.5px; }
.pb-subtitle { color: var(--pb-muted); }

/* ---------- animated entrance (no library needed) ---------- */
@keyframes pbRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.pb-rise { animation: pbRise .45s cubic-bezier(.22, .61, .36, 1) both; }

.pb-stagger > * { animation: pbRise .45s cubic-bezier(.22, .61, .36, 1) both; }
.pb-stagger > *:nth-child(1) { animation-delay: .03s }
.pb-stagger > *:nth-child(2) { animation-delay: .07s }
.pb-stagger > *:nth-child(3) { animation-delay: .11s }
.pb-stagger > *:nth-child(4) { animation-delay: .15s }
.pb-stagger > *:nth-child(5) { animation-delay: .19s }
.pb-stagger > *:nth-child(6) { animation-delay: .23s }
.pb-stagger > *:nth-child(7) { animation-delay: .27s }
.pb-stagger > *:nth-child(8) { animation-delay: .31s }
.pb-stagger > *:nth-child(9) { animation-delay: .35s }
.pb-stagger > *:nth-child(10){ animation-delay: .39s }
.pb-stagger > *:nth-child(n+11) { animation-delay: .42s }

@media (prefers-reduced-motion: reduce) {
    .pb-rise, .pb-stagger > * { animation: none !important; }
    * { transition: none !important; }
}

/* ---------- selectable / clickable tiles ---------- */
.pb-tile {
    display: block;
    background: #fff;
    border: 1px solid var(--pb-line);
    border-radius: var(--pb-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--pb-shadow);
    transition: transform .18s cubic-bezier(.22,.61,.36,1), box-shadow .18s ease, border-color .18s ease;
}

.pb-tile:hover {
    transform: translateY(-4px);
    box-shadow: var(--pb-shadow-lg);
    border-color: #c9d8f5;
    color: inherit;
}

.pb-tile:active { transform: translateY(-1px); }

.pb-tile-media {
    aspect-ratio: 16 / 10;
    background: #f0f3f8;
    overflow: hidden;
}

.pb-tile-media img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s cubic-bezier(.22,.61,.36,1);
}

.pb-tile:hover .pb-tile-media img { transform: scale(1.05); }
.pb-tile-body { padding: .9rem 1rem; }

/* ---------- notes / announcements ---------- */
.pb-note {
    border: 1px solid var(--pb-line);
    border-left-width: 5px;
    border-radius: 12px;
    background: #fff;
    padding: 1rem 1.15rem;
    box-shadow: var(--pb-shadow);
}

.pb-note.info    { border-left-color: var(--pb-primary); }
.pb-note.success { border-left-color: var(--pb-accent); }
.pb-note.warning { border-left-color: #e8a33d; }
.pb-note.danger  { border-left-color: #dc3545; }
.pb-note .pb-note-title { font-weight: 700; margin-bottom: .25rem; }
.pb-note .pb-note-body  { color: #44546a; white-space: pre-line; margin: 0; }

.pb-note.pinned::after {
    content: "\f08d";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    float: right;
    color: #c3ccd9;
    margin-top: -1.4rem;
}

/* ---------- search ---------- */
.pb-search {
    position: relative;
}

.pb-search input {
    height: 52px;
    border-radius: 999px;
    padding-left: 3rem;
    border: 1px solid var(--pb-line);
    box-shadow: var(--pb-shadow);
    font-size: 1.02rem;
}

.pb-search input:focus {
    border-color: var(--pb-primary);
    box-shadow: 0 0 0 4px rgba(11, 94, 215, .12);
}

.pb-search .fa-search {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pb-muted);
}

/* ---------- badges & chips ---------- */
.pb-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    font-weight: 600;
    padding: .22rem .6rem;
    border-radius: 999px;
    background: #eef2f8;
    color: #4a5b70;
}

.pb-chip.ok    { background: #e6f7f1; color: #0a7355; }
.pb-chip.warn  { background: #fdf3e3; color: #96631a; }
.pb-chip.dang  { background: #fdecec; color: #9d2727; }

/* ---------- dirham symbol ---------- */
.dirham {
    display: inline-block;
    vertical-align: -.09em;
    line-height: 1;
}

.dirham svg { width: 100%; height: 100%; display: block; }
.currency-fallback { font-weight: 600; }

/* ---------- tables ---------- */
.pb-table thead th {
    background: #f7f9fc;
    color: var(--pb-muted);
    font-size: .76rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid var(--pb-line);
    white-space: nowrap;
}

.pb-table tbody tr { transition: background .12s ease; }
.pb-table tbody tr:hover { background: #f8fbff; }

/* ---------- empty state ---------- */
.pb-empty {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--pb-muted);
}

.pb-empty i { font-size: 2.6rem; opacity: .35; margin-bottom: .8rem; display: block; }

/* ---------- footer ---------- */
.pb-footer {
    color: var(--pb-muted);
    font-size: .85rem;
    padding: 2rem 0 1.2rem;
}
