/* ============================================================
   ACCO Accounts — base primitives
   Self-contained replacement for AdminLTE / Bootstrap 4 CSS.
   Provides only the grid, form, button, table, modal, list,
   progress and utility classes the views actually use, styled
   to the ACCO design system (see modern-theme.css for tokens
   and higher-level components). Loaded BEFORE modern-theme.css
   so component styles win where they overlap.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ── Base typography / reset (was provided by AdminLTE) ── */
html { font-size: 14px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { margin: 0 0 .4rem; font-weight: 700; line-height: 1.3; color: var(--text); }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; color: var(--accent-h); }
img { vertical-align: middle; border-style: none; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
label { display: inline-block; }
button { font-family: inherit; }
dl, dd { margin: 0; }
dt { font-weight: 600; }
::selection { background: var(--accent-bg); }

/* ── Grid ─────────────────────────────────────────────── */
.container-fluid { width: 100%; padding: 0; }
.row { display: flex; flex-wrap: wrap; margin-right: -10px; margin-left: -10px; }
.row > [class*="col"] { padding-right: 10px; padding-left: 10px; }
.row.g-3 { gap: 0; }
.row.no-gutters { margin: 0; }
.row.no-gutters > [class*="col"] { padding: 0; }

.col { flex: 1 0 0%; }
[class*="col-"] { position: relative; width: 100%; }

.col-1{flex:0 0 8.3333%;max-width:8.3333%}
.col-2{flex:0 0 16.6667%;max-width:16.6667%}
.col-3{flex:0 0 25%;max-width:25%}
.col-4{flex:0 0 33.3333%;max-width:33.3333%}
.col-5{flex:0 0 41.6667%;max-width:41.6667%}
.col-6{flex:0 0 50%;max-width:50%}
.col-7{flex:0 0 58.3333%;max-width:58.3333%}
.col-8{flex:0 0 66.6667%;max-width:66.6667%}
.col-9{flex:0 0 75%;max-width:75%}
.col-10{flex:0 0 83.3333%;max-width:83.3333%}
.col-11{flex:0 0 91.6667%;max-width:91.6667%}
.col-12{flex:0 0 100%;max-width:100%}

@media (min-width: 576px) {
  .col-sm-3{flex:0 0 25%;max-width:25%}
  .col-sm-4{flex:0 0 33.3333%;max-width:33.3333%}
  .col-sm-5{flex:0 0 41.6667%;max-width:41.6667%}
  .col-sm-6{flex:0 0 50%;max-width:50%}
  .col-sm-7{flex:0 0 58.3333%;max-width:58.3333%}
  .col-sm-8{flex:0 0 66.6667%;max-width:66.6667%}
  .col-sm-12{flex:0 0 100%;max-width:100%}
}
@media (min-width: 768px) {
  .col-md-2{flex:0 0 16.6667%;max-width:16.6667%}
  .col-md-3{flex:0 0 25%;max-width:25%}
  .col-md-4{flex:0 0 33.3333%;max-width:33.3333%}
  .col-md-5{flex:0 0 41.6667%;max-width:41.6667%}
  .col-md-6{flex:0 0 50%;max-width:50%}
  .col-md-7{flex:0 0 58.3333%;max-width:58.3333%}
  .col-md-8{flex:0 0 66.6667%;max-width:66.6667%}
  .col-md-9{flex:0 0 75%;max-width:75%}
  .col-md-12{flex:0 0 100%;max-width:100%}
}
@media (min-width: 992px) {
  .col-lg-3{flex:0 0 25%;max-width:25%}
  .col-lg-4{flex:0 0 33.3333%;max-width:33.3333%}
  .col-lg-6{flex:0 0 50%;max-width:50%}
  .col-lg-8{flex:0 0 66.6667%;max-width:66.6667%}
  .col-lg-9{flex:0 0 75%;max-width:75%}
  .col-lg-12{flex:0 0 100%;max-width:100%}
}

/* ── Forms ────────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-control {
  display: block; width: 100%; padding: 8px 11px;
  font-family: inherit; font-size: 13px; line-height: 1.5;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border2); border-radius: var(--radius);
  outline: none; transition: var(--transition);
  appearance: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,125,216,.12); }
.form-control::placeholder { color: var(--text3); }
.form-control:disabled, .form-control[readonly] { background: var(--surface2); color: var(--text2); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3e%3cpath fill='%238a94a6' d='M0 0l5 6 5-6z'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
}
.form-control-sm { padding: 5px 9px; font-size: 12px; }
.form-control-static { padding-top: 7px; margin-bottom: 0; color: var(--text); }
.form-label, .col-form-label { display: inline-block; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: var(--text2); }
.form-inline { display: flex; flex-flow: row wrap; align-items: center; gap: 8px; }
.form-text { font-size: 12px; color: var(--text3); }
.invalid-feedback { display: none; width: 100%; margin-top: 4px; font-size: 12px; color: var(--red); }
.invalid-feedback.d-block { display: block; }
.form-control.is-invalid { border-color: var(--red); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(198,40,40,.12); }

/* Input groups */
.input-group { position: relative; display: flex; flex-wrap: wrap; align-items: stretch; width: 100%; }
.input-group > .form-control { position: relative; flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group-prepend, .input-group-append { display: flex; }
.input-group-prepend { margin-right: -1px; }
.input-group-append { margin-left: -1px; }
.input-group > .form-control:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group > .form-control:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group-text {
  display: flex; align-items: center; padding: 6px 11px;
  font-size: 13px; color: var(--text2); text-align: center; white-space: nowrap;
  background: var(--surface2); border: 1px solid var(--border2);
}
.input-group-prepend .input-group-text { border-radius: var(--radius) 0 0 var(--radius); }
.input-group-append .btn, .input-group-append .input-group-text { border-radius: 0 var(--radius) var(--radius) 0; }
.input-group-append > .btn { border-left: 0; }

.custom-file, .custom-select { display: block; width: 100%; }
.input-group-sm > .form-control, .input-group-sm > .input-group-append > .btn,
.input-group-sm > .input-group-append > .input-group-text { padding: 5px 9px; font-size: 12px; }

/* Custom checkbox / radio (Bootstrap 4 custom-control) */
.custom-control { position: relative; display: block; min-height: 1.4rem; padding-left: 1.6rem; }
.custom-control-input { position: absolute; left: 0; z-index: -1; width: 1rem; height: 1.15rem; opacity: 0; }
.custom-control-label { position: relative; margin-bottom: 0; cursor: pointer; font-size: 13px; color: var(--text2); }
.custom-control-label::before {
  content: ""; position: absolute; top: .1rem; left: -1.6rem; width: 1.05rem; height: 1.05rem;
  background: var(--surface); border: 1px solid var(--border2); border-radius: 4px;
}
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before,
.custom-radio .custom-control-input:checked ~ .custom-control-label::before { background: var(--accent); border-color: var(--accent); }
.custom-control-label::after {
  content: ""; position: absolute; top: .1rem; left: -1.6rem; width: 1.05rem; height: 1.05rem;
  background-repeat: no-repeat; background-position: center; background-size: 62%;
}
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e");
}
.custom-radio .custom-control-label::before { border-radius: 50%; }
.custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 3px rgba(59,125,216,.15); }

