/* Kamalix Biz ERP — professional theme */
:root {
  --header: #0b2233;
  --header-2: #12344a;
  --bg: #eef3f6;
  --card: #ffffff;
  --ink: #1a2b38;
  --muted: #64798a;
  --teal: #0e7c7b;
  --teal-dark: #0a5f5e;
  --gold: #c9a227;
  --line: #dde6ec;
  --danger: #c0392b;
  --warn: #b7791f;
  --ok: #1e8449;
  --shadow: 0 2px 12px rgba(11,34,51,.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--teal); text-decoration: none; }

/* shell + MS-style left sidebar */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 264px; background: #161616; color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex: none; }
.sbrand { padding: 20px 18px 14px; border-bottom: 1px solid #2c2c2c; }
.sbrand .n { font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.sbrand .n::before { content: "◆ "; color: #f5490b; }
.sbrand .s { font-size: 12px; color: #b9b9b9; margin-top: 4px; }
.snav { flex: 1; padding: 14px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.snav a { display: block; color: #d7d7d7; padding: 11px 14px; border-radius: 10px; font-size: 15px; font-weight: 600; transition: background .15s; }
.snav a:hover { background: #262626; color: #fff; text-decoration: none; }
.snav a.active { background: #f5490b; color: #fff; font-weight: 700; }
.sidefoot { padding: 16px 20px; border-top: 1px solid #2c2c2c; font-size: 13.5px; color: #cfcfcf; }
.sidefoot .uname { font-weight: 700; font-size: 15px; color: #fff; margin-bottom: 4px; }
.sidefoot a { color: #f5490b; }

/* main + slim topbar */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 22px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 5; }
.ptitle { font-size: 19px; font-weight: 800; white-space: nowrap; }
.toptabs { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; }
.toptabs a { padding: 8px 14px; border-radius: 999px; background: #f2f3f5; color: #1d1d1f; font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.toptabs a:hover { background: #e4e6ea; text-decoration: none; }
.toptabs a.active { background: #f5490b; color: #fff; }
.userbox { display: flex; align-items: center; gap: 14px; white-space: nowrap; margin-left: auto; }
.userbox .uname { font-weight: 600; }
.userbox a { color: var(--muted); font-size: 14px; }
.menuBtn { display: none; border: 2px solid var(--line); background: #fff; border-radius: 10px; font-size: 22px; padding: 5px 12px; cursor: pointer; line-height: 1.3; color: #161616; flex: none; }

/* mobile drawer */
@media (max-width: 860px) {
  .menuBtn { display: inline-block; }
  .sidebar { position: fixed; top: 0; left: 0; height: 100dvh; z-index: 200; transform: translateX(-105%); transition: transform .25s ease; box-shadow: 8px 0 30px rgba(0,0,0,.35); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open::after { content: ''; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 150; }
  .ptitle { font-size: 16px; }
  .toptabs { display: none; }
  .userbox .uname { display: none; }
}

/* content */
.content { max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px; }
.pagehead .eyebrow { color: var(--teal); font-size: 12px; letter-spacing: 2px; font-weight: 700; }
.pagehead h1 { margin: 6px 0 20px; font-size: 32px; }
.actions { margin-bottom: 16px; display: flex; gap: 10px; }

/* hero banner (dashboard) */
.hero { border-radius: 14px; overflow: hidden; margin-bottom: 24px; box-shadow: var(--shadow); position: relative; }
.hero img { width: 100%; height: 220px; object-fit: cover; display: block; }
.hero .overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,34,51,.82), rgba(11,34,51,.25)); display: flex; align-items: center; padding: 0 36px; }
.hero .overlay h2 { color: #fff; margin: 0; font-size: 26px; }
.hero .overlay p { color: #d7e6ee; margin: 6px 0 0; font-size: 14px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); transition: transform .15s; }
.card:hover { transform: translateY(-2px); }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.card .bignum { font-size: 30px; font-weight: 800; margin: 4px 0 8px; color: var(--header); }
.card .sub { color: var(--muted); font-size: 13px; }
.section { margin-top: 8px; }
.section h2 { font-size: 20px; margin: 0 0 12px; }

/* profit split visual */
.splitbar { display: flex; height: 44px; border-radius: 10px; overflow: hidden; margin: 12px 0; box-shadow: var(--shadow); }
.splitbar div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; }
.split-investors { background: #0e7c7b; }
.split-holders { background: #2a7fbf; }
.split-handler { background: #8a6d1b; }
.split-kamalix { background: #0b2233; }
.splitlegend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.splitlegend span::before { content: "■ "; }
.splitlegend .l1::before { color: #0e7c7b; } .splitlegend .l2::before { color: #2a7fbf; }
.splitlegend .l3::before { color: #8a6d1b; } .splitlegend .l4::before { color: #0b2233; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.tbl tr:hover td { background: #f8fbfc; }
.tbl .empty { text-align: center; color: var(--muted); padding: 24px; }

/* forms */
.form { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px; max-width: 720px; }
.form label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=number], .form input[type=date], .form select, .form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; color: var(--ink);
}
.form textarea { min-height: 90px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn, button.btn { display: inline-block; background: var(--teal); color: #fff; border: 0; padding: 10px 18px; border-radius: 8px; font-size: 14px; cursor: pointer; font-weight: 600; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: #5d6f7d; }
.btn.danger { background: var(--danger); }
.btn.small { padding: 6px 12px; font-size: 12px; }
.btn.navy { background: var(--header); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

/* badges & flashes */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #e8eef2; color: #445; }
.b-active, .b-paid, .b-approved, .b-completed { background: #dff3e5; color: var(--ok); }
.b-pending, .b-open, .b-draft { background: #fdf0d7; color: var(--warn); }
.b-inactive, .b-rejected, .b-closed, .b-exited { background: #fbe3df; color: var(--danger); }
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: #dff3e5; color: #14532d; }
.flash-error { background: #fbe3df; color: #7b241c; }

/* login */
.loginwrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.loginbox { background: #fff; border-radius: 14px; padding: 36px; width: 380px; box-shadow: 0 4px 24px rgba(14,42,61,.12); }
.loginbox h2 { margin: 0 0 4px; }
.loginbox .brandline { color: var(--teal); font-size: 12px; letter-spacing: 2px; font-weight: 700; margin-bottom: 18px; }

/* permissions matrix */
.permgrid { width: 100%; border-collapse: collapse; font-size: 13px; }
.permgrid th, .permgrid td { border-bottom: 1px solid var(--line); padding: 8px; text-align: center; }
.permgrid th:first-child, .permgrid td:first-child { text-align: left; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; }

/* Kamalix 25/25/25/25 split bar */
.splitbar { display: flex; height: 36px; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); margin: 14px 0 10px; }
.splitbar div { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; min-width: 0; white-space: nowrap; overflow: hidden; }
.sb-inv { background: #0e7c7b; }
.sb-hold { background: #2471a3; }
.sb-hand { background: #b7791f; }
.sb-kam { background: #1c2b36; }
.legend { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.l-inv { background: #0e7c7b; }
.l-hold { background: #2471a3; }
.l-hand { background: #b7791f; }
.l-kam { background: #1c2b36; }
.small { font-size: 12px; }
