/* ===========================================================================
   Screens written for the old layout, wearing the new clothes.

   Several screens still use the old class names: .card without a header,
   .admin-table, .filters, .form-grid, .btn.secondary, .badge-posted and so on.
   Rather than leave the application looking like two products while those are
   converted one at a time, this maps the old names onto the new look. When a
   screen is rewritten it simply stops using these classes; nothing here has to
   be unpicked.
   =========================================================================== */

/* The compatibility layer must never reach into the shell. */
.vc-sidebar a, .vc-topbar a { text-decoration: none; }

/* Cards and panels. */
/* Only an old-style card, one written as a bare box with an h2 and content,
   is padded here. A card built from .card-header and .card-body carries its
   own padding; padding it again pushed every header, list and table 16px in
   from the card edge, which is why the dashboard rows and the card titles
   never lined up. */
.vc-page .card, .vc-page .panel {
  background: var(--vc-surface);
  border: 1px solid var(--vc-line);
  border-radius: var(--vc-radius);
  box-shadow: 0 1px 2px rgba(13, 35, 64, .04);
}
.vc-page .card:not(:has(> .card-header, > .card-body, > .table-responsive, > .list-group, > .box-grid, > .vc-deadline-grid)),
.vc-page .panel {
  padding: 16px;
  margin-bottom: 14px;
}
.vc-page .card > h2, .vc-page .panel > h2 {
  font-size: 14px; font-weight: 700; color: var(--vc-text);
  border-bottom: 1px solid var(--vc-line-soft); padding-bottom: 9px; margin: 0 0 13px;
}
.vc-page h2 { font-size: 15px; font-weight: 700; margin: 22px 0 11px; }

