:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #fff;
  --text: #19202b;
  --muted: #737d8d;
  --border: #e4e7ec;
  --accent: #5367e8;
  --side: #fff
}

html[data-theme=dark] {
  color-scheme: dark;
  --bg: #101217;
  --panel: #191c24;
  --text: #f1f3f7;
  --muted: #969dab;
  --border: #2b303b;
  --accent: #8290ff;
  --side: #151820
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 'Inter', Helvetica, Arial, sans-serif;
}

a {
  color: var(--accent);
  text-decoration: none
}

.shell {
  display: flex;
  min-height: 100vh
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--side);
  border-right: 1px solid var(--border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px
}

.brand {
  font-size: 19px;
  font-weight: 800;
 
}

.brand span {
  color: var(--muted);
  font-weight: 400
}

.sidebar nav {
  display: grid;
  gap: 0
}

.sidebar nav a {
  padding: 11px 14px;
  color: var(--text);
  border-radius: 8px
}

.sidebar nav a:hover {
  background: var(--bg)
}

.sidebar-bottom {
  margin-top: auto;
  display: grid;
  gap: 10px
}

.content {
  flex: 1;
  min-width: 0;
  padding: 32px;
  max-width: 1500px
}

.topbar {
  margin-bottom: 25px
}

.topbar h1 {
  font-size: 28px;

  margin: 0
}

.card,
.login-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 25px
}

.card h2 {
  margin-top: 0;
  font-size: 18px
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px
}

.stats .card {
  display: grid;
  gap: 10px
}

.stats strong {
  font-size: 29px;

}

.muted,
small {
  color: var(--muted)
}

button {
  background: var(--accent);
  border: 0;
  border-radius: 7px;
  padding: 11px 16px;
  color: white;
    font-family: 'Inter', Helvetica, Arial, sans-serif;
 display: inline-block;
  margin: 15px 10px 0 0; 
  cursor: pointer
}

button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border)
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600
}

input,
textarea,
select {
  width: 100%;
  padding: 11px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: 16px 'Inter', Helvetica, Arial, sans-serif;
}

.inline {
  display: flex;
  align-items: center;
  gap: 9px
}

.inline input {
  width: auto
}

.settings-form {
  display: grid;
  gap: 20px
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px
}

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px
}

.login-card {
  width: min(100%, 420px)
}

.login-card form {
  display: grid;
  gap: 17px
}

.error {
  color: #d34c5c
}

.notice {
  background: var(--panel);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px
}

@media(max-width:760px) {
  .shell {
    display: block
  }
  .sidebar {
    width: auto;
    padding: 16px;
    gap: 14px
  }
  .sidebar nav {
    display: flex;
    overflow: auto
  }
  .sidebar nav a {
    white-space: nowrap
  }
  .sidebar-bottom {
    display: flex
  }
  .content {
    padding: 18px
  }
  .stats,
  .fields {
    grid-template-columns: 1fr
  }
}

.table-wrap {
  overflow-x: auto
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0
}

.data-table th,
.data-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border, #8884)
}

.data-table th {
  white-space: nowrap
}

.inline-form,
.invoice-actions form {
  display: inline-block;
  margin: 0
}

.inline-form button {
  padding: 7px 10px
}

.section-head,
.builder-actions,
.invoice-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between
}

.builder-actions {
  justify-content: flex-start;
  margin: 15px 0
}

.btn-link {
  display: inline-block;
  padding: 10px 15px;
  border-radius: 6px;
  background: var(--accent, #4e73df);
  color: white;
  text-decoration: none
}

.invoice-builder input {
  min-width: 80px;
  width: 100%;
  box-sizing: border-box
}

.invoice-builder .desc {
  min-width: 180px
}

.totals {
  text-align: right;
  margin: 22px 0
}

.invoice-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 35px
}

@media(max-width:650px) {
  .invoice-head {
    grid-template-columns: 1fr
  }
  .data-table {
    font-size: 13px
  }
}

