/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 1rem; line-height: 1.5; }
a { color: inherit; }
img { max-width: 100%; vertical-align: middle; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid; opacity: .25; margin: 1rem 0; }
label { display: inline-block; }
table { border-collapse: collapse; }

/* ─── Container ──────────────────────────────────────────────────────────────── */
.container { width: 100%; max-width: 1140px; padding: 0 15px; margin: 0 auto; }
.container-fluid { width: 100%; padding: 0 15px; }

/* ─── Grid ────────────────────────────────────────────────────────────────────── */
.row { display: flex; flex-wrap: wrap; margin-left: -15px; margin-right: -15px; }
[class*="col-"] { padding-left: 15px; padding-right: 15px; width: 100%; }
.col    { flex: 1 0 0%; padding-left: 15px; padding-right: 15px; }
.col-1  { width: 8.333333%; } .col-2  { width: 16.666667%; } .col-3  { width: 25%; }
.col-4  { width: 33.333333%; } .col-5  { width: 41.666667%; } .col-6  { width: 50%; }
.col-7  { width: 58.333333%; } .col-8  { width: 66.666667%; } .col-9  { width: 75%; }
.col-10 { width: 83.333333%; } .col-11 { width: 91.666667%; } .col-12 { width: 100%; }

@media (min-width: 576px) {
  .col-sm-1  { width: 8.333333%; }  .col-sm-2  { width: 16.666667%; } .col-sm-3  { width: 25%; }
  .col-sm-4  { width: 33.333333%; } .col-sm-5  { width: 41.666667%; } .col-sm-6  { width: 50%; }
  .col-sm-7  { width: 58.333333%; } .col-sm-8  { width: 66.666667%; } .col-sm-9  { width: 75%; }
  .col-sm-10 { width: 83.333333%; } .col-sm-11 { width: 91.666667%; } .col-sm-12 { width: 100%; }
}
@media (min-width: 768px) {
  .col-md-1  { width: 8.333333%; }  .col-md-2  { width: 16.666667%; } .col-md-3  { width: 25%; }
  .col-md-4  { width: 33.333333%; } .col-md-5  { width: 41.666667%; } .col-md-6  { width: 50%; }
  .col-md-7  { width: 58.333333%; } .col-md-8  { width: 66.666667%; } .col-md-9  { width: 75%; }
  .col-md-10 { width: 83.333333%; } .col-md-11 { width: 91.666667%; } .col-md-12 { width: 100%; }
}
@media (min-width: 992px) {
  .col-lg-1  { width: 8.333333%; }  .col-lg-2  { width: 16.666667%; } .col-lg-3  { width: 25%; }
  .col-lg-4  { width: 33.333333%; } .col-lg-5  { width: 41.666667%; } .col-lg-6  { width: 50%; }
  .col-lg-7  { width: 58.333333%; } .col-lg-8  { width: 66.666667%; } .col-lg-9  { width: 75%; }
  .col-lg-10 { width: 83.333333%; } .col-lg-11 { width: 91.666667%; } .col-lg-12 { width: 100%; }
}