/* Cards (base; the design system prefers .form-panel / .summary-panel) */
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.card-header { padding: 12px 16px; background: var(--surface2); border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; font-weight: 700; color: var(--text); }
.card-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.card-body { flex: 1 1 auto; padding: 16px; }
.card-footer { padding: 12px 16px; background: var(--surface2); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }

/* ── Buttons (base; colour variants in modern-theme.css) ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 14px; border-radius: var(--radius);
  font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.4;
  color: var(--text2); background: var(--surface);
  border: 1px solid var(--border2); cursor: pointer;
  white-space: nowrap; text-decoration: none; transition: var(--transition);
  -webkit-user-select: none; user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(59,125,216,.15); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-lg { padding: 10px 18px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-group { display: inline-flex; }
.btn-tool { background: transparent; border: none; color: var(--text3); padding: 4px 8px; }

/* ── Tables (base; .dt styled in modern-theme.css) ─────── */
.table { width: 100%; margin-bottom: 16px; border-collapse: collapse; font-size: 13px; color: var(--text2); }
.table th, .table td { padding: 9px 12px; vertical-align: middle; border-top: 1px solid var(--border); text-align: left; }
.table thead th { vertical-align: bottom; border-bottom: 1px solid var(--border); background: var(--surface2); font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--bg); }
.table-sm th, .table-sm td { padding: 6px 9px; }
.table-bordered, .table-bordered th, .table-bordered td { border: 1px solid var(--border); }
.table-striped tbody tr:nth-of-type(odd) { background: var(--surface2); }
.table-responsive { display: block; width: 100%; overflow-x: auto; }

