/* Guard Reporting System — Pro UI Pack (v1.1)
   Clean, modern, professional styling on top of Bootstrap 5
*/

:root{
  --grs-accent: 44, 182, 255;          /* cyan */
  --grs-accent-2: 170, 88, 255;        /* violet */
  --grs-good: 34, 197, 94;             /* green */
  --grs-warn: 245, 158, 11;            /* amber */
  --grs-danger: 239, 68, 68;           /* red */

  --grs-radius: 1.25rem;
  --grs-radius-sm: .9rem;
  --grs-shadow: 0 18px 55px rgba(0,0,0,.14);
  --grs-shadow-sm: 0 10px 28px rgba(0,0,0,.12);

  --grs-border: rgba(120,130,150,.22);
  --grs-border-strong: rgba(120,130,150,.32);
}

/* Base */
.grs-body{
  min-height:100vh;
  position:relative;
  letter-spacing: .01em;
  text-rendering: optimizeLegibility;
}

.grs-bg{
  position:fixed;
  inset:0;
  z-index:-1;
  background:
    radial-gradient(1100px 700px at 16% 6%, rgba(var(--grs-accent), .18), transparent 62%),
    radial-gradient(900px 520px at 92% 18%, rgba(var(--grs-accent-2), .14), transparent 64%),
    radial-gradient(920px 620px at 55% 102%, rgba(var(--grs-good), .10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.62), rgba(255,255,255,.74));
  filter:saturate(1.08);
}

/* Dark mode background */
[data-bs-theme="dark"] .grs-bg,
@media (prefers-color-scheme: dark){
  html:not([data-bs-theme="light"]) .grs-bg{
    background:
      radial-gradient(1100px 700px at 16% 6%, rgba(var(--grs-accent), .18), transparent 62%),
      radial-gradient(900px 520px at 92% 18%, rgba(var(--grs-accent-2), .12), transparent 64%),
      radial-gradient(920px 620px at 55% 102%, rgba(var(--grs-good), .10), transparent 60%),
      linear-gradient(180deg, rgba(9,12,18,.95), rgba(9,12,18,.98));
  }
}

/* Subtle motion (respects reduced motion) */
@media (prefers-reduced-motion: no-preference){
  .grs-bg{ animation: grsGlow 14s ease-in-out infinite alternate; }
  @keyframes grsGlow{
    0%{ filter:saturate(1.05) contrast(1.02); }
    100%{ filter:saturate(1.12) contrast(1.06); }
  }
}

/* Navbar */
.navbar-blur{
  backdrop-filter: blur(14px);
  background: rgba(255,255,255,.72);
  border-bottom: 1px solid var(--grs-border);
}

[data-bs-theme="dark"] .navbar-blur,
@media (prefers-color-scheme: dark){
  html:not([data-bs-theme="light"]) .navbar-blur{
    background: rgba(15,18,24,.72);
    border-bottom-color: rgba(255,255,255,.10);
  }
}

.navbar .nav-link{
  font-weight: 600;
  border-radius: .8rem;
  padding: .35rem .6rem;
  opacity: .92;
}

.navbar .nav-link:hover{
  background: rgba(var(--grs-accent), .10);
  opacity: 1;
}

/* Brand */
.logo-dot{
  width:12px;
  height:12px;
  border-radius:50%;
  background: rgb(var(--grs-accent));
  box-shadow: 0 0 18px rgba(var(--grs-accent), .55);
  display:inline-block;
}

/* Cards */
.grs-card{
  border-radius: var(--grs-radius);
  border: 1px solid var(--grs-border) !important;
  background: rgba(255,255,255,.75);
  box-shadow: var(--grs-shadow-sm);
}

[data-bs-theme="dark"] .grs-card,
@media (prefers-color-scheme: dark){
  html:not([data-bs-theme="light"]) .grs-card{
    background: rgba(16,19,26,.70);
    border-color: rgba(255,255,255,.10) !important;
  }
}

.grs-card .card-body{ padding: 1.25rem; }

.grs-card:hover{
  transform: translateY(-1px);
  box-shadow: var(--grs-shadow);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

@media (prefers-reduced-motion: reduce){
  .grs-card:hover{ transform:none; transition:none; }
}

/* Icon badge */
.grs-icon-badge{
  width:48px;
  height:48px;
  border-radius: 16px;
  display:grid;
  place-items:center;
  background: rgba(var(--grs-accent), .12);
  border: 1px solid rgba(var(--grs-accent), .26);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.10);
}

/* Typography helpers */
.grs-prewrap{ white-space: pre-wrap; }
.grs-badge-role{ border-radius: 999px; }

/* Buttons */
.btn{
  border-radius: .95rem;
  font-weight: 650;
  letter-spacing: .01em;
}

.btn-primary{
  --bs-btn-bg: rgb(var(--grs-accent));
  --bs-btn-border-color: rgba(var(--grs-accent), .55);
  --bs-btn-hover-bg: rgba(var(--grs-accent), .92);
  --bs-btn-hover-border-color: rgba(var(--grs-accent), .75);
  --bs-btn-active-bg: rgba(var(--grs-accent), .86);
  --bs-btn-active-border-color: rgba(var(--grs-accent), .85);
  --bs-btn-color: #04101b;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger{
  border-width: 1px;
}