/* The old tables. */
.vc-page .table-wrap {
  background: var(--vc-surface); border: 1px solid var(--vc-line);
  border-radius: var(--vc-radius); overflow-x: auto; margin-bottom: 14px;
  max-width: 100%; -webkit-overflow-scrolling: touch;
}
.vc-page .admin-table, .vc-page .status-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.vc-page .admin-table th, .vc-page .status-table th {
  background: #fafcff; text-align: left; padding: 10px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--vc-muted); border-bottom: 1px solid var(--vc-line); white-space: nowrap;
}
.vc-page .admin-table td, .vc-page .status-table td { padding: 9px 12px; border-bottom: 1px solid var(--vc-line-soft); }
.vc-page .admin-table tr:last-child td { border-bottom: 0; }
.vc-page .admin-table tr:hover td { background: #f7fafe; }
.vc-page .admin-table tfoot td { background: #f5f9ff; border-top: 1px solid var(--vc-line); font-weight: 700; }
.vc-page .num { text-align: right; font-variant-numeric: tabular-nums; }
.vc-page .mono, .vc-page .font-monospace { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.vc-page .muted, .vc-page .small.muted { color: var(--vc-muted); }
.vc-page .small { font-size: 12px; }

/* Filters and form grids. */
.vc-page .filters {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: var(--vc-surface); border: 1px solid var(--vc-line);
  border-radius: var(--vc-radius); padding: 12px 14px; margin-bottom: 14px;
}
.vc-page .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.vc-page .field-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.vc-page label { display: block; font-size: 12px; font-weight: 600; color: #38496a; margin-bottom: 4px; }
.vc-page label.choice, .vc-page label > input[type=checkbox], .vc-page label > input[type=radio] { font-weight: 400; }
.vc-page input[type=text], .vc-page input[type=email], .vc-page input[type=password],
.vc-page input[type=number], .vc-page input[type=search], .vc-page input[type=date],
.vc-page select, .vc-page textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid #d8e0ec; border-radius: 9px; padding: .45rem .7rem;
  font-size: 12px; font-family: inherit; background-color: #fff; color: var(--vc-text);
  min-height: 38px;
}

/* Every dropdown on every screen, old markup or new, carries the same chevron
   so it can be told from a text box before it is clicked. The shorthand
   background was wiping the arrow out, which is why they looked alike. */
.vc-page select, .vc-page .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237b8ca6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 15px 15px;
  padding-right: 2rem;
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer;
}
.vc-page select:hover, .vc-page .form-select:hover { border-color: #c3d0e2; }
.vc-page select:disabled, .vc-page .form-select:disabled {
  background-color: #f3f6fa; color: var(--vc-muted); cursor: not-allowed;
}
.vc-page .form-select-sm { background-position: right .5rem center; background-size: 13px 13px; padding-right: 1.7rem; min-height: 32px; }
.vc-page .dataTables_length select { min-height: 30px; padding-right: 1.7rem; background-position: right .45rem center; background-size: 12px 12px; }
.vc-page input:focus, .vc-page select:focus, .vc-page textarea:focus {
  outline: none; border-color: var(--vc-cyan); box-shadow: 0 0 0 3px rgba(30, 136, 200, .14);
}

/* The buttons are defined once, in theme.css. Nothing about them is set here,
   because this file loads last and would quietly win every argument. */
.vc-page form.inline, .vc-page .inline { display: inline; }

/* Badges become pills. */
.vc-page .badge {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: #eef2f8; color: #52637f;
}
.vc-page .badge-paid, .vc-page .badge-matched { background: #e7f7ef; color: #0f7a4a; }
.vc-page .badge-posted { background: var(--vc-cyan-100); color: #14618f; }
.vc-page .badge-draft { background: #eef2f8; color: #52637f; }
.vc-page .badge-void, .vc-page .badge-unmatched { background: #fdecec; color: #b42318; }

/* Notices. */
/* Only a notice with no Bootstrap colour of its own is painted here, or this
   would repaint the green and red ones the shell prints. */
.vc-page .alert:not([class*="alert-"]), .vc-page .flash {
  border-radius: var(--vc-radius); padding: 11px 14px; margin-bottom: 14px;
  font-size: 12px; border: 1px solid var(--vc-line); background: #f7fafe; color: var(--vc-text);
}
.vc-page .alert.error, .vc-page .error-box { background: #fdecec; border-color: #f6cdcd; color: #8a1c1c; }
.vc-page .alert.success, .vc-page .success-box { background: #e9f8f0; border-color: #c7ecd9; color: #0f5c3a; }

/* The old tab strips, including the settings and import ones. */
.vc-page .tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--vc-line); margin-bottom: 14px; }
.vc-page .tabs a {
  padding: 8px 13px; font-size: 12px; font-weight: 600; color: var(--vc-muted);
  text-decoration: none; border-bottom: 2px solid transparent;
}
.vc-page .tabs a.active { color: var(--vc-cyan); border-bottom-color: var(--vc-cyan); }
.vc-page .tabs a:hover { color: var(--vc-navy-2); }

/* The VAT return boxes keep their one-per-row reading. */
.vc-page .box-grid { background: #fff; border: 1px solid var(--vc-line); border-radius: var(--vc-radius); overflow: hidden; }
.vc-page .box { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--vc-line-soft); }
.vc-page .box:last-child { border-bottom: 0; }
.vc-page .box .no {
  background: var(--vc-navy); color: #fff; border-radius: 7px; padding: 4px 8px;
  font-size: 12px; font-weight: 700; min-width: 44px; text-align: center;
}
.vc-page .box .name { flex: 1; font-size: 12.5px; }
.vc-page .box .amt { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vc-page .box.total { background: #f2f7ff; }

/* Old KPI tiles. */
.vc-page .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; margin-bottom: 14px; }
.vc-page .kpi {
  background: #fff; border: 1px solid var(--vc-line); border-radius: var(--vc-radius);
  padding: 13px 15px; box-shadow: 0 1px 2px rgba(13, 35, 64, .04);
}
.vc-page .kpi .label { font-size: 10px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--vc-muted); }
.vc-page .kpi .value { font-size: 20px; font-weight: 600; margin-top: 4px; }
.vc-page .pos { color: #0f7a4a; }
.vc-page .neg { color: #b42318; }

/* Pagination controls are <button> elements, so the rule for old-markup buttons
   above would otherwise paint them. They keep the soft pagination treatment. */
/* DataTables injects its own styles at runtime, after every stylesheet, so this
   one states itself firmly rather than losing the cascade to a script. */
.vc-page .page-link, .vc-page button.page-link {
  background: #eef3f9 !important; color: #40526e; border: 0; border-radius: 8px;
  min-height: 30px; padding: .3rem .6rem; font-size: 12px; font-weight: 600;
}
.vc-page .page-link:hover, .vc-page button.page-link:hover { background: var(--vc-cyan-100); color: #12628f; }
.vc-page .page-item.active .page-link, .vc-page .dt-paging-button.active .page-link {
  background: var(--vc-cyan-100) !important; color: #12628f;
}
.vc-page .page-item.disabled .page-link, .vc-page .dt-paging-button.disabled .page-link {
  background: #f5f7fb !important; color: #b6c2d3;
}

/* Choices draws its own arrow as a CSS triangle; replaced with the same
   chevron the plain dropdowns use, so two fields side by side match. */
.vc-page .choices[data-type*="select-one"]::after {
  content: ""; border: 0; height: 15px; width: 15px; margin-top: -7px; right: 11px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237b8ca6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat center / 15px 15px;
  transition: transform .12s ease;
}
.vc-page .choices[data-type*="select-one"].is-open::after { transform: rotate(180deg); }

/* Tick boxes and radio buttons take the accent colour and one size, whether
   they were written with Bootstrap's class or as plain inputs. */
.vc-page input[type=checkbox], .vc-page input[type=radio] {
  width: 16px; height: 16px; min-height: 0; accent-color: var(--vc-cyan);
  vertical-align: -2px; cursor: pointer;
}
.vc-page label.choice {
  display: flex; align-items: flex-start; gap: 8px; font-size: 12px; font-weight: 400;
  color: var(--vc-text); margin-bottom: 7px; cursor: pointer; line-height: 1.45;
}
.vc-page label.choice input { flex: 0 0 auto; margin-top: 2px; }
/* A switch keeps its pill shape; the square tick-box size above is not for it. */
.vc-page .form-switch .form-check-input {
  width: 2.1em; height: 1.15em; margin: 0; float: none; vertical-align: middle;
  border-radius: 2em; border: 1px solid #c2cddd; background-color: #e9eef5; cursor: pointer;
}
.vc-page .form-switch .form-check-input:checked { background-color: var(--vc-cyan); border-color: var(--vc-cyan); }
.vc-page .form-switch { display: inline-flex; align-items: center; gap: 8px; padding-left: 0; }
/* Bootstrap paints fields with the page background; fields are white. */
.vc-page .form-control, .vc-page .form-select, .vc-page textarea { background-color: #fff; }
.vc-page .form-control:disabled, .vc-page .form-control[readonly] { background-color: #f7f9fc; }
/* A field and its unit stay on one line. */
.vc-page .input-group { flex-wrap: nowrap; }
.vc-page .input-group > .form-control, .vc-page .input-group > input { width: 1%; flex: 1 1 auto; min-width: 0; }
.vc-page .input-group > .input-group-text { font-size: 12px; color: var(--vc-muted); background: #f6f9fd; border-color: #d8e0ec; }