/* ── Badges (base; colour variants in modern-theme.css) ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  background: var(--surface2); color: var(--text2);
}

/* ── Alerts (base; colour variants in modern-theme.css) ── */
.alert { position: relative; padding: 12px 16px; margin-bottom: 16px; border: 1px solid transparent; border-radius: var(--radius); font-size: 13px; }
.alert h5 { margin: 0 0 4px; font-size: 14px; }
.alert-dismissible { padding-right: 40px; }
.alert-dismissible .close { position: absolute; top: 0; right: 0; padding: 12px 16px; color: inherit; background: none; border: none; font-size: 18px; line-height: 1; cursor: pointer; opacity: .6; }
.alert-dismissible .close:hover { opacity: 1; }
.close { float: right; font-size: 20px; font-weight: 700; line-height: 1; color: var(--text3); background: transparent; border: 0; cursor: pointer; }

/* ── Progress ─────────────────────────────────────────── */
.progress { display: flex; height: 18px; overflow: hidden; font-size: 11px; background: var(--surface2); border-radius: var(--radius); }
.progress-bar { display: flex; flex-direction: column; justify-content: center; color: #fff; text-align: center; white-space: nowrap; }
.progress-bar.bg-primary { background: var(--accent); }
.progress-bar.bg-warning { background: var(--gold); }
.progress-bar.bg-danger  { background: var(--red); }
.progress-bar.bg-dark    { background: var(--text2); }
.progress-bar.bg-success { background: var(--green); }

/* ── List group ───────────────────────────────────────── */
.list-group { display: flex; flex-direction: column; padding-left: 0; margin-bottom: 0; list-style: none; }
.list-group-item { position: relative; display: block; padding: 11px 16px; background: var(--surface); border: 1px solid var(--border); }
.list-group-item + .list-group-item { border-top-width: 0; }
.list-group-flush .list-group-item { border-right: 0; border-left: 0; border-radius: 0; }
.list-group-flush .list-group-item:first-child { border-top: 0; }

/* ── Modal (works with Bootstrap 4 JS toggling) ────────── */
.modal { position: fixed; inset: 0; z-index: 1055; display: none; overflow: hidden; outline: 0; }
.modal.fade .modal-dialog { transition: transform .2s ease-out; transform: translateY(-30px); }
.modal.show .modal-dialog { transform: none; }
.modal-open { overflow: hidden; }
.modal-dialog { position: relative; width: auto; margin: 1.75rem auto; max-width: 520px; pointer-events: none; }
.modal-dialog-centered { display: flex; align-items: center; min-height: calc(100% - 3.5rem); }
.modal-lg { max-width: 800px; }
.modal-sm { max-width: 340px; }
.modal-content {
  position: relative; display: flex; flex-direction: column; width: 100%;
  pointer-events: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); outline: 0;
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface2); border-radius: var(--radius) var(--radius) 0 0; }
.modal-title { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.4; }
.modal-body { position: relative; flex: 1 1 auto; padding: 18px; }
.modal-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface2); border-radius: 0 0 var(--radius) var(--radius); }
.modal-backdrop { position: fixed; inset: 0; z-index: 1050; background: #000; }
.modal-backdrop.fade { opacity: 0; transition: opacity .15s linear; }
.modal-backdrop.show { opacity: .45; }

/* ── Pagination (Laravel ->links() Bootstrap markup) ───── */
.pagination { display: flex; flex-wrap: wrap; padding-left: 0; margin: 0; list-style: none; gap: 3px; }
.page-item .page-link {
  display: block; padding: 6px 11px; font-size: 13px; line-height: 1.4;
  color: var(--accent); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none;
  transition: var(--transition);
}
.page-item .page-link:hover { background: var(--accent-bg); border-color: var(--accent-bd); }
.page-item.active .page-link { color: #fff; background: var(--accent); border-color: var(--accent); }
.page-item.disabled .page-link { color: var(--text3); pointer-events: none; background: var(--surface2); }
.pagination svg { width: 15px; height: 15px; vertical-align: text-bottom; }

/* ── Media object ─────────────────────────────────────── */
.media { display: flex; align-items: flex-start; }
.media-body { flex: 1; }
.img-circle, .rounded-circle { border-radius: 50%; }
.img-fluid { max-width: 100%; height: auto; }

/* ── Utilities ────────────────────────────────────────── */
/* display */
.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}
.d-block{display:block!important}.d-flex{display:flex!important}.d-inline-flex{display:inline-flex!important}
@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-flex{display:flex!important}}
@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-flex{display:flex!important}}
@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-block{display:block!important}.d-lg-flex{display:flex!important}}
@media print{.d-print-none{display:none!important}.d-print-block{display:block!important}}

