:root {
    --oracle-blue: #14558f;
    --oracle-blue-dark: #0b3d6b;
    --oracle-blue-soft: #dceaf6;
    --oracle-line: #9db6ca;
    --oracle-bg: #e8edf1;
    --oracle-panel: #f7f9fb;
    --oracle-field: #fffef0;
}

#app.visible { background: var(--oracle-bg); }
.sidebar { width: 218px; background: #f4f6f8; border-right: 1px solid #9eb1c1; color: #203040; }
.sidebar-brand { min-height: 58px; background: var(--oracle-blue-dark); padding: 10px 12px; }
.sidebar-brand-text h2, .sidebar-brand-text span { color: white; }
.sidebar-brand-icon { width: 34px; height: 34px; }
.sidebar-nav { padding: 7px; }
.nav-section-label { color: #667788; padding: 8px 8px 3px; font-size: 10px; }
.nav-item { min-height: 34px; padding: 7px 9px; border-radius: 3px; color: #263746; }
.nav-item:hover { background: #e1ebf3; color: var(--oracle-blue-dark); }
.nav-item.active { background: var(--oracle-blue); color: white; }
.sidebar-footer { background: #e8edf1; border-top-color: #b8c7d3; }
.developer-credit { display:flex; align-items:center; gap:8px; margin-top:8px; padding:7px 9px; border:1px solid #c4d0da; border-radius:3px; background:#f7f9fb; color:#52697c; }
.developer-credit svg { width:16px; height:16px; flex:0 0 16px; color:#0b68ac; }
.developer-credit div { min-width:0; line-height:1.2; }
.developer-credit span { display:block; font-size:9px; text-transform:uppercase; color:#718697; }
.developer-credit strong { display:block; margin-top:2px; font-size:11px; color:#263f53; white-space:nowrap; }
.main-content { margin-left: 0; background: var(--oracle-bg); }
.oracle-menubar, .oracle-statusbar, .main-content > .topbar, .main-content > .content-area { display:none !important; }
.clean-workspace { display:flex; flex:1; min-width:0; min-height:0; flex-direction:column; background:#f3f5f7; }
.clean-menu-bar { display:flex; flex:0 0 60px; min-width:0; overflow-x:auto; border-bottom:1px solid #8da5b7; background:#e5ebf0; scrollbar-width:thin; }
.clean-menu-bar button { flex:1 0 100px; min-width:100px; padding:10px 14px; border:0; border-right:1px solid #c3ced7; background:transparent; color:#243b4d; cursor:pointer; font-family:Inter,"Noto Sans Arabic",sans-serif; letter-spacing:0; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.clean-menu-bar button:hover, .clean-menu-bar button:focus { background:#14558f; color:#fff; outline:0; }
.clean-menu-bar span, .clean-menu-bar b { display:block; line-height:1.15; }
.clean-menu-bar span { font-size:14.5px; font-weight:700; }
.clean-menu-bar b { margin-top:3px; font-size:13.5px; font-weight:600; direction:rtl; }
.clean-workspace-header { height:52px; flex:0 0 52px; display:flex; align-items:center; justify-content:space-between; padding:0 18px; border-bottom:1px solid #c4ced7; background:#fff; }
.clean-workspace-header h1 { margin:0; color:#1c3d56; font-size:16px; font-weight:700; letter-spacing:0; }
.clean-workspace-header span { display:block; margin-top:2px; color:#708393; font-size:10px; }
.clean-workspace-brand { color:#52697c; font-size:11px; font-weight:600; }
.clean-home-button { padding:0; border:0; background:transparent; text-align:left; cursor:pointer; }
.clean-workspace-canvas { flex:1; min-height:0; overflow:auto; padding:28px; background:#f3f5f7; }
.clean-module-grid { display:grid; grid-template-columns:repeat(3,minmax(170px,1fr)); gap:12px; max-width:900px; margin:0 auto; }
.clean-module { display:flex; align-items:center; gap:12px; min-height:92px; padding:14px; border:1px solid #bdcad5; border-radius:4px; background:#fff; color:#263f53; text-align:left; cursor:pointer; box-shadow:0 1px 2px rgba(29,51,68,.06); font-family:Inter,"Noto Sans Arabic",sans-serif; letter-spacing:0; }
.clean-module:hover, .clean-module:focus { border-color:#14558f; background:#f5faff; box-shadow:0 0 0 2px rgba(20,85,143,.1); outline:0; }
.clean-module-icon { display:grid; place-items:center; width:38px; height:38px; flex:0 0 38px; border-radius:4px; background:#14558f; color:#fff; font-size:11px; font-weight:800; }
.clean-module > span:last-child { min-width:0; }
.clean-module strong, .clean-module b { display:block; line-height:1.25; }
.clean-module strong { color:#243b4d; font-size:14px; direction:rtl; text-align:left; }
.clean-module b { margin-top:5px; color:#607586; font-size:11px; font-weight:600; direction:ltr; text-align:left; }
.main-content.clean-module-open > .clean-workspace { flex:0 0 60px; min-height:60px; }
.main-content.clean-module-open .clean-workspace-header, .main-content.clean-module-open .clean-workspace-canvas { display:none; }
.main-content.clean-module-open > .topbar { display:flex !important; }
.main-content.clean-module-open > .content-area { display:block !important; flex:1; }
.topbar { height: 48px; padding: 0 14px; border-bottom: 1px solid #aabcc9; background: #f8fafb; }
.content-area { padding: 12px; }
.card { border: 1px solid var(--oracle-line); border-radius: 3px; box-shadow: none; background: var(--oracle-panel); }
.card-header { min-height: 39px; padding: 8px 11px; background: var(--oracle-blue-soft); border-bottom-color: var(--oracle-line); }
.card-body { padding: 11px; }
.form-control, .search-input { min-height: 31px; border-radius: 2px; border-color: #8ea8bc; background: var(--oracle-field); padding: 5px 7px; }
.form-control:focus, .search-input:focus { border-color: #0b68ac; box-shadow: 0 0 0 2px rgba(20,85,143,.12); }
.form-label { font-size: 11px; color: #344b5f; margin-bottom: 3px; }
.btn { border-radius: 3px; min-height: 30px; padding: 5px 10px; }
.btn-primary { background: var(--oracle-blue); border-color: var(--oracle-blue-dark); }
table { background: white; }
th { background: #d9e6f0; color: #1d405e; border-color: #9eb5c6; padding: 6px 7px; }
td { border-color: #ccd7df; padding: 5px 7px; }
tbody tr:hover td { background: #edf5fb; }
.modal { border-radius: 3px; border: 1px solid #6f91ab; }
.modal-header { background: var(--oracle-blue); color: white; padding: 9px 12px; }
.modal-title { color: white; }

.oracle-menubar { height: 34px; display: flex; align-items: stretch; background: linear-gradient(#f9fbfc,#dbe5ed); border-bottom: 1px solid #8da5b7; padding-left: 8px; position: sticky; top: 0; z-index: 100; }
.oracle-menu { border: 0; border-right: 1px solid #c2ced7; background: transparent; padding: 0 10px; font: 600 11px Inter, sans-serif; color: #233b4e; cursor: pointer; }
.oracle-menu:hover, .oracle-menu:focus { background: var(--oracle-blue); color: white; outline: 0; }
.oracle-statusbar { position: fixed; left: 218px; right: 0; bottom: 0; height: 22px; z-index: 90; display: flex; align-items: center; justify-content: space-between; padding: 0 10px; background: #d7e1e8; border-top: 1px solid #9db0bf; color: #42596b; font-size: 10px; }
.content-area { padding-bottom: 34px; }

.oracle-dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 290px; min-height: calc(100vh - 130px); border: 1px solid var(--oracle-line); background: #f2f5f7; }
.oracle-dash-main { padding: 22px; }
.oracle-dash-heading { border-bottom: 2px solid var(--oracle-blue); padding-bottom: 8px; margin-bottom: 18px; color: #173e5c; }
.oracle-dash-heading h1 { font-size: 20px; margin: 0; letter-spacing: 0; }
.oracle-dash-heading p { font-size: 11px; margin: 4px 0 0; color: #64798a; }
.oracle-module-grid { display: grid; grid-template-columns: repeat(4,minmax(130px,1fr)); gap: 12px; }
.oracle-module { min-height: 108px; border: 1px solid #8eabc0; border-radius: 4px; background: white; padding: 14px 10px; text-align: center; cursor: pointer; color: #203b51; box-shadow: 0 1px 2px rgba(19,47,68,.08); }
.oracle-module:hover { border-color: var(--oracle-blue); background: #eef6fc; }
.oracle-module-icon { width: 38px; height: 38px; margin: 0 auto 8px; display: grid; place-items: center; border: 1px solid #83a6bf; background: #dcebf6; color: var(--oracle-blue-dark); font-size: 17px; font-weight: 800; border-radius: 3px; }
.oracle-module strong { display: block; font-size: 12px; }
.oracle-module small { display: block; color: #718493; font-size: 9px; margin-top: 3px; }
.oracle-side-panel { background: var(--oracle-blue-dark); color: white; padding: 24px 20px; border-left: 1px solid #082f53; }
.oracle-side-panel h2 { font-size: 21px; line-height: 1.35; letter-spacing: 0; margin: 16px 0 8px; }
.oracle-side-panel p { color: #c9deef; font-size: 11px; line-height: 1.6; }
.oracle-side-mark { width: 52px; height: 52px; display: grid; place-items: center; border: 2px solid #8dc4eb; font-size: 24px; font-weight: 800; }
.oracle-side-stats { margin-top: 28px; border-top: 1px solid #46759a; padding-top: 14px; font-size: 11px; }
.oracle-side-stat { display:flex; justify-content:space-between; padding:7px 0; border-bottom:1px solid #315f83; }

.oracle-form { border: 1px solid #7f9eb5; background: #edf1f4; }
.oracle-window-title { background: var(--oracle-blue); color: white; padding: 7px 10px; font-size: 12px; font-weight: 700; display:flex; justify-content:space-between; }
.oracle-toolbar { display:flex; flex-wrap:wrap; gap:4px; padding:6px; background:#dce5eb; border-bottom:1px solid #9db1c0; }
.oracle-toolbar button { min-height:27px; border:1px solid #879eaf; background:linear-gradient(#fff,#dce4ea); color:#203747; border-radius:2px; padding:3px 9px; font-size:10px; cursor:pointer; }
.oracle-toolbar button:hover { background:#cfe4f4; border-color:#3c78a5; }
.oracle-fieldset { padding: 10px; display:grid; grid-template-columns:repeat(4,minmax(120px,1fr)); gap:8px 10px; }
.oracle-field { display:flex; flex-direction:column; min-width:0; }
.oracle-field.span-2 { grid-column:span 2; }
.oracle-field input, .oracle-field select { min-width:0; height:29px; border:1px solid #829db1; border-radius:1px; background:var(--oracle-field); padding:3px 6px; font:12px Inter,sans-serif; }
.oracle-field label { color:#334e62; font-size:10px; font-weight:600; margin-bottom:2px; }
.oracle-grid-wrap { margin: 0 10px 10px; border:1px solid #8da8bb; background:white; overflow:auto; }
.oracle-grid { width:100%; border-collapse:collapse; table-layout:fixed; }
.oracle-grid th { position:sticky; top:0; z-index:1; font-size:10px; }
.oracle-grid td { padding:2px; }
.oracle-grid input { width:100%; min-width:55px; height:27px; border:1px solid transparent; background:#fffef0; padding:3px 5px; font:11px Inter,sans-serif; }
.oracle-grid input:focus { outline:1px solid #1670b4; border-color:#1670b4; }
.oracle-totals { margin:0 10px 10px auto; width:min(430px,calc(100% - 20px)); display:grid; grid-template-columns:1fr 140px; border:1px solid #8da8bb; background:white; }
.oracle-totals div { padding:5px 8px; border-bottom:1px solid #d3dde4; font-size:11px; }
.oracle-totals .value { text-align:right; font-weight:700; background:#f7fbfe; }
.oracle-totals .grand { background:#dcebf6; color:#103e62; font-size:13px; }
.bank-summary { display:grid; grid-template-columns:repeat(4,minmax(130px,1fr)); border-bottom:1px solid #9db0bf; background:#eef3f6; }
.bank-summary > div { padding:10px 12px; border-right:1px solid #c3ced7; }
.bank-summary span, .bank-summary strong { display:block; }
.bank-summary span { color:#607586; font-size:10px; text-transform:uppercase; }
.bank-summary strong { margin-top:4px; color:#173e5c; font-size:16px; font-variant-numeric:tabular-nums; }
.bank-entry-fields { border-bottom:1px solid #aebdca; }

.oracle-lov-backdrop { position:fixed; inset:0; z-index:12000; background:rgba(12,33,48,.35); display:grid; place-items:center; }
.oracle-lov { width:min(680px,94vw); max-height:78vh; background:#eef2f5; border:2px solid #225f8d; box-shadow:0 10px 30px rgba(0,0,0,.24); }
.oracle-lov-title { background:var(--oracle-blue); color:#fff; padding:8px 10px; font-size:12px; font-weight:700; }
.oracle-lov-search { padding:8px; border-bottom:1px solid #9eb2c1; }
.oracle-lov-search input { width:100%; height:31px; border:1px solid #7896aa; background:#fffef0; padding:5px 8px; }
.oracle-lov-list { max-height:360px; overflow:auto; background:white; }
.oracle-lov-row { display:grid; grid-template-columns:110px 1fr 120px; gap:8px; padding:7px 9px; border-bottom:1px solid #d2dce3; font-size:11px; cursor:pointer; }
.oracle-lov-row:hover, .oracle-lov-row.active { background:#cfe7f8; }
.oracle-lov-help { padding:6px 9px; color:#50687a; font-size:9px; border-top:1px solid #a9bbc8; }
.oracle-report-actions { display:flex; gap:6px; flex-wrap:wrap; margin:10px 0; }

@media (max-width: 1000px) {
    .oracle-module-grid { grid-template-columns: repeat(2,minmax(130px,1fr)); }
    .oracle-fieldset { grid-template-columns:repeat(2,minmax(120px,1fr)); }
}
@media (max-width: 720px) {
    .sidebar { display:none; }
    .main-content { margin-left:0; }
    .oracle-statusbar { left:0; }
    .oracle-statusbar { white-space:nowrap; overflow:hidden; }
    .oracle-statusbar span:last-child { display:none; }
    .oracle-menubar { overflow-x:auto; }
    .oracle-menu { flex:0 0 auto; }
    .topbar { padding:0 10px; height:43px; }
    .clean-workspace-header { height:48px; flex-basis:48px; padding:0 12px; }
    .clean-workspace-brand { font-size:10px; }
    .clean-menu-bar { flex-basis:55px; }
    .clean-menu-bar button { flex-basis:90px; min-width:90px; }
    .clean-workspace-canvas { padding:12px; }
    .clean-module-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .clean-module { min-height:88px; padding:10px; gap:8px; }
    .clean-module-icon { width:32px; height:32px; flex-basis:32px; }
    .clean-module strong, .clean-module b { font-size:10px; }
    .topbar-title { font-size:14px; line-height:1.15; }
    .topbar-date, .topbar .stat-chip, .topbar .sync-chip { display:none; }
    .content-area { padding:7px; }
    .oracle-dashboard { grid-template-columns:1fr; }
    .oracle-dash-main { padding:14px; }
    .oracle-side-panel { border-left:0; border-top:1px solid #082f53; }
    .oracle-module-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .oracle-fieldset { grid-template-columns:1fr; }
    .bank-summary { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .oracle-field.span-2 { grid-column:auto; }
}
