/* ScriptInfinite.net — layout taken from scriptinfinite.com (site_main.php, inc/site_header.php) */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Arial, sans-serif; color: #1f2937; line-height: 1.6; -webkit-text-size-adjust: 100%; background: #fff; }
a { text-decoration: none; color: #023a8f; }
a:hover { text-decoration: underline; }

/* ---- navbar (as .com) ---- */
.navbar { position: sticky; top: 0; z-index: 1000; background: #fff; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: flex-start; padding: 10px 16px; flex-wrap: wrap; gap: 12px; }
.navbar .logo { margin-right: auto; flex-shrink: 0; background: #fff; order: 0; }
.logo img { max-height: 48px; width: auto; display: block; }
.nav-center { display: flex; align-items: center; flex: 0 1 auto; order: 1; }
.menu-list { list-style: none; display: flex; gap: 4px 8px; margin: 0; padding: 0; align-items: center; flex-wrap: wrap; }
.menu-item { position: relative; }
.menu-link { padding: 8px 10px; display: inline-block; font-size: 14px; color: #111827; transition: background .15s, color .15s; }
.menu-link:hover { background: #023a8f; color: #fff; text-decoration: none; }
.dropdown { position: absolute; top: 100%; left: 0; min-width: 200px; box-shadow: 0 10px 24px rgba(0,0,0,.15); display: none; padding: 4px 0; border: 1px solid rgba(0,0,0,.08); z-index: 1001; background: #023a8f; }
.dropdown a { display: block; padding: 6px 10px; font-size: 13px; line-height: 1.3; transition: background .15s; color: #fff; }
.dropdown a:hover { background: #0348b0; color: #fff; text-decoration: none; }
.menu-item:hover .dropdown { display: block; }
.nav-badge { order: 2; font-size: 12px; color: #4b5563; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout { flex-shrink: 0; order: 3; }
.nav-logout .logout-btn { background: #023a8f; color: #fff; border: 1px solid #023a8f; padding: 8px 12px; border-radius: 4px; font-size: 14px; display: inline-flex; align-items: center; }
.nav-logout .logout-btn:hover { background: #5b9bd5; border-color: #5b9bd5; text-decoration: none; }
.nav-cfo { order: 4; flex-shrink: 0; }
.nav-cfo img { max-height: 40px; display: block; }
.navbar-toggle { display: none; background: #023a8f; color: #fff; border: none; padding: 10px 14px; border-radius: 4px; font-size: 14px; cursor: pointer; order: 5; }

/* ---- sections (as .com) ---- */
.container { max-width: 900px; margin: 0 auto; width: 100%; padding: 0 16px; }
.container.wide { max-width: 1240px; }
.footer-page-section { padding: 40px 24px 56px; border-bottom: 1px solid #f3f4f6; min-height: 60vh; }
.section-header { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.5rem; }
.section-header-line { flex: 1; height: 0; border-top: 2px solid #023a8f; }
.section-header h2 { margin: 0; padding: 0 1rem; font-size: 28px; white-space: nowrap; color: #023a8f; }
section h3 { font-size: 20px; color: #111827; margin: 28px 0 12px; }
.btn { border: 1px solid #023a8f; border-radius: 6px; padding: 9px 16px; display: inline-block; font-size: 14px; background: #fff; color: #023a8f; cursor: pointer; font-family: inherit; line-height: 1.3; }
.btn.primary { background: #023a8f; color: #fff; border-color: #023a8f; }
.btn.green { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.btn.danger { background: #fff; color: #991b1b; border-color: #991b1b; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn:hover { opacity: .9; text-decoration: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.cta { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- notices, cards, tables, forms ---- */
.notice { margin-bottom: 16px; padding: 12px 14px; border-radius: 6px; font-size: 14px; }
.notice.success, .notice.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.notice.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.notice.info { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.notice.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.card { border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px 16px; background: #fff; }
.card .num { font-size: 28px; font-weight: 700; color: #023a8f; line-height: 1.2; }
.card .lbl { font-size: 13px; color: #4b5563; }
.card.alert .num { color: #b45309; }
.panel { border: 1px solid #e5e7eb; border-radius: 8px; padding: 16px 18px; margin-bottom: 20px; background: #fff; }
.panel h3 { margin-top: 0; }
.table-wrap { overflow-x: auto; margin-bottom: 20px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th { background: #023a8f; color: #fff; text-align: left; padding: 8px 10px; font-weight: 600; white-space: nowrap; }
table.grid td { padding: 7px 10px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
table.grid tr:nth-child(even) td { background: #f9fafb; }
table.grid td.num, table.grid th.num { text-align: right; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; word-break: break-all; }
.muted { color: #6b7280; font-size: 13px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.wait { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: #991b1b; }
form.stack label { display: block; margin: 10px 0 4px; font-size: 14px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: block; margin: 10px 0 4px; font-size: 13.5px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; }
textarea { min-height: 110px; resize: vertical; }
.inline-form { display: inline; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
.filters > div { min-width: 150px; }
.filters label { display: block; font-size: 12px; color: #4b5563; margin-bottom: 2px; }
.code-once { font-family: Consolas, monospace; font-size: 28px; letter-spacing: 3px; background: #f3f6fb; border: 2px dashed #023a8f; padding: 14px 18px; display: inline-block; border-radius: 8px; color: #023a8f; }

/* ---- agreement page ---- */
.agreement-box { border: 1px solid #d1d5db; border-radius: 8px; max-height: 60vh; overflow-y: auto; padding: 18px 22px; background: #fcfcfd; font-size: 14px; }
.agreement-box table, .agreement-print table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.agreement-box th, .agreement-box td, .agreement-print th, .agreement-print td { border: 1px solid #d1d5db; padding: 5px 8px; text-align: left; vertical-align: top; }
.agreement-box th, .agreement-print th { background: #e8eef8; }
.agreement-box h2, .agreement-print h2 { font-size: 17px; color: #023a8f; margin: 22px 0 8px; }
.agreement-box .ag-title, .agreement-print .ag-title { font-size: 18px; font-weight: 700; color: #023a8f; text-align: center; }
.accept-panel { margin-top: 18px; border: 2px solid #023a8f; border-radius: 8px; padding: 16px 18px; background: #f8fbff; }
.accept-panel .statement { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 15px; }
.accept-panel .statement input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.accept-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.step-ok { color: #166534; font-weight: 600; font-size: 13px; }
.digest { font-size: 12px; color: #4b5563; }

/* ---- sign-in home (as .com index.php) ---- */
body.home { display: flex; min-height: 100vh; background: #f5f5f5; font-family: system-ui, -apple-system, sans-serif; }
.half { flex: 0 0 50%; display: flex; align-items: center; justify-content: center; padding: 2rem; min-height: 100vh; }
.half-left { background: #fff; }
.half-right { background: #fafafa; }
.brand { text-align: center; max-width: 380px; }
.brand img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.brand img.cfo { max-width: 200px; margin-top: 1.5rem; }
.brand h1 { color: #023a8f; font-size: 1.75rem; margin: 1.25rem 0 0; }
.brand p { color: #4b5563; margin: .4rem 0 0; }
.home .card { width: 100%; max-width: 380px; border: none; padding: 0; background: transparent; }
.home .card h2 { margin: 0 0 1.25rem; color: #333; font-size: 1.25rem; }
.home .btn-row { display: flex; gap: .75rem; margin-bottom: 1rem; }
.home .hbtn { display: inline-block; padding: .65rem 1.25rem; border-radius: 6px; font-size: 1rem; text-align: center; cursor: pointer; border: none; flex: 1; font-family: inherit; }
.home .hbtn-primary { background: #023a8f; color: #fff; }
.home .hbtn-secondary { background: #fff; color: #023a8f; border: 2px solid #023a8f; }
.home .hbtn:hover { opacity: .9; text-decoration: none; }
.home .form-group { margin-bottom: 1rem; }
.home .form-group label { display: block; margin-bottom: .35rem; color: #555; font-size: .9rem; }
.home .form-group input { width: 100%; padding: .6rem .75rem; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; }
.home .signin-panel { display: none; }
.home .signin-panel.visible { display: block; }
.home .links { margin-top: .5rem; font-size: .9rem; display: flex; justify-content: space-between; }
.home .error-msg { margin-bottom: 1rem; padding: .5rem .75rem; background: #fef2f2; color: #991b1b; border-radius: 4px; font-size: .9rem; }
.home .note { margin-top: 1.25rem; font-size: .85rem; color: #6b7280; }

/* ---- footer (as .com) ---- */
.footer-old { background: #022555; color: #fff; padding: 28px 24px; }
.footer-old a { color: #fff; }
.footer-old a:hover { opacity: .9; text-decoration: underline; }
.footer_contact_block { margin-bottom: 16px; }
.footer_contact_block h3 { color: #fff; font-size: 1.1rem; margin: 0 0 10px; }
.footer_contact_block p { margin: 6px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: rgba(255,255,255,.95); font-size: 14px; }
.footer_contact_block p img { width: 18px; height: 18px; flex-shrink: 0; }
.footer_contact_block .footer_company_name { font-weight: 600; }
.footer_low { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.3); color: rgba(255,255,255,.95); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: #fff; font-size: 14px; }
.back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 999; opacity: .8; }
.back-to-top:hover { opacity: 1; }
.back-to-top img { width: 40px; height: 40px; display: block; }

/* =====================================================================
   Signed-in shell — as the CFOScript application (templates/spa/_portal_base.html):
   light-blue fixed header (client name centre, user + Logout right),
   navy sidebar with CFOScript logo on top and Script Infinite at its foot.
   ===================================================================== */
body.shell {
  --header-h: 64px; --sidebar-w: 230px;
  --navy: #001a33; --navy-mid: #003366; --navy-hi: #005599; --lightblue: #cce0ff; --footer-lb: #d6ecff;
  background: #e6f2ff; margin: 0;
}
.shell .dash-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); z-index: 100;
  background: var(--lightblue); box-shadow: 0 2px 5px rgba(0,0,0,.2);
  display: flex; align-items: center; padding: 0 20px 0 calc(var(--sidebar-w) + 16px); gap: 12px;
}
.shell .header-left { flex: 0 0 auto; }
.shell .header-center { flex: 1; min-width: 0; display: flex; justify-content: center; }
.shell .client-name { font-size: 22px; font-weight: 800; color: var(--navy-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell .header-right { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.shell .who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; color: var(--navy-mid); }
.shell .who .name { font-size: 14px; font-weight: 800; }
.shell .who .role-tag { margin-top: 3px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #fff; background: var(--navy-mid); padding: 1px 7px; border-radius: 10px; }
.shell .logout-btn { background: var(--navy-mid); color: #fff; border-radius: 6px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.shell .logout-btn:hover { background: var(--navy-hi); text-decoration: none; }
.shell .dash-hamburger { display: none; width: 44px; height: 44px; padding: 10px; background: none; border: 0; cursor: pointer; flex-direction: column; justify-content: space-around; }
.shell .dash-hamburger span { display: block; height: 3px; width: 100%; background: var(--navy-mid); border-radius: 2px; }

.shell .dash-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 110;
  background: var(--navy); color: #fff; display: flex; flex-direction: column; transition: transform .22s ease;
}
.shell .sidebar-brand { display: flex; align-items: center; justify-content: center; height: var(--header-h); background: var(--lightblue); border-bottom: 1px solid #99b3ff; flex: 0 0 auto; }
.shell .sidebar-brand img { height: 46px; width: auto; mix-blend-mode: multiply; display: block; }
.shell .sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: 10px 0 12px; }
.shell .sidebar-scroll::-webkit-scrollbar { width: 8px; }
.shell .sidebar-scroll::-webkit-scrollbar-track { background: #001122; }
.shell .sidebar-scroll::-webkit-scrollbar-thumb { background: var(--navy-mid); border-radius: 4px; }
.shell .sb-link, .shell .sb-toggle {
  display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 44px;
  padding: 10px 15px; background: transparent; border: 0; color: #fff; font: 700 14px Arial, sans-serif; text-align: left; cursor: pointer;
}
.shell .sb-link:hover, .shell .sb-toggle:hover { background: var(--navy-mid); text-decoration: none; }
.shell .sb-link.active, .shell .sb-item.active > .sb-toggle { background: #004080; border-left: 4px solid #00ccff; padding-left: 11px; }
.shell .sb-toggle .chev { font-size: 11px; opacity: .8; transition: transform .2s; }
.shell .sb-item.open > .sb-toggle .chev, .shell .sb-item.active > .sb-toggle .chev { transform: rotate(180deg); }
.shell .sb-list { list-style: none; margin: 0; padding: 0; max-height: 0; overflow: hidden; transition: max-height .3s ease-out; }
.shell .sb-list.show { max-height: 800px; }
.shell .sb-list a { display: block; padding: 10px 25px; color: #fff; font-size: 13px; }
.shell .sb-list a:hover { background: #004080; }
.shell .sb-list a.active { background: #004080; font-weight: 700; text-decoration: underline; }
.shell .sidebar-footer { flex: 0 0 auto; background: var(--footer-lb); color: var(--navy-mid); padding: 4px 14px 8px; text-align: center; border-top: 1px solid #99b3ff; }
.shell .sidebar-footer .si-logo { height: 72px; width: auto; display: block; margin: 0 auto -4px; }
.shell .sidebar-footer .copy { margin: 0; font-size: 10.5px; line-height: 1.2; }
.shell .dash-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 105; }

.shell .dash-main { margin-left: var(--sidebar-w); padding-top: var(--header-h); min-height: 100vh; }
.shell .page-toolbar {
  position: sticky; top: var(--header-h); z-index: 70; height: 42px; display: flex; align-items: center; padding: 0 20px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid)); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.shell .page-toolbar .pt-title { font-size: 16px; font-weight: 800; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell .page-body { padding: 20px 24px 48px; max-width: 1280px; }
.shell .panel, .shell .card { background: #fff; }
.shell .table-wrap { background: #fff; border-radius: 6px; }
.shell .agreement-box { background: #fff; }
.shell .page-body h3 { font-size: 18px; color: var(--navy-mid); margin: 24px 0 10px; }

@media (max-width: 992px) {
  .shell .dash-header { padding-left: 12px; }
  .shell .dash-hamburger { display: flex; }
  .shell .dash-sidebar { transform: translateX(-100%); }
  .shell.drawer-open .dash-sidebar { transform: translateX(0); }
  .shell.drawer-open .dash-backdrop { display: block; }
  .shell .dash-main { margin-left: 0; }
}
@media (max-width: 600px) {
  .shell .client-name { font-size: 15px; }
  .shell .who { display: none; }
  .shell .page-body { padding: 14px 12px 32px; }
}
@media print {
  .shell .dash-header, .shell .dash-sidebar, .shell .page-toolbar { display: none !important; }
  .shell .dash-main { margin: 0; padding: 0; }
}

@media (max-width: 992px) {
  .navbar .nav-center { width: 100%; order: 6; display: none; }
  .navbar .nav-center.show { display: block; }
  .navbar .menu-list { flex-direction: column; align-items: stretch; width: 100%; }
  .navbar .menu-item .dropdown { position: static; box-shadow: none; margin-left: 12px; margin-top: 4px; }
  .navbar .menu-item:hover .dropdown { display: none; }
  .navbar .menu-item.open .dropdown { display: block; }
  .navbar-toggle { display: block; }
  .nav-badge { display: none; }
}
@media (max-width: 768px) {
  body.home { flex-direction: column; }
  .half { flex: none; min-height: auto; padding: 1.5rem; }
  .navbar { padding: 10px 12px; }
  .logo img { max-height: 40px; }
  .nav-cfo img { max-height: 32px; }
  .footer-page-section { padding: 28px 16px 40px; }
  .container { padding: 0 4px; }
  .section-header h2 { font-size: 22px; white-space: normal; }
  .form-grid, .accept-steps { grid-template-columns: 1fr; }
  .back-to-top { right: 12px; bottom: 12px; }
}
@media print {
  .navbar, .footer-old, .back-to-top, .no-print { display: none !important; }
  .agreement-box { max-height: none; overflow: visible; border: none; }
}
