:root {
  color-scheme: light;
  --ink: #172554;
  --muted: #748198;
  --line: #e7ebf2;
  --blue: #2563eb;
  --pale: #eff6ff;
  --canvas: #f5f7fb;
  --green: #15956b;
  --shadow: 0 12px 34px rgb(22 34 58 / 5%);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: #23304a;
  font-family: Tahoma, Arial, sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.page-view { display: none; }
.page-view.active-page { display: block; animation: page-in .18s ease-out; }
@keyframes page-in { from { opacity: .7; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.page { width: min(100% - 36px, 1440px); margin: 30px auto; }
.brand { display: flex; align-items: center; gap: 13px; margin: 0 0 22px 4px; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 15px; background: var(--ink); color: white; font-size: 23px; font-weight: 700; }
.brand h1, h2, p { margin-top: 0; }
.brand h1 { margin-bottom: 0; color: var(--ink); font-size: 23px; }
.eyebrow { margin-bottom: 7px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .2px; }
.muted, .hint { color: var(--muted); font-size: 13px; line-height: 1.8; }
.card { min-width: 0; margin-bottom: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow); }
.card h2 { margin-bottom: 9px; color: var(--ink); font-size: 18px; }
.auth-card { max-width: 450px; margin: 58px auto; padding: 32px; }
.auth-card h2 { font-size: 23px; }
label:not(.drop-area):not(.avatar-edit) { display: block; margin: 16px 0 7px; color: #394660; font-size: 13px; font-weight: 700; }
input:not([type="file"]):not([type="checkbox"]):not([type="color"]), select {
  width: 100%; min-height: 44px; padding: 11px 13px; border: 1px solid #dfe5ee; border-radius: 9px;
  outline: none; background: #fff; color: inherit; transition: border-color .16s, box-shadow .16s;
}
input:focus, select:focus { border-color: var(--blue) !important; box-shadow: 0 0 0 3px rgb(37 99 235 / 13%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 13%, transparent); }
button:focus-visible, a:focus-visible { outline: 3px solid rgb(37 99 235 / 45%); outline-offset: 2px; }
input[readonly] { background: #f5f7fb !important; color: var(--muted) !important; cursor: not-allowed; }
input[type="color"] { display: block; width: 100%; height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: white; }
button[type="submit"], .button-primary {
  min-height: 43px; padding: 11px 17px; border: 0; border-radius: 9px; background: var(--blue);
  color: #fff; font-weight: 700; transition: transform .16s, background .16s, box-shadow .16s;
}
button[type="submit"]:hover, .button-primary:hover { transform: translateY(-1px); box-shadow: 0 7px 17px color-mix(in srgb, var(--blue) 22%, transparent); }
#authForm > button[type="submit"], #uploadForm > button[type="submit"] { width: 100%; margin-top: 15px; }
button:disabled { cursor: wait; opacity: .65; }
.message { min-height: 20px; margin: 10px 0 0; font-size: 13px; }
.message.error { color: #b42332; }
.message.success { color: #15803d; }
.hint { margin: 6px 0 0; font-size: 12px; }

.workspace { display: grid; grid-template-columns: 235px minmax(0, 1fr); direction: rtl; min-height: 760px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--canvas); box-shadow: var(--shadow); }
.sidebar { display: flex; flex-direction: column; min-height: 100%; padding: 23px 15px 17px; border-left: 1px solid var(--line); background: #fff; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 24px; border-bottom: 1px solid #edf0f5; }
.sidebar-brand .brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; font-size: 19px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { overflow: hidden; max-width: 145px; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand span { margin-top: 4px; color: #9aa4b5; font-size: 11px; }
.side-nav { padding-top: 23px; }
.side-nav > p { margin: 0 10px 9px; color: #9aa4b5; font-size: 10px; font-weight: 700; }
.side-nav > p:not(:first-child) { margin-top: 25px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 42px; margin: 4px 0; padding: 0 11px; border-radius: 9px; color: #69758b; font-size: 12px; text-decoration: none; transition: .16s; }
.nav-link span { display: grid; width: 20px; place-items: center; color: #8c98ab; font-size: 17px; }
.nav-link:hover { background: #f6f8fc; color: var(--ink); }
.nav-link.active { background: var(--pale); color: var(--blue); font-weight: 700; }
.nav-link.active span { color: var(--blue); }
.sidebar-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding: 14px 8px 0; border-top: 1px solid #edf0f5; color: var(--muted); font-size: 10px; }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: #27ae80; box-shadow: 0 0 0 3px #e8f7f1; }
.workspace-main { min-width: 0; padding: 25px clamp(18px, 3vw, 40px) 25px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.topbar .eyebrow { margin-bottom: 4px; }
.topbar h1 { margin: 0; color: var(--ink); font-size: 22px; }
.profile-tools { display: flex; align-items: center; gap: 10px; }
.profile-copy strong, .profile-copy span { display: block; }
.profile-copy strong { color: var(--ink); font-size: 12px; }
.profile-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.avatar-form { margin: 0; }
.avatar-edit { position: relative; display: block; width: 43px; height: 43px; cursor: pointer; }
.avatar-image, .avatar-placeholder { display: grid; width: 43px; height: 43px; place-items: center; overflow: hidden; border: 2px solid #fff; border-radius: 50%; background: #e8efff; color: var(--blue); object-fit: cover; font-size: 15px; font-weight: 700; box-shadow: 0 0 0 1px var(--line); }
.avatar-edit > .avatar-image, .avatar-edit > .avatar-placeholder { position: absolute; inset: 0; }
.avatar-edit > span:last-child { position: absolute; right: -3px; bottom: -3px; display: grid; width: 18px; height: 18px; place-items: center; border: 2px solid #fff; border-radius: 50%; background: var(--blue); color: #fff; font-size: 10px; }
.button-secondary { min-height: 36px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 700; white-space: nowrap; }
.button-secondary:hover { border-color: #ccd5e2; background: #f8fafc; }
.welcome { position: relative; display: flex; min-height: 155px; align-items: center; justify-content: space-between; overflow: hidden; border: 0; background: var(--blue); background: linear-gradient(110deg, color-mix(in srgb, var(--blue) 65%, #10244e), color-mix(in srgb, var(--blue) 88%, #294477) 70%, var(--blue)); color: #fff; }
.welcome .eyebrow { color: #b9d1ff; }
.welcome h2 { margin: 0 0 8px; color: #fff; font-size: 23px; }
.welcome .muted { max-width: 550px; margin-bottom: 0; color: #d3def3; }
.welcome-art { position: relative; width: 125px; height: 110px; flex: 0 0 125px; opacity: .9; }
.welcome-art::before, .welcome-art::after { position: absolute; content: ""; border: 1px solid rgb(255 255 255 / 27%); border-radius: 50%; }
.welcome-art::before { inset: 3px 4px 0 18px; }
.welcome-art::after { inset: 19px 21px 13px 0; }
.welcome-art span { position: absolute; z-index: 1; top: 21px; right: 43px; color: #f8d987; font-size: 25px; }
.welcome-art i, .welcome-art b { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #9fc2ff; }
.welcome-art i { top: 2px; right: 22px; }
.welcome-art b { bottom: 8px; left: 18px; width: 5px; height: 5px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.finance-summary-grid { margin-top: 20px; }
.stat-card { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 3px 11px; min-height: 95px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 5px 16px rgb(22 34 58 / 3%); }
.stat-icon { display: grid; width: 37px; height: 37px; grid-row: span 3; place-items: center; border-radius: 11px; font-size: 17px; }
.stat-icon.blue { background: #edf3ff; color: var(--blue); }
.stat-icon.green { background: #eaf8f1; color: var(--green); }
.stat-icon.amber { background: #fff6e6; color: #c88313; }
.stat-label { color: var(--muted); font-size: 10px; }
.stat-card strong { color: var(--ink); font-size: 21px; line-height: 1.1; }
.stat-card small { color: #a0a9b8; font-size: 9px; }
.content-section { scroll-margin-top: 18px; }
.bank-account-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 13px; }
.bank-account-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff; }
.bank-account-card strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; }
.bank-account-card p { margin: 5px 0 0; color: #59677e; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.section-title, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.section-title h2, .section-heading h2 { margin-bottom: 0; }
.section-title .eyebrow, .section-heading .eyebrow { margin-bottom: 5px; }
.location-heading { margin-top: 24px; }
.section-divider { margin: 24px 0; border: 0; border-top: 1px solid var(--line); }
.custom-field { min-width: 0; }
.section-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 9px; background: #f2f5fb; color: #8b97ab; font-size: 10px; font-weight: 700; }
.drop-area { display: flex; min-height: 155px; flex-direction: column; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; border: 1px dashed #b6c8e8; border-radius: 12px; background: #f9fbff; cursor: pointer; text-align: center; transition: .16s; }
.drop-area:hover { border-color: var(--blue); background: var(--pale); }
.drop-area input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-area strong { color: var(--ink); font-size: 13px; }
.drop-area .muted { margin: 0; font-size: 11px; }
.upload-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: #eaf1ff; color: var(--blue); font-size: 22px; font-weight: 700; }
.upload-progress { margin-top: 15px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #edf1f7; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .15s ease; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: right; white-space: nowrap; }
th, td { padding: 12px 10px; border-bottom: 1px solid #edf0f5; font-size: 11px; }
th { background: #fafbfd; color: #8a95a8; font-size: 10px; font-weight: 700; }
td { color: #4a5870; }
tbody tr:hover { background: #fafcff; }
td a { color: var(--blue); font-weight: 700; text-decoration: none; }
.empty-state { padding: 17px 0 0; color: var(--muted); text-align: center; }
.admin-heading { margin: 25px 0 13px; scroll-margin-top: 20px; }
.admin-heading h2 { margin: 0 0 6px; color: var(--ink); font-size: 19px; }
.admin-heading p:last-child { margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 16px; }
.form-grid > div { min-width: 0; }
.full-width { grid-column: 1 / -1; }
fieldset { margin: 12px 0 0; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; }
legend { padding: 0 5px; color: var(--muted); font-size: 11px; }
.check-label { display: inline-flex !important; align-items: center; gap: 6px; margin: 5px 14px 5px 0 !important; font-size: 11px !important; font-weight: 400 !important; }
.check-label input { accent-color: var(--blue); }
.button-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.button-row button { width: auto; }
.button-row .message { flex-basis: 100%; }
.table-action { margin: 2px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 10px; }
.table-action:hover { background: #f1f5f9; }
.table-action.danger { color: #b91c1c; }
.status-pill { display: inline-block; padding: 4px 8px; border-radius: 99px; background: #e8f7ef; color: #17794e; font-size: 10px; }
.status-pill.inactive { background: #fff0ef; color: #b42332; }
.user-cell { display: flex; align-items: center; gap: 8px; }
.user-cell .avatar-image, .user-cell .avatar-placeholder { width: 32px; height: 32px; flex: 0 0 32px; font-size: 11px; }
footer { padding: 14px 0; color: var(--muted); font-size: 10px; text-align: center; }

@media (max-width: 900px) {
  .page { width: min(100% - 20px, 720px); margin: 14px auto; }
  .workspace { grid-template-columns: 1fr; }
  .sidebar { min-height: auto; padding: 12px; border-left: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { padding: 0 4px 10px; border-bottom: 0; }
  .side-nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; padding-top: 10px; }
  .side-nav > p { display: none; }
  .nav-link { flex: 0 0 auto; min-height: 36px; gap: 7px; margin: 0; padding: 0 9px; font-size: 10px; }
  .nav-link span { font-size: 14px; }
  .sidebar-foot { display: none; }
  .workspace-main { padding: 17px 14px; }
}

@media (max-width: 560px) {
  .brand { margin: 0 0 14px; }
  .brand h1 { font-size: 19px; }
  .workspace { border-radius: 15px; }
  .card { padding: 17px; border-radius: 13px; }
  .auth-card { margin: 32px auto; padding: 23px; }
  .topbar { align-items: flex-start; }
  .topbar h1 { font-size: 18px; }
  .profile-tools { gap: 7px; }
  .profile-copy { display: none; }
  .avatar-edit, .avatar-image, .avatar-placeholder { width: 38px; height: 38px; }
  .button-secondary { min-height: 33px; padding: 7px 9px; }
  .welcome { min-height: 130px; }
  .welcome h2 { font-size: 19px; }
  .welcome-art { width: 65px; flex-basis: 65px; transform: scale(.75); transform-origin: center; }
  .stats-grid { grid-template-columns: 1fr; gap: 8px; }
  .stat-card { min-height: 75px; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .side-nav { margin: 0 -3px; }
}
