/* Qvent Queue — administrative / agent interface */
:root {
    --q-primary: #0f5c6e;
    --q-primary-dark: #0a4352;
    --q-accent: #f2a541;
    --q-bg: #f3f6f8;
    --q-card-radius: 14px;
    --bs-primary: #0f5c6e;
    --bs-primary-rgb: 15, 92, 110;
    --bs-link-color: #0f5c6e;
    --bs-link-color-rgb: 15, 92, 110;
    --bs-link-hover-color: #0a4352;
    --bs-font-sans-serif: 'Cairo', 'Segoe UI', Tahoma, 'Noto Sans Arabic', Arial, sans-serif;
}

body { font-family: var(--bs-font-sans-serif); }
.app-body { background: var(--q-bg); min-height: 100vh; }

.btn-primary {
    --bs-btn-bg: var(--q-primary); --bs-btn-border-color: var(--q-primary);
    --bs-btn-hover-bg: var(--q-primary-dark); --bs-btn-hover-border-color: var(--q-primary-dark);
    --bs-btn-active-bg: var(--q-primary-dark); --bs-btn-active-border-color: var(--q-primary-dark);
    --bs-btn-disabled-bg: var(--q-primary); --bs-btn-disabled-border-color: var(--q-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--q-primary); --bs-btn-border-color: var(--q-primary);
    --bs-btn-hover-bg: var(--q-primary); --bs-btn-hover-border-color: var(--q-primary);
    --bs-btn-active-bg: var(--q-primary-dark); --bs-btn-active-border-color: var(--q-primary-dark);
}
.text-primary { color: var(--q-primary) !important; }
.bg-primary { background-color: var(--q-primary) !important; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #5aa3b4; box-shadow: 0 0 0 .2rem rgba(15, 92, 110, .2);
}
.form-check-input:checked { background-color: var(--q-primary); border-color: var(--q-primary); }

.skip-link { position: absolute; z-index: 2000; background: #fff; padding: .5rem 1rem; }

.app-navbar { background: linear-gradient(90deg, var(--q-primary-dark), var(--q-primary)); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.app-navbar .nav-link { color: rgba(255,255,255,.82); border-radius: 8px; padding-inline: .7rem !important; }
.app-navbar .nav-link:hover, .app-navbar .nav-link.active { color: #fff; background: rgba(255,255,255,.12); }
.brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px; background: var(--q-accent); color: #2b1d05; font-size: 1.15rem;
}
.brand-mark-lg { width: 64px; height: 64px; font-size: 2rem; border-radius: 16px; }
.brand-text { max-width: 260px; font-weight: 700; }

.app-main { max-width: 1500px; }
.page-header h1 { font-weight: 700; color: #1e2b33; }

.card { border: 0; border-radius: var(--q-card-radius); box-shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: transparent; border-bottom: 1px solid #edf0f2; font-weight: 700; padding: .9rem 1.1rem; }
.card-header:first-child { border-radius: var(--q-card-radius) var(--q-card-radius) 0 0; }

/* Stat cards */
.stat-card { position: relative; overflow: hidden; height: 100%; }
.stat-card .card-body { padding: 1rem 1.1rem; }
.stat-card .stat-icon {
    width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex: 0 0 auto;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; line-height: 1.1; color: #17252d; }
.stat-card .stat-label { color: #607080; font-size: .88rem; }
.stat-card.is-alert { box-shadow: inset 0 0 0 2px #dc3545; }
.ic-blue { background: #e3f1f5; color: var(--q-primary); }
.ic-amber { background: #fff3df; color: #b26b00; }
.ic-green { background: #e5f6ec; color: #198754; }
.ic-red { background: #fdeaea; color: #c62828; }
.ic-gray { background: #eef1f3; color: #5c6b77; }
.ic-purple { background: #efe9fb; color: #6f42c1; }

.table { --bs-table-bg: transparent; }
.table thead th { font-size: .82rem; color: #5c6b77; font-weight: 700; white-space: nowrap; background: #f7f9fa; }
.table td { vertical-align: middle; }
.table-card { overflow-x: auto; }

.ticket-chip {
    font-weight: 800; letter-spacing: .5px; background: #eef5f7; color: var(--q-primary-dark);
    border-radius: 8px; padding: .1rem .5rem; display: inline-block; direction: ltr; unicode-bidi: isolate;
}
.ltr { direction: ltr; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }

/* Auth pages */
.auth-body { min-height: 100vh; background: radial-gradient(circle at 20% 20%, #1b7a90, var(--q-primary-dark) 60%, #062a33); }
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; border-radius: 20px; }
.auth-logo { max-height: 80px; max-width: 200px; object-fit: contain; }

/* Reception */
.category-tile {
    display: block; width: 100%; text-align: start; border: 2px solid #dde5e9; border-radius: 14px; background: #fff;
    padding: 1rem 1.1rem; transition: border-color .15s, box-shadow .15s, transform .1s; color: inherit; text-decoration: none;
}
.category-tile:hover, .category-tile:focus { border-color: var(--q-primary); box-shadow: 0 4px 14px rgba(15,92,110,.15); color: inherit; }
.category-tile.active { border-color: var(--q-primary); background: #f0f8fa; }
.category-tile .tile-title { font-weight: 800; font-size: 1.1rem; }
.queue-side .list-group-item { display: flex; justify-content: space-between; align-items: center; }

/* Agent workstation */
.ws-status-bar { border-radius: var(--q-card-radius); }
.ws-ticket-number { font-size: clamp(3rem, 9vw, 6rem); font-weight: 800; line-height: 1; color: var(--q-primary-dark); direction: ltr; }
.ws-empty { color: #8a99a6; }
.ws-actions .btn { min-height: 56px; font-weight: 700; font-size: 1.05rem; }
.ws-actions .btn i { font-size: 1.2rem; }
.ws-status-btn.active { box-shadow: inset 0 0 0 3px rgba(0,0,0,.25); }
.countdown { font-variant-numeric: tabular-nums; font-weight: 700; }
.badge-lg { font-size: 1rem; padding: .5em .8em; }
.customer-table th { width: 40%; color: #607080; font-weight: 600; }

/* Bars (CSS charts) */
.bar-row { display: grid; grid-template-columns: 90px 1fr 90px; gap: .5rem; align-items: center; margin-bottom: .35rem; font-size: .88rem; }
.bar-track { background: #edf2f4; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, #1b7a90, var(--q-primary)); height: 100%; border-radius: 6px; }
.bar-fill.alt { background: linear-gradient(90deg, #f2c27a, var(--q-accent)); }

/* Form builder */
.field-row.inactive td { opacity: .55; }
.option-row + .option-row { margin-top: .5rem; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: #7b8a96; }
.empty-state i { font-size: 2.4rem; display: block; margin-bottom: .5rem; color: #b6c2cb; }

.btn .spinner-border { width: 1rem; height: 1rem; border-width: .15em; }
.metric-help { cursor: help; color: #8a99a6; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 .9rem 0; padding-inline-start: 1.4rem; }
.timeline li::before { content: ''; position: absolute; inset-inline-start: .35rem; top: .45rem; width: 9px; height: 9px; border-radius: 50%; background: var(--q-primary); }
.timeline li::after { content: ''; position: absolute; inset-inline-start: .6rem; top: 1.1rem; bottom: 0; width: 1px; background: #d6dfe4; }
.timeline li:last-child::after { display: none; }

@media (max-width: 575.98px) {
    .stat-card .stat-value { font-size: 1.4rem; }
    .bar-row { grid-template-columns: 70px 1fr 70px; }
}