/* ─── Display ─────────────────────────────────────────────────────────────────── */
.d-none         { display: none !important; }
.d-block        { display: block !important; }
.d-inline       { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex         { display: flex !important; }
.d-inline-flex  { display: inline-flex !important; }

/* ─── Flex ────────────────────────────────────────────────────────────────────── */
.flex-row        { flex-direction: row !important; }
.flex-column     { flex-direction: column !important; }
.flex-wrap       { flex-wrap: wrap !important; }
.flex-nowrap     { flex-wrap: nowrap !important; }
.flex-grow-1     { flex-grow: 1 !important; }
.flex-shrink-0   { flex-shrink: 0 !important; }
.flex-fill       { flex: 1 1 auto !important; }
.align-items-start    { align-items: flex-start !important; }
.align-items-center   { align-items: center !important; }
.align-items-end      { align-items: flex-end !important; }
.align-items-baseline { align-items: baseline !important; }
.align-self-start  { align-self: flex-start !important; }
.align-self-center { align-self: center !important; }
.align-self-end    { align-self: flex-end !important; }
.justify-content-start   { justify-content: flex-start !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around  { justify-content: space-around !important; }

/* ─── Spacing ─────────────────────────────────────────────────────────────────── */
/* scale: 0=0  1=.25rem  2=.5rem  3=1rem  4=1.5rem  5=3rem */
.m-0  { margin: 0 !important; }         .m-1  { margin: .25rem !important; }      .m-2  { margin: .5rem !important; }
.m-3  { margin: 1rem !important; }      .m-4  { margin: 1.5rem !important; }      .m-5  { margin: 3rem !important; }
.mt-0 { margin-top: 0 !important; }     .mt-1 { margin-top: .25rem !important; }  .mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }  .mt-4 { margin-top: 1.5rem !important; }  .mt-5 { margin-top: 3rem !important; }
.mt-auto { margin-top: auto !important; }
.mb-0 { margin-bottom: 0 !important; }  .mb-1 { margin-bottom: .25rem !important;}.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }.mb-4 { margin-bottom: 1.5rem !important;}.mb-5 { margin-bottom: 3rem !important; }
.ml-0 { margin-left: 0 !important; }    .ml-1 { margin-left: .25rem !important; } .ml-2 { margin-left: .5rem !important; }
.ml-3 { margin-left: 1rem !important; } .ml-4 { margin-left: 1.5rem !important; } .ml-5 { margin-left: 3rem !important; }
.mr-0 { margin-right: 0 !important; }   .mr-1 { margin-right: .25rem !important; }.mr-2 { margin-right: .5rem !important; }
.mr-3 { margin-right: 1rem !important; }.mr-4 { margin-right: 1.5rem !important; }.mr-5 { margin-right: 3rem !important; }
.mx-0 { margin-left: 0 !important; margin-right: 0 !important; }
.mx-1 { margin-left: .25rem !important; margin-right: .25rem !important; }
.mx-2 { margin-left: .5rem !important; margin-right: .5rem !important; }
.mx-3 { margin-left: 1rem !important; margin-right: 1rem !important; }
.mx-4 { margin-left: 1.5rem !important; margin-right: 1.5rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-1 { margin-top: .25rem !important; margin-bottom: .25rem !important; }
.my-2 { margin-top: .5rem !important; margin-bottom: .5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }
.ml-auto { margin-left: auto !important; }
.mr-auto { margin-right: auto !important; }

.p-0  { padding: 0 !important; }        .p-1  { padding: .25rem !important; }     .p-2  { padding: .5rem !important; }
.p-3  { padding: 1rem !important; }     .p-4  { padding: 1.5rem !important; }     .p-5  { padding: 3rem !important; }
.pt-0 { padding-top: 0 !important; }    .pt-1 { padding-top: .25rem !important; } .pt-2 { padding-top: .5rem !important; }
.pt-3 { padding-top: 1rem !important; } .pt-4 { padding-top: 1.5rem !important; } .pt-5 { padding-top: 3rem !important; }
.pb-0 { padding-bottom: 0 !important; } .pb-1 { padding-bottom: .25rem !important;}.pb-2 { padding-bottom: .5rem !important; }
.pb-3 { padding-bottom: 1rem !important;}.pb-4 { padding-bottom: 1.5rem !important;}.pb-5 { padding-bottom: 3rem !important; }
.pl-0 { padding-left: 0 !important; }   .pl-1 { padding-left: .25rem !important; }.pl-2 { padding-left: .5rem !important; }
.pl-3 { padding-left: 1rem !important; }.pl-4 { padding-left: 1.5rem !important; }.pl-5 { padding-left: 3rem !important; }
.pr-0 { padding-right: 0 !important; }  .pr-1 { padding-right: .25rem !important;}.pr-2 { padding-right: .5rem !important; }
.pr-3 { padding-right: 1rem !important;}.pr-4 { padding-right: 1.5rem !important;}.pr-5 { padding-right: 3rem !important; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-1 { padding-left: .25rem !important; padding-right: .25rem !important; }
.px-2 { padding-left: .5rem !important; padding-right: .5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-1 { padding-top: .25rem !important; padding-bottom: .25rem !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

/* ─── Text ────────────────────────────────────────────────────────────────────── */
.text-left    { text-align: left !important; }
.text-center  { text-align: center !important; }
.text-right   { text-align: right !important; }
.text-uppercase   { text-transform: uppercase !important; }
.text-lowercase   { text-transform: lowercase !important; }
.text-capitalize  { text-transform: capitalize !important; }
.text-truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-nowrap      { white-space: nowrap !important; }
.text-break       { word-break: break-word !important; }
.font-weight-bold   { font-weight: 700 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-italic        { font-style: italic !important; }
.font-mono          { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace !important; }
.small, small       { font-size: .875em; }
.text-muted    { opacity: .7; }
.text-white    { color: #fff !important; }

/* ─── Float / Position ────────────────────────────────────────────────────────── */
.float-left  { float: left !important; }
.float-right { float: right !important; }
.clearfix::after { content: ''; display: table; clear: both; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed    { position: fixed !important; }
.position-sticky   { position: sticky !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.mw-100 { max-width: 100% !important; }

/* ─── Border / Shape ──────────────────────────────────────────────────────────── */
.border        { border: 1px solid currentColor; }
.border-top    { border-top: 1px solid currentColor; }
.border-bottom { border-bottom: 1px solid currentColor; }
.border-0      { border: 0 !important; }
.rounded        { border-radius: .375rem; }
.rounded-circle { border-radius: 50%; }
.rounded-0      { border-radius: 0; }

/* ─── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .5rem 1rem; font-size: .875rem; font-weight: 500; line-height: 1.5;
  border: 1px solid transparent; border-radius: .375rem;
  text-decoration: none; cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .65; pointer-events: none; }
.btn-sm { padding: .25rem .625rem; font-size: .8125rem; border-radius: .25rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; border-radius: .5rem; }
.btn-block { width: 100%; display: flex; }
.btn-primary  { background: var(--tc-blue, #2f81f7); color: #fff; border-color: var(--tc-blue, #2f81f7); }
.btn-primary:hover { background: var(--tc-blue-hover, #388bfd); border-color: var(--tc-blue-hover, #388bfd); color: #fff; text-decoration: none; }
.btn-secondary { background: #6b7280; color: #fff; border-color: #6b7280; }
.btn-secondary:hover { background: #4b5563; color: #fff; text-decoration: none; }
.btn-success  { background: var(--tc-green, #3fb950); color: #fff; border-color: var(--tc-green, #3fb950); }
.btn-danger   { background: var(--tc-red, #f85149); color: #fff; border-color: var(--tc-red, #f85149); }
.btn-danger:hover { background: #da3633; color: #fff; text-decoration: none; }
.btn-warning  { background: var(--tc-yellow, #d29922); color: #fff; border-color: var(--tc-yellow, #d29922); }
.btn-warning:hover { background: #b88318; color: #fff; text-decoration: none; }
.btn-outline-primary { background: transparent; color: var(--tc-blue, #2f81f7); border-color: var(--tc-blue, #2f81f7); }
.btn-outline-primary:hover { background: var(--tc-blue, #2f81f7); color: #fff; }
.btn-link { background: none; border: none; color: var(--tc-blue, #2f81f7); padding: 0; text-decoration: underline; }

/* ─── Forms ───────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-control {
  display: block; width: 100%; padding: .5rem .75rem;
  font-size: .875rem; line-height: 1.5;
  border: 1px solid #d1d5db; border-radius: .375rem;
  background: #fff; color: #111; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: #2f81f7; box-shadow: 0 0 0 2px rgba(47,129,247,.2); }
.form-control-sm  { padding: .25rem .5rem; font-size: .8125rem; }
.form-control-file { display: block; width: 100%; }
.form-text { display: block; margin-top: .25rem; font-size: .8125rem; }
.form-check { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.form-check-input { width: 1rem; height: 1rem; cursor: pointer; }
.form-check-label { cursor: pointer; }
/* Custom switch */
.custom-control { padding-left: 1.5rem; }
.custom-control-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.custom-control-label { position: relative; cursor: pointer; padding-left: .5rem; }
.custom-switch .custom-control-label::before {
  content: ''; position: absolute; left: -2rem; top: .125rem;
  width: 2rem; height: 1rem; border-radius: .5rem;
  background: #6b7280; transition: background .15s;
}
.custom-switch .custom-control-label::after {
  content: ''; position: absolute; left: -1.9rem; top: .2rem;
  width: .8rem; height: .8rem; border-radius: 50%;
  background: #fff; transition: left .15s;
}
.custom-switch .custom-control-input:checked ~ .custom-control-label::before { background: var(--tc-blue, #2f81f7); }
.custom-switch .custom-control-input:checked ~ .custom-control-label::after  { left: -1.1rem; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .5rem center; background-size: 1.2rem; padding-right: 2rem; }
textarea.form-control { resize: vertical; }

/* ─── Card ────────────────────────────────────────────────────────────────────── */
.card { border: 1px solid #e5e7eb; border-radius: .5rem; background: #fff; }
.card-header { padding: .75rem 1.25rem; border-bottom: 1px solid #e5e7eb; font-weight: 600; }
.card-body   { padding: 1.25rem; }
.card-footer { padding: .75rem 1.25rem; border-top: 1px solid #e5e7eb; }

/* ─── Alert ───────────────────────────────────────────────────────────────────── */
.alert { padding: .875rem 1rem; border-radius: .375rem; border: 1px solid; margin-bottom: 1rem; }
.alert-success { background: rgba(63,185,80,.12); border-color: rgba(63,185,80,.3); color: var(--tc-green, #3fb950); }
.alert-danger  { background: rgba(248,81,73,.12);  border-color: rgba(248,81,73,.3);  color: var(--tc-red,   #f85149); }
.alert-warning { background: rgba(210,153,34,.12); border-color: rgba(210,153,34,.3); color: var(--tc-yellow,#d29922); }
.alert-info    { background: rgba(47,129,247,.12); border-color: rgba(47,129,247,.3); color: var(--tc-blue,  #2f81f7); }

/* ─── Badge ───────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2em .55em;
  font-size: .75em; font-weight: 600;
  line-height: 1; border-radius: 20px;
  white-space: nowrap; vertical-align: baseline;
}
.badge-primary   { background: rgba(47,129,247,.2);  color: var(--tc-blue, #2f81f7); }
.badge-secondary { background: rgba(107,114,128,.2); color: #9ca3af; }
.badge-success   { background: rgba(63,185,80,.2);   color: var(--tc-green, #3fb950); }
.badge-danger    { background: rgba(248,81,73,.2);   color: var(--tc-red, #f85149); }
.badge-warning   { background: rgba(210,153,34,.2);  color: var(--tc-yellow, #d29922); }

/* ─── Nav / Tabs ──────────────────────────────────────────────────────────────── */
.nav { display: flex; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.nav-item { display: block; }
.nav-link { display: block; padding: .5rem 1rem; text-decoration: none; }
.nav-tabs { border-bottom: 1px solid #e5e7eb; }
.nav-tabs .nav-link { margin-bottom: -1px; border: 1px solid transparent; border-radius: .375rem .375rem 0 0; }
.nav-tabs .nav-link.active { background: transparent; border-color: #e5e7eb #e5e7eb #fff; }

/* ─── Progress ────────────────────────────────────────────────────────────────── */
.progress { height: .75rem; background: #e5e7eb; border-radius: 20px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 20px; transition: width .3s; }
.bg-success { background: var(--tc-green, #3fb950); }
.bg-danger  { background: var(--tc-red,   #f85149); }
.bg-warning { background: var(--tc-yellow, #d29922); }
.bg-primary { background: var(--tc-blue,  #2f81f7); }

/* ─── Modal ───────────────────────────────────────────────────────────────────── */
.modal { display: none; position: fixed; inset: 0; z-index: 1050; overflow: auto; background: rgba(0,0,0,.5); align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-dialog { width: 100%; max-width: 500px; margin: 1.75rem auto; }
.modal-content { border-radius: .5rem; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #e5e7eb; }
.modal-title  { margin: 0; font-size: 1rem; font-weight: 600; }
.modal-body   { padding: 1.25rem; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; padding: 1rem 1.25rem; border-top: 1px solid #e5e7eb; }
.close { background: none; border: none; font-size: 1.25rem; line-height: 1; cursor: pointer; opacity: .6; padding: 0; }
.close:hover { opacity: 1; }
.fade { transition: opacity .15s linear; }

/* ─── Dropdown ────────────────────────────────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { display: none; position: absolute; right: 0; top: 100%; z-index: 1000; min-width: 160px; padding: .25rem 0; border: 1px solid #e5e7eb; border-radius: .375rem; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.dropdown-menu.show { display: block; }
.dropdown-item { display: block; width: 100%; padding: .4rem 1rem; clear: both; text-decoration: none; white-space: nowrap; background: none; border: none; cursor: pointer; }
.dropdown-divider { border-top: 1px solid #e5e7eb; margin: .25rem 0; }

/* ─── Table ───────────────────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .625rem .75rem; vertical-align: middle; }
.table thead th { font-weight: 600; }
.table-bordered { border: 1px solid #e5e7eb; }
.table-bordered td, .table-bordered th { border: 1px solid #e5e7eb; }

/* ─── List group ──────────────────────────────────────────────────────────────── */
.list-group { display: flex; flex-direction: column; padding: 0; margin: 0; border-radius: .375rem; overflow: hidden; }
.list-group-item { padding: .75rem 1rem; border: 1px solid #e5e7eb; margin-top: -1px; }

/* ─── DL row helper (Bootstrap .row inside dl) ───────────────────────────────── */
dl.row > dt, dl.row > dd { padding-left: 15px; padding-right: 15px; }
dl.row { display: flex; flex-wrap: wrap; margin-left: -15px; margin-right: -15px; }

/* ─── Misc utilities ──────────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-auto   { overflow: auto !important; }
.align-middle { vertical-align: middle !important; }
.align-top    { vertical-align: top !important; }
.text-decoration-none { text-decoration: none !important; }
.pl-3 { padding-left: 1rem !important; }
.input-group { display: flex; }
.input-group .form-control { flex: 1; border-radius: .375rem 0 0 .375rem; }
.input-group .btn { border-radius: 0 .375rem .375rem 0; }