/* flex */
.flex-row{flex-direction:row!important}.flex-column{flex-direction:column!important}
.flex-wrap{flex-wrap:wrap!important}.flex-fill{flex:1 1 auto!important}.flex-grow-1{flex-grow:1!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}
.align-items-start{align-items:flex-start!important}.align-items-center{align-items:center!important}
.align-items-end{align-items:flex-end!important}.align-self-center{align-self:center!important}

/* spacing (Bootstrap scale: 0=.0, 1=.25, 2=.5, 3=1, 4=1.5, 5=3 rem) */
.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}.m-auto{margin:auto!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}
.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-auto{margin-left:auto!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-auto{margin-right:auto!important}
.mx-auto{margin-left:auto!important;margin-right:auto!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:1rem!important;margin-bottom:1rem!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}
.pt-2{padding-top:.5rem!important}.pt-3{padding-top:1rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:1rem!important}
.pl-3{padding-left:1rem!important}.pr-3{padding-right:1rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}

/* text */
.text-left{text-align:left!important}.text-center{text-align:center!important}.text-right{text-align:right!important}
.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.text-muted{color:var(--text3)!important}.text-danger{color:var(--red)!important}.text-success{color:var(--green)!important}
.text-warning{color:var(--gold)!important}.text-primary{color:var(--accent)!important}.text-info{color:var(--accent)!important}
.text-dark{color:var(--text)!important}.text-white{color:#fff!important}.text-secondary{color:var(--text3)!important}
.text-sm{font-size:12px!important}.small,small{font-size:85%}
.font-weight-bold{font-weight:700!important}.font-weight-normal{font-weight:400!important}.font-italic{font-style:italic!important}
.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}
.h4{font-size:18px;font-weight:700}.h5{font-size:15px;font-weight:700}.h6{font-size:13px;font-weight:700}

/* sizing */
.w-100{width:100%!important}.w-75{width:75%!important}.w-50{width:50%!important}.w-25{width:25%!important}.w-auto{width:auto!important}
.h-100{height:100%!important}.mw-100{max-width:100%!important}

/* float / misc */
.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}
.clearfix::after{display:block;clear:both;content:""}
.list-unstyled{padding-left:0;list-style:none;margin-bottom:0}
.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}
.rounded{border-radius:var(--radius)!important}.rounded-circle{border-radius:50%!important}
.border{border:1px solid var(--border)!important}.border-0{border:0!important}.border-bottom{border-bottom:1px solid var(--border)!important}
.bg-light{background:var(--surface2)!important}.bg-white{background:var(--surface)!important}
.shadow-sm{box-shadow:var(--shadow-sm)!important}.shadow{box-shadow:var(--shadow)!important}
.position-relative{position:relative!important}.position-absolute{position:absolute!important}
.overflow-hidden{overflow:hidden!important}.overflow-auto{overflow:auto!important}
.align-middle{vertical-align:middle!important}
.font-weight-light{font-weight:300!important}
