/* Israel-Canada brand: orange #F55133, black #000 */
:root {
    --brand: #F55133;
    --brand-dark: #d63f22;
    --brand-soft: #fff1ed;
    --ink: #111;
    --bs-font-sans-serif: "Segoe UI", "Assistant", "Rubik", Arial, sans-serif;
    --bs-link-color: #c7381b;
    --bs-link-color-rgb: 199, 56, 27;
    --bs-link-hover-color: #9e2a12;
}
body { background: #f6f6f7; color: var(--ink); font-size: 0.97rem; }

.site-header { border-bottom: 3px solid var(--brand); box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.brand-logo { height: 30px; width: auto; }
.brand-sub { color: #555; font-size: .95rem; border-inline-start: 1px solid #ddd; padding-inline-start: .6rem; }
.navbar .nav-link { font-weight: 500; color: #333; }
.navbar .nav-link.active { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.site-footer { background: #111; color: #bbb; }

.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.text-brand { color: var(--brand) !important; }
.badge-brand { background: var(--brand); color: #fff; }

.form-control:focus, .form-select:focus { border-color: #f9a798; box-shadow: 0 0 0 .2rem rgba(245,81,51,.18); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.page-item.active .page-link { background: var(--ink); border-color: var(--ink); }
.page-link { color: var(--ink); }
.nav-pills.view-pills .nav-link { color: #333; border-radius: 2rem; padding: .35rem 1rem; }
.nav-pills.view-pills .nav-link.active { background: var(--ink); color: #fff; }

.card { border: 1px solid #e8e8ea; border-radius: .6rem; }
.card-header { border-bottom-color: #eee; }

/* Stat cards */
.stat-card { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem; background: #fff; border: 1px solid #e8e8ea;
    border-radius: .6rem; height: 100%; text-decoration: none; color: var(--ink); border-top: 3px solid #222; transition: transform .1s; }
a.stat-card:hover { transform: translateY(-2px); color: var(--ink); }
.stat-card.stat-accent { border-top-color: var(--brand); }
.stat-card.stat-danger { border-top-color: #c62828; }
.stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.1; }
.stat-label { color: #666; font-size: .85rem; }

/* Badges */
.badge { font-weight: 600; }
.badge-status-new { background: var(--brand); color: #fff; }
.badge-status-progress { background: #1f6feb; color: #fff; }
.badge-status-waiting { background: #f0b400; color: #222; }
.badge-status-resolved { background: #2e7d32; color: #fff; }
.badge-status-closed { background: #6c757d; color: #fff; }
.badge-prio-low { background: #eef0f2; color: #555; }
.badge-prio-normal { background: #e3e7ee; color: #333; }
.badge-prio-high { background: #ffe1d9; color: #b23516; }
.badge-prio-urgent { background: #c62828; color: #fff; }

/* Ticket list */
.ticket-table thead th { font-size: .82rem; color: #666; font-weight: 600; background: #fafafa; white-space: nowrap; }
.clickable-row { cursor: pointer; }
.ticket-card { padding: .85rem 1rem; }

/* Ticket details */
.ticket-number { font-weight: 800; font-size: 1.2rem; color: var(--brand); }
.ticket-body { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.attachments { display: flex; flex-wrap: wrap; gap: .5rem; }
.attachment { background: #f4f4f5; border: 1px solid #e3e3e5; border-radius: 2rem; padding: .2rem .75rem; font-size: .85rem; text-decoration: none; color: var(--ink); }
.attachment:hover { background: var(--brand-soft); border-color: #f9a798; }
.timeline { display: flex; flex-direction: column; gap: .75rem; }
.timeline-system { text-align: center; padding: .1rem 0; }
.comment { display: flex; gap: .75rem; }
.comment-avatar { flex: 0 0 38px; height: 38px; border-radius: 50%; background: #222; color: #fff; display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: .85rem; }
.comment-customer .comment-avatar { background: var(--brand); }
.comment-internal .comment-avatar { background: #f0b400; color: #222; }
.comment-content { flex: 1; background: #fff; border: 1px solid #e8e8ea; border-radius: .6rem; padding: .7rem .9rem; min-width: 0; }
.comment-staff .comment-content { border-inline-start: 3px solid #222; }
.comment-customer .comment-content { border-inline-start: 3px solid var(--brand); }
.comment-internal .comment-content { background: #fffbea; border-color: #f6e3a1; }
.details-list .list-group-item { display: flex; justify-content: space-between; gap: 1rem; }
.details-list .list-group-item > span:first-child { color: #666; }
.staff-box { border: 1px dashed #ccc; border-radius: .5rem; padding: .75rem 1rem 1rem; background: #fcfcfc; }
.staff-box legend { float: none; width: auto; padding: 0 .4rem; font-size: .9rem; color: #555; }

/* Auth */
.auth-wrap { display: flex; justify-content: center; align-items: center; min-height: 65vh; }
.auth-card { width: 100%; max-width: 440px; border-top: 4px solid var(--brand); }
.auth-logo { max-width: 220px; width: 70%; height: auto; }

/* Reports */
.chart-box { position: relative; height: 260px; }
.chart-box.chart-wide { height: 300px; }

@media (max-width: 575.98px) {
    main.container-xl { padding-inline: .75rem; }
    .brand-logo { height: 24px; }
    .stat-value { font-size: 1.35rem; }
    .btn-lg { font-size: 1rem; }
    .chart-box, .chart-box.chart-wide { height: 230px; }
}

@media print {
    .site-header, .site-footer, .filter-bar, .btn { display: none !important; }
    body { background: #fff; }
    .card { break-inside: avoid; }
}

.btn-ms { background: #fff; border: 1px solid #8c8c8c; color: #222; font-weight: 600; }
.btn-ms:hover, .btn-ms:focus { background: #f3f3f3; color: #111; border-color: #555; }