/* Inputs / selects / textareas */
.form-control,
.form-select{
  border-radius: .95rem;
  border-color: var(--grs-border-strong);
  padding-top: .65rem;
  padding-bottom: .65rem;
}

.form-control:focus,
.form-select:focus{
  border-color: rgba(var(--grs-accent), .65);
  box-shadow: 0 0 0 .25rem rgba(var(--grs-accent), .14);
}

textarea.form-control{ min-height: 110px; }

/* Tables */
.table{
  --bs-table-bg: transparent;
}

.table thead th{
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .8;
}

.table tbody tr{
  border-color: var(--grs-border);
}

.table tbody tr:hover{
  background: rgba(var(--grs-accent), .06);
}

/* List groups */
.list-group-item{
  border-color: var(--grs-border);
}

.list-group-item:hover{
  background: rgba(var(--grs-accent), .06);
}

/* Badges */
.badge{
  border-radius: 999px;
  letter-spacing: .02em;
  font-weight: 700;
}

/* Alerts (make them feel "app-like") */
.alert{
  border-radius: 1rem;
  border: 1px solid var(--grs-border);
  box-shadow: 0 10px 24px rgba(0,0,0,.10);
}

/* Pagination */
.pagination .page-link{
  border-radius: .8rem !important;
  margin: 0 .15rem;
}

/* Footer */
footer{
  opacity: .92;
}

/* Better small screens spacing */
@media (max-width: 576px){
  .grs-card .card-body{ padding: 1.05rem; }
  .navbar .nav-link{ padding: .35rem .6rem; }
}


/* Patrol checkpoints QR */
.qrbox {
  width: 120px;
  height: 120px;
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  padding: 6px;
  box-shadow: 0 8px 22px rgba(0,0,0,.14);
  overflow: hidden;
}
.qrbox canvas, .qrbox img {
  width: 108px !important;
  height: 108px !important;
  display: block;
}


/* Guard UX */
.guard-shell{padding-bottom:72px;}
.guard-header{display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px;}
.guard-actions .guard-btn{border-radius:18px;}
.guard-bottom-nav{position:fixed; left:0; right:0; bottom:0; z-index:1030; background:rgba(255,255,255,.92); backdrop-filter: blur(10px); border-top:1px solid rgba(0,0,0,.08); display:flex; justify-content:space-around; padding:10px;}
body.dark .guard-bottom-nav{background:rgba(17,17,17,.92); border-top:1px solid rgba(255,255,255,.10);}
.guard-nav-item{font-size:13px; text-decoration:none; color:inherit; display:flex; align-items:center; gap:6px; padding:8px 10px; border-radius:14px;}
.guard-nav-item.active{font-weight:600; background:rgba(0,0,0,.06);}
body.dark .guard-nav-item.active{background:rgba(255,255,255,.08);}

body.guard-mode .guard-btn{font-size:1.15rem; padding:18px 16px;}
body.guard-mode .btn{border-radius:18px;}


}


/* Header branding logo */
.app-logo{height:32px; width:auto; max-width:220px; object-fit:contain;}
@media (max-width: 576px){.app-logo{height:28px; max-width:180px;}}


/* Login branding logo */
.login-logo{height:64px; width:auto; max-width:260px; object-fit:contain;}
@media (max-width: 576px){.login-logo{height:56px; max-width:200px;}}


/* Navbar compact (prevents header overlap) */
.navbar.navbar-blur{padding-top:.25rem; padding-bottom:.25rem;}
.navbar-brand{padding-top:0; padding-bottom:0;}
.navbar-brand .app-logo{height:26px; max-width:200px; display:inline-block; vertical-align:middle;}
@media (max-width: 576px){
  .navbar.navbar-blur{padding-top:.2rem; padding-bottom:.2rem;}
  .navbar-brand .app-logo{height:24px; max-width:170px;}
}


/* Report attachment thumbnails */
.grs-thumb-grid{display:grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem;}
.grs-thumb{border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.04); border-radius: .9rem; padding:.35rem; cursor:pointer;}
.grs-thumb img{width:100%; height:110px; object-fit:cover; border-radius:.7rem; display:block;}
.grs-thumb:focus{outline:2px solid rgba(56,189,248,.45); outline-offset:2px;}
@media (max-width: 576px){
  .grs-thumb-grid{grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));}
  .grs-thumb img{height:90px;}
}


/* Task due states */
.task-overdue{border-color: rgba(220,53,69,.35) !important; background: rgba(220,53,69,.06);} 


/* Utility: preserve newlines in notes */
.pre-wrap{white-space:pre-wrap;}

/* Live Patrol Mode */
#qrReader video { border-radius: 16px; }
#qrReader canvas { border-radius: 16px; }
#queuePanel .table td { vertical-align: middle; }
@media (max-width: 576px){
  #startCamBtn, #stopCamBtn { width: 100%; }
  #queuePanel .btn { width: 100%; }
}