.rich-editor {
  border: 1px solid var(--border, #667085);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 6px
}

.rich-toolbar {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 8px;
  border-bottom: 1px solid var(--border, #667085)
}

.rich-toolbar button {
  padding: 5px 9px;
  font-size: 12px
}

.rich-content {
  min-height: 130px;
  padding: 14px;
  outline: none;
  line-height: 1.55
}

.rich-content:focus {
  box-shadow: inset 0 0 0 1px currentColor
}

.rich-content p {
  margin: 0 0 8px
}

.rich-content ul,
.rich-content ol {
  padding-left: 25px
}

/* Isolate the rich text widget from adjacent form fields */

.fields>label {
  align-content: start;
  align-self: start;
  min-width: 0
}

.fields>label>input,
.fields>label>select {
  height: 44px
}

.fields>label>.rich-editor {
  width: 100%;
  min-width: 0
}

.rich-toolbar .heading-picker {
  width: auto;
  min-width: 125px;
  padding: 5px;
  font-size: 12px
}

.invoice-address p,
.invoice-address div {
  margin: 0 0 3px
}

.invoice-address h2,
.invoice-address h3,
.invoice-address h4,
.invoice-address h5,
.invoice-address h6 {
  margin: 4px 0
}

.rich-content h2,
.rich-content h3,
.rich-content h4 {
  margin: 6px 0
}

/* Logo cropping modal */

.logo-crop-modal[hidden] {
  display: none !important
}

.logo-crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px
}

.logo-crop-panel {
  background: var(--card, #fff);
  color: var(--text, #222);
  border-radius: 12px;
  padding: 24px;
  width: min(100%, 420px)
}

.logo-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px
}

#logo-dropzone {
  min-height: 110px;
  cursor: pointer;
  border: 2px dashed #8b95a6;
  border-radius: 10px;
  padding: 24px;
  text-align: center
}

/* Contact address occupies the left column; town/postcode/country stack on right. */

.fields:has(.contact-address-editor) {
  align-items: start;
}

.contact-address-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.contact-address-side label {
  display: block;
}

@media(max-width:700px) {
  .contact-address-side {
    grid-column: 1/-1;
  }
}

/* Dashboard */

.dashboard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px
}

.dashboard-subtitle {
  margin: 0
}

.dashboard-controls {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap
}

.dashboard-controls form {
  display: flex;
  gap: 10px
}

.dashboard-controls label {
  font-size: 11px;
  min-width: 120px
}

.dashboard-controls select {
  padding: 9px 10px
}

.dashboard-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr))
}

.dashboard-stats .card {
  min-width: 0
}

.dashboard-stats strong {
  font-size: clamp(20px, 2vw, 29px);
  overflow-wrap: anywhere
}

.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px
}

.dashboard-chart {
  min-height: 300px
}

.dashboard-chart-short {
  min-height: 220px
}

.dashboard-invoiced {
  margin-bottom: 18px
}

.dashboard-note {
  margin: 4px 0 0;
  font-size: 13px
}

.dashboard-table .amount {
  text-align: right;
  white-space: nowrap
}

.status-pill {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap
}

.status-overdue {
  background: #fce7e7;
  color: #a92b37
}

.status-sent {
  background: #e7efff;
  color: #2b59a9
}

html[data-theme=dark] .status-overdue {
  background: #46242a;
  color: #ffb4bd
}

html[data-theme=dark] .status-sent {
  background: #22344f;
  color: #b2d0ff
}

@media(max-width:1150px) {
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media(max-width:900px) {
  .dashboard-charts {
    grid-template-columns: 1fr
  }
}

@media(max-width:600px) {
  .dashboard-stats {
    grid-template-columns: 1fr
  }
  .dashboard-controls,
  .dashboard-controls form {
    width: 100%
  }
  .dashboard-controls form label {
    flex: 1
  }
  .dashboard-top .btn-link {
    width: 100%;
    text-align: center
  }
}



.brand-logo {
  width: 140px;
  height: auto;
  display: block;
  margin: 0 0 0 15px;
}


      .st0 {
        fill: #26a856;
      }

      .st1 {
        fill: #0d0d0d;
      }


html[data-theme=dark] .st0 {
        fill: #26a856;
      }

html[data-theme=dark] .st1 {
        fill: #ffffff;
      }
/* Global search, pagination and notifications */
.top-search,.list-search,.pagination{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.top-search{margin-left:auto}.top-search input,.list-search input{min-width:220px}.pagination{margin-top:16px}.pagination .current{font-weight:700;text-decoration:underline}.toast-host{position:fixed;right:20px;bottom:20px;z-index:99999;display:grid;gap:10px;max-width:min(400px,calc(100vw - 40px))}.app-toast{background:#20242b;color:white;padding:14px 18px;border-radius:8px;box-shadow:0 8px 30px #0003;overflow-wrap:anywhere;border-left:4px solid #137fec}.app-toast.success{border-left-color:#26a856}.app-confirm{border:1px solid #d7dce5;border-radius:12px;padding:24px;max-width:440px;width:calc(100% - 32px);background:var(--card,#fff);color:var(--text,#20242b)}.app-confirm::backdrop{background:#0008}.confirm-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px}@media(max-width:850px){.top-search{width:100%;margin:12px 0 0}.top-search input{min-width:0;flex:1}}
