:root {
  --blue-900: #073e65;
  --blue-800: #075579;
  --blue-700: #0a6d91;
  --blue-600: #1f67d2;
  --blue-500: #2f6bff;
  --blue-300: #8eb7ff;
  --blue-100: #eaf2ff;
  --blue-50: #f6f9ff;
  --ink: #17324a;
  --muted: #66788b;
  --line: #dce6f2;
  --green: #13875b;
  --amber: #b8710a;
  --red: #c44949;
  --white: #ffffff;
  --shadow: 0 18px 48px rgba(31, 78, 132, 0.10);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: linear-gradient(145deg, #ffffff 0%, #fbfdff 70%, #f4f8ff 100%);
  color: var(--ink);
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.decor {
  position: fixed;
  z-index: 0;
  width: 520px;
  height: 860px;
  border: 1px solid rgba(47, 107, 255, .15);
  border-radius: 50%;
  pointer-events: none;
}

.decor::before, .decor::after {
  content: "";
  position: absolute;
  inset: 34px;
  border: inherit;
  border-radius: inherit;
}
.decor::after { inset: 72px; }
.decor-left { left: -410px; top: 12%; }
.decor-right { right: -430px; top: 25%; }

.network {
  position: fixed;
  z-index: 0;
  right: 1.5rem;
  top: 1rem;
  width: 250px;
  height: 150px;
  opacity: .35;
  pointer-events: none;
  background:
    linear-gradient(28deg, transparent 47%, rgba(47,107,255,.25) 48%, rgba(47,107,255,.25) 49%, transparent 50%),
    linear-gradient(148deg, transparent 47%, rgba(47,107,255,.20) 48%, rgba(47,107,255,.20) 49%, transparent 50%);
}
.network span { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #79a9ff; }
.network span:nth-child(1) { left: 8%; top: 18%; }
.network span:nth-child(2) { left: 42%; top: 4%; width: 14px; height: 14px; }
.network span:nth-child(3) { left: 72%; top: 28%; }
.network span:nth-child(4) { left: 25%; top: 68%; width: 7px; height: 7px; }
.network span:nth-child(5) { left: 58%; top: 62%; width: 13px; height: 13px; }
.network span:nth-child(6) { right: 2%; bottom: 6%; }

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  background: rgba(255,255,255,.92);
  border-right: 1px solid rgba(110,150,205,.22);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand img { width: 48px; height: 58px; object-fit: contain; }
.brand strong { display: block; color: var(--blue-800); font-size: 25px; line-height: 1; letter-spacing: 2px; font-weight: 700; }
.brand small { display: block; margin-top: 7px; color: var(--blue-700); font-size: 8px; letter-spacing: 1.2px; white-space: nowrap; }

.nav { display: grid; gap: 7px; }
.nav-item {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  color: #49657d;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  transition: .18s ease;
}
.nav-item:hover { background: var(--blue-50); color: var(--blue-700); }
.nav-item.active { background: linear-gradient(135deg, var(--blue-700), var(--blue-600)); color: white; box-shadow: 0 10px 24px rgba(31,103,210,.2); }

.sidebar-note { margin-top: auto; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--blue-50); }
.sidebar-note strong { color: var(--blue-800); font-size: 14px; }
.sidebar-note p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

.workspace { min-width: 0; padding: 28px 34px 52px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.topbar h1 { margin: 4px 0 0; font-size: clamp(27px, 3vw, 40px); color: var(--blue-900); font-weight: 700; }
.eyebrow { margin: 0; color: var(--blue-600); font-size: 11px; letter-spacing: 2px; font-weight: 700; }
.menu-toggle { display: none; border: 0; background: transparent; color: var(--blue-800); font-size: 24px; padding: 0 10px 0 0; }

.period-control { min-width: 190px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.9); box-shadow: 0 8px 24px rgba(42,80,125,.07); }
.period-control span { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.period-control input { width: 100%; margin-top: 4px; border: 0; outline: 0; color: var(--blue-900); background: transparent; font-weight: 700; }

.view { display: none; }
.view.active { display: block; animation: viewIn .24s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 18px; }
.section-heading h2, .panel h3 { margin: 0; color: var(--blue-900); font-weight: 700; }
.section-heading h2 { font-size: 22px; }
.section-heading p, .panel-header p { margin: 5px 0 0; color: var(--muted); }

.cards-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { position: relative; overflow: hidden; min-height: 132px; padding: 20px; border: 1px solid rgba(116,157,211,.23); border-radius: 17px; background: rgba(255,255,255,.93); box-shadow: var(--shadow); }
.metric-card::after { content: ""; position: absolute; width: 120px; height: 120px; border: 1px solid rgba(47,107,255,.12); border-radius: 50%; right: -60px; top: -30px; box-shadow: -20px 0 0 rgba(47,107,255,.025); }
.metric-card p { margin: 0; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; margin-top: 16px; color: var(--blue-800); font-size: 34px; font-weight: 700; }
.metric-card small { color: #8b9bae; }
.metric-card.good strong { color: var(--green); }
.metric-card.warn strong { color: var(--amber); }

.panel { border: 1px solid rgba(116,157,211,.23); border-radius: 17px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.panel-header { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.period-pill { color: var(--blue-700); background: var(--blue-100); border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 700; }
.due-list { padding: 8px 22px 18px; }
.due-item { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(130px, .55fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid #edf2f7; }
.due-item:last-child { border-bottom: 0; }
.due-item strong { display: block; }
.due-item small { color: var(--muted); }
.deadline { text-align: right; font-weight: 700; color: var(--amber); }
.deadline.overdue { color: var(--red); }

.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th { padding: 13px 16px; background: #f4f8fd; color: #567087; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .7px; }
td { padding: 14px 16px; border-top: 1px solid #e7eef6; color: #29465e; vertical-align: middle; }
tbody tr { transition: .15s ease; }
tbody tr.clickable { cursor: pointer; }
tbody tr:hover { background: #f9fbff; }
.company-name { font-weight: 700; color: var(--blue-900); }
.first-badge { display: inline-block; margin-bottom: 4px; padding: 3px 7px; border-radius: 999px; background: #e8f7f1; color: var(--green); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }

.progress { min-width: 120px; }
.progress-track { height: 7px; border-radius: 999px; background: #e8eef6; overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-600), #51a2ff); }
.progress small { display: block; margin-top: 5px; color: var(--muted); }

.status { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status.done { background: #e7f7ef; color: var(--green); }
.status.progress { background: #fff4df; color: var(--amber); }
.status.neutral { background: #eef3f7; color: #607688; }
.status.inactive { background: #f8eaea; color: var(--red); }

.search-input { min-width: 260px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: white; }
.search-input:focus, input:focus, select:focus, textarea:focus { border-color: var(--blue-300); box-shadow: 0 0 0 3px rgba(47,107,255,.10); }

.button-row { display: flex; gap: 9px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; cursor: pointer; text-decoration: none; font-weight: 700; transition: .15s ease; }
.button.primary { color: white; background: linear-gradient(135deg, var(--blue-700), var(--blue-600)); box-shadow: 0 8px 20px rgba(31,103,210,.18); }
.button.primary:hover { transform: translateY(-1px); }
.button.ghost { color: var(--blue-700); background: white; border-color: var(--line); }
.button.danger { color: var(--red); background: #fff; border-color: #efcccc; }
.button.small { padding: 6px 9px; font-size: 12px; }

.stack-list { display: grid; gap: 13px; }
.list-card { padding: 18px 20px; border: 1px solid rgba(116,157,211,.24); border-radius: 15px; background: rgba(255,255,255,.94); box-shadow: 0 10px 28px rgba(31,78,132,.07); }
.list-card-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.list-card h3 { margin: 0; color: var(--blue-900); }
.list-card p { color: var(--muted); }
.plan-grid { display: grid; grid-template-columns: 1.6fr repeat(3, minmax(110px,.6fr)); gap: 12px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

.check-list { display: grid; gap: 8px; margin-top: 14px; }
.check-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 145px; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid #e3ebf4; border-radius: 11px; background: #fbfdff; }
.check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--blue-600); }
.check-row label { font-weight: 700; }
.check-row input[type="date"] { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(12,37,59,.48); backdrop-filter: blur(5px); }
.modal-backdrop[hidden] { display: none; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 48px); overflow: auto; border-radius: 19px; background: white; box-shadow: 0 30px 90px rgba(8,37,68,.28); }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 19px 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.modal-header h2 { margin: 3px 0 0; color: var(--blue-900); }
.modal-body { padding: 22px; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--blue-50); color: var(--blue-800); font-size: 25px; cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { color: #48637a; font-size: 12px; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: white; color: var(--ink); }
.field textarea { min-height: 90px; resize: vertical; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.obligation-picker { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.obligation-option { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: #36536a; background: #fbfdff; }
.obligation-option input { width: auto; }
.hint { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.empty { padding: 30px 18px; text-align: center; color: var(--muted); }

.toast { position: fixed; z-index: 30; right: 24px; bottom: 24px; max-width: 380px; padding: 12px 16px; border-radius: 11px; color: white; background: var(--blue-900); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.error { background: #9c3232; }

.sidebar-bottom { margin-top: auto; padding-top: 14px; display: grid; gap: 10px; }
.admin-nav { border: 1px solid #cbdcf2; background: var(--blue-50); color: var(--blue-800); }
.user-panel { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.user-panel strong, .user-panel small { display: block; }
.user-panel strong { color: var(--blue-900); font-size: 13px; }
.user-panel small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.logout-button { flex: 0 0 auto; font-size: 19px; }
.user-identity { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.user-identity:hover strong { color: var(--blue-600); }

.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.admin-card { position: relative; overflow: hidden; min-height: 250px; padding: 24px; border: 1px solid rgba(116,157,211,.24); border-radius: 17px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: flex-start; }
.admin-card::after { content: ""; position: absolute; right: -65px; top: -55px; width: 160px; height: 160px; border: 1px solid rgba(47,107,255,.12); border-radius: 50%; }
.admin-card h3 { margin: 0 0 8px; color: var(--blue-900); font-size: 19px; }
.admin-card p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.admin-card .button { margin-top: auto; }
.directory-meta { display: flex; align-items: center; gap: 10px; margin: -4px 0 16px; color: var(--muted); }
.folder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.folder-card { position: relative; min-height: 112px; border: 1px solid rgba(116,157,211,.24); border-radius: 16px; background: rgba(255,255,255,.95); box-shadow: 0 10px 28px rgba(31,78,132,.07); }
.folder-open { width: 100%; min-height: 110px; display: flex; align-items: center; gap: 14px; padding: 20px 55px 20px 20px; border: 0; border-radius: inherit; background: transparent; text-align: left; cursor: pointer; }
.folder-open:hover { background: #f9fbff; }
.folder-open strong, .folder-open small { display: block; }
.folder-open strong { color: var(--blue-900); font-size: 17px; }
.folder-open small { margin-top: 5px; color: var(--muted); }
.folder-icon { font-size: 30px; }
.folder-card > .more-menu { position: absolute; right: 14px; top: 14px; }
.file-list { display: grid; padding: 7px 18px 14px; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf2f7; }
.file-row:last-child { border-bottom: 0; }
.file-row strong, .file-row small { display: block; }
.file-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row small { color: var(--muted); margin-top: 3px; }
.folder-popup-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 18px 12px; border-bottom: 1px solid var(--line); }
.folder-popup-actions p { margin: 0; color: var(--muted); }
.card-actions { display: flex; align-items: center; gap: 8px; }
.more-menu { position: relative; z-index: 3; }
.more-menu summary { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--blue-800); background: white; cursor: pointer; font-size: 22px; font-weight: 700; line-height: 1; list-style: none; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu-panel { position: absolute; z-index: 5; right: 0; top: 40px; min-width: 130px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 14px 36px rgba(8,37,68,.18); }
.more-menu-panel button { width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.more-menu-panel button:hover { background: var(--blue-50); }
.more-menu-panel .danger-option { color: var(--red); }
.study-editor-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.study-editor-row input { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; }
.icon-button.compact { width: 32px; height: 32px; font-size: 20px; }
.management-list { display: grid; gap: 8px; margin-top: 18px; }
.management-row { display: grid; grid-template-columns: minmax(0,1fr) repeat(2, minmax(90px,.35fr)) auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; }
.management-row.user-row { grid-template-columns: minmax(0,1fr) 130px 95px auto; }
.management-row input, .management-row select { width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; }

.login-page { min-height: 100vh; overflow: hidden; }
.login-corner-title { position: fixed; z-index: 3; left: 30px; top: 22px; margin: 0; color: var(--blue-800); font-size: 12px; font-weight: 700; letter-spacing: .8px; }
.login-shell { position: relative; z-index: 2; min-height: 100vh; display: grid; place-items: center; padding: 70px 20px 30px; }
.login-card { width: min(430px, 100%); padding: 34px 38px; border: 1px solid rgba(116,157,211,.28); border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 28px 90px rgba(31,78,132,.16); }
.login-brand { display: grid; justify-items: center; text-align: center; }
.login-brand img { width: 76px; height: 92px; object-fit: contain; }
.login-brand strong { margin-top: 8px; color: var(--blue-800); font-size: 34px; letter-spacing: 4px; }
.login-brand small { margin-top: 5px; color: var(--blue-700); font-size: 9px; letter-spacing: 2px; }
.login-heading { margin: 27px 0 20px; text-align: center; }
.login-heading h1 { margin: 0; color: var(--blue-900); font-size: 24px; }
.login-heading p { margin: 6px 0 0; color: var(--muted); }
.login-form { display: grid; gap: 14px; }
.forgot-link { justify-self: start; border: 0; padding: 0; color: var(--blue-600); background: transparent; cursor: pointer; font-size: 13px; font-weight: 700; }
.forgot-link:hover { text-decoration: underline; }
.login-submit { width: 100%; margin-top: 5px; }
.login-notice { min-height: 18px; margin: 16px 0 0; color: var(--green); font-size: 13px; text-align: center; }
.login-notice.error { color: var(--red); }
.login-modal { width: min(520px, 100%); }
.button:disabled { opacity: .62; cursor: wait; transform: none !important; }

.finance-nav-group { display: grid; gap: 5px; }
.finance-nav-toggle { justify-content: space-between; }
.finance-nav-toggle span { font-size: 18px; transition: transform .18s ease; }
.finance-nav-toggle.active span { transform: rotate(180deg); }
.finance-subnav { display: grid; gap: 4px; margin: 0 0 3px 14px; padding-left: 11px; border-left: 2px solid var(--blue-100); }
.finance-subnav[hidden] { display: none; }
.finance-subnav button { border: 0; border-radius: 9px; padding: 9px 11px; color: #607688; background: transparent; text-align: left; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; }
.finance-subnav button:hover, .finance-subnav button.active { color: var(--blue-700); background: var(--blue-50); }

.finance-hero { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 16px; padding: 24px; border: 1px solid rgba(116,157,211,.24); border-radius: 18px; background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(235,244,255,.94)); box-shadow: var(--shadow); }
.finance-hero h2 { margin: 5px 0 4px; color: var(--blue-900); font-size: 28px; }
.finance-hero p { margin: 0; color: var(--muted); }
.finance-period { display: flex; align-items: flex-end; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.finance-period label, .finance-cash-form label, .finance-filter-form label { display: grid; gap: 5px; color: #48637a; font-size: 11px; font-weight: 700; }
.finance-period input, .finance-cash-form input, .finance-filter-form input, .finance-filter-form select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); }
.finance-period span { align-self: center; margin-top: 16px; color: var(--muted); }
.finance-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.finance-balance-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.finance-metric-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.finance-metric-cards .metric-card { min-height: 118px; }
.finance-metric-cards .metric-card strong { font-size: 25px; }
.finance-today-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.finance-today-grid table { min-width: 560px; }
.finance-today-grid .panel-header > strong { color: var(--blue-800); font-size: 18px; }

.finance-filters { margin-bottom: 16px; }
.finance-filter-form { display: grid; grid-template-columns: 1.25fr repeat(5, minmax(125px, .8fr)) auto; gap: 9px; align-items: end; padding: 16px; border: 1px solid rgba(116,157,211,.24); border-radius: 15px; background: rgba(255,255,255,.95); box-shadow: 0 10px 28px rgba(31,78,132,.06); }
.finance-account-card { padding: 0; overflow: hidden; }
.finance-account-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; cursor: pointer; list-style: none; background: #fbfdff; }
.finance-account-summary::-webkit-details-marker { display: none; }
.finance-account-summary h3 { margin: 7px 0 0; }
.finance-account-summary p { margin: 4px 0 0; }
.finance-account-figures { display: grid; grid-template-columns: repeat(3, minmax(95px, 1fr)); gap: 16px; text-align: right; }
.finance-account-figures small, .finance-account-figures strong { display: block; }
.finance-account-figures small { color: var(--muted); }
.finance-account-figures strong { margin-top: 3px; color: var(--blue-800); }
.finance-account-body { padding: 4px 20px 18px; border-top: 1px solid var(--line); }
.finance-entry-note { margin: 13px 0 5px; padding: 10px 12px; border-radius: 9px; color: #47677f; background: var(--blue-50); }
.finance-installment-row { display: grid; grid-template-columns: .8fr repeat(3, minmax(90px,.75fr)) minmax(135px,.9fr) minmax(250px,1.6fr); gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #edf2f7; }
.finance-installment-row small, .finance-installment-row strong { display: block; }
.finance-installment-row small { color: var(--muted); }
.finance-installment-row .button-row { justify-content: flex-end; }
.finance-provision-label { margin-top: 5px; color: var(--blue-600) !important; }
.finance-account-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 14px; color: var(--muted); font-size: 12px; }

.finance-master-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.finance-master-card { overflow: visible; }
.finance-master-list { max-height: 420px; overflow: auto; padding: 8px 18px 16px; }
.finance-master-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf2f7; }
.finance-master-row:last-child { border-bottom: 0; }
.finance-master-row strong, .finance-master-row small, .finance-master-row span { display: block; }
.finance-master-row small { margin-top: 3px; color: var(--muted); }
.finance-master-row span { margin-top: 4px; color: var(--green); font-size: 11px; font-weight: 700; }
.finance-master-row.inactive { opacity: .68; }
.finance-master-row.inactive span { color: var(--red); }
.finance-cash-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; padding: 18px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 225px minmax(0,1fr); }
  .sidebar { padding-inline: 13px; }
  .brand small { display: none; }
  .workspace { padding-inline: 22px; }
  .cards-grid { grid-template-columns: repeat(3, minmax(150px,1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .finance-metric-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .finance-filter-form { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .finance-installment-row { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .finance-installment-row .button-row { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 780px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 15; width: 260px; left: -280px; transition: left .2s ease; box-shadow: 20px 0 50px rgba(16,50,80,.18); }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-block; }
  .topbar > div { display: flex; flex-wrap: wrap; align-items: center; }
  .topbar .eyebrow, .topbar h1 { width: calc(100% - 38px); }
  .workspace { padding: 20px 16px 40px; }
  .cards-grid { grid-template-columns: 1fr; }
  .section-heading, .topbar { align-items: stretch; flex-direction: column; }
  .period-control, .search-input { width: 100%; min-width: 0; }
  .form-grid, .obligation-picker { grid-template-columns: 1fr; }
  .due-item { grid-template-columns: 1fr; }
  .deadline { text-align: left; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
  .folder-grid { grid-template-columns: 1fr; }
  .management-row, .management-row.user-row { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
  .login-corner-title { left: 18px; top: 15px; }
  .finance-hero, .finance-period, .finance-toolbar { align-items: stretch; flex-direction: column; }
  .finance-period { display: grid; grid-template-columns: 1fr; }
  .finance-period span { margin: 0; }
  .finance-balance-cards, .finance-metric-cards, .finance-today-grid, .finance-master-grid { grid-template-columns: 1fr; }
  .finance-filter-form, .finance-installment-row, .finance-cash-form { grid-template-columns: 1fr; }
  .finance-account-summary { align-items: stretch; flex-direction: column; }
  .finance-account-figures { text-align: left; }
  .finance-master-row { grid-template-columns: 1fr; }
}
