:root {
  --app-navy: #1f3864;
  --app-navy-dark: #162a4c;
  --app-accent: #2e9e7a;
  --app-accent-dark: #247f62;
  --app-bg: #f4f6f9;
}
body { background: var(--app-bg); }
.app-navbar { background: var(--app-navy); }
.app-navbar .navbar-brand, .app-navbar .nav-link { color: #e6ebf3; }
.app-navbar .nav-link:hover, .app-navbar .nav-link.active { color: #fff; }
.app-navbar .nav-link.active { border-bottom: 2px solid var(--app-accent); }
.app-main { padding: 1.25rem 1.5rem 3rem; max-width: 1400px; }
.btn-accent { background: var(--app-accent); color: #fff; border: 0; }
.btn-accent:hover { background: var(--app-accent-dark); color: #fff; }
.notif-badge { position: absolute; top: 0; right: -2px; font-size: .65rem; }

.stat-card { background: #fff; border: 1px solid #e3e7ee; border-radius: .5rem; padding: .9rem 1rem; text-decoration: none; color: inherit; display: block; }
.stat-card:hover { border-color: var(--app-accent); color: inherit; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 600; line-height: 1.1; }
.stat-card .stat-label { color: #6c757d; font-size: .85rem; }
.stat-card.danger .stat-value { color: #c0392b; }
.stat-card.warn .stat-value { color: #b7770d; }

.panel { background: #fff; border: 1px solid #e3e7ee; border-radius: .5rem; }
.panel-header { padding: .75rem 1rem; border-bottom: 1px solid #e3e7ee; font-weight: 600; }
.panel-body { padding: 1rem; }

/* status & priority badges - consistent everywhere (document 14.3) */
.badge-status { font-weight: 500; }
.status-open { background: #6c757d; }
.status-assigned { background: #0d6efd; }
.status-in_progress { background: #17a2b8; }
.status-waiting_requester { background: #fd7e14; }
.status-on_hold { background: #6f42c1; }
.status-resolved { background: #20c997; }
.status-closed { background: #343a40; }
.status-reopened { background: #dc3545; }
.status-rejected { background: #e83e8c; }
.status-cancelled { background: #adb5bd; color: #212529; }
.prio-low { background: #adb5bd; color: #212529; }
.prio-medium { background: #0d6efd; }
.prio-high { background: #fd7e14; }
.prio-critical { background: #dc3545; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 400px; }
@media (max-width: 576px) { .app-main { padding: 1rem .75rem 3rem; } }

/* uploader */
.uploader-drop { border: 2px dashed #c5ccd6; border-radius: .5rem; padding: 1.1rem; text-align: center; color: #495057; background: #fafbfc; }
.uploader.dragover .uploader-drop { border-color: var(--app-accent); background: #eefaf5; }
.uploader-item { display: flex; align-items: center; flex-wrap: wrap; padding: .35rem .25rem; border-bottom: 1px solid #eef0f3; font-size: .9rem; }
.uploader-progress { height: 4px; width: 100%; margin-top: .25rem; order: 5; }
.uploader-remove { margin-left: auto; padding: 0 .25rem; }
.uploader-name { word-break: break-all; }

/* attachments */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.file-card { border: 1px solid #e3e7ee; border-radius: .5rem; overflow: hidden; background: #fff; font-size: .8rem; }
.file-card .thumb { height: 110px; display: flex; align-items: center; justify-content: center; background: #f1f3f6; overflow: hidden; }
.file-card .thumb img { max-width: 100%; max-height: 100%; object-fit: cover; width: 100%; height: 100%; cursor: zoom-in; }
.file-card .thumb i { font-size: 2.2rem; color: #6c757d; }
.file-card .meta { padding: .4rem .5rem; }
.file-card .name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ticket detail */
.ticket-header { background: #fff; border: 1px solid #e3e7ee; border-radius: .5rem; padding: 1rem 1.25rem; }
.ticket-number { color: #6c757d; font-weight: 500; }
.timeline-item { border-left: 3px solid #e3e7ee; padding: .25rem 0 .75rem 1rem; margin-left: .5rem; }
.timeline-item.system { color: #6c757d; font-size: .875rem; border-left-color: #f1f3f6; }
.timeline-item.internal { background: #fff8e6; border-left-color: #f0c36d; border-radius: 0 .4rem .4rem 0; padding-right: .75rem; }
.desc-box { white-space: pre-wrap; }
.filter-bar .form-control, .filter-bar .form-select { font-size: .875rem; }
th a { color: inherit; text-decoration: none; }
th a.active { color: var(--app-navy); }
.overdue-dot::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: #dc3545; margin-right: .3rem; }

/* remarks & mentions */
.remark-body { white-space: normal; word-break: break-word; }
.mention { background: #e7f1ff; color: #0a58ca; border-radius: .25rem; padding: 0 .2rem; font-weight: 500; }
.mention-menu { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; max-height: 220px; overflow-y: auto; }
.timeline-item:target { background: #fffbe6; border-radius: .4rem; }

.notif-menu { width: 340px; max-height: 420px; overflow-y: auto; }

/* print / save as PDF */
@media print {
  .app-navbar, .no-print, .btn, form.no-print { display: none !important; }
  .app-main { max-width: 100%; padding: 0; }
  .panel { break-inside: avoid; border: 1px solid #ccc; }
  a { color: inherit; text-decoration: none; }
}

/* mobile polish (step 9) */
@media (max-width: 767px) {
  .ticket-header h1 { font-size: 1.15rem; }
  .stat-card .stat-value { font-size: 1.4rem; }
  .table td, .table th { padding: .35rem .4rem; font-size: .85rem; }
  .modal-dialog { margin: .5rem; }
  .filter-bar .col-md-3, .filter-bar .col-md-4, .filter-bar .col-md-2 { flex: 0 0 100%; max-width: 100%; }
  .nav-tabs .nav-link { padding: .4rem .6rem; font-size: .9rem; }
  .btn-sm { padding: .3rem .55rem; }
  #actionBar .btn { flex: 1 1 45%; }
  .notif-menu { width: 92vw; }
}
input, select, textarea { font-size: 16px !important; } /* prevents iOS zoom on focus */
