/* SeaBorne backoffice iskeleti (müşteri portalı görünümü: sol menü + üst bar) */
:root {
  --bo-navy: #0b2a4a;
  --bo-navy-2: #12406b;
  --bo-accent: #1b7fd1;
  --bo-bg: #f4f6f9;
  --bo-border: #e3e8ef;
  --bo-muted: #6b7a8c;
  --bo-sidebar-w: 260px;
}
[data-theme="dark"] {
  --bo-bg: #121212;
  --bo-border: #333;
  --bo-muted: #9aa5b1;
}

body.bo { background: var(--bo-bg); }

/* --- Sol menü ----------------------------------------------------------- */
.bo-sidebar {
  background: linear-gradient(180deg, var(--bo-navy) 0%, var(--bo-navy-2) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
}
@media (min-width: 992px) {
  .bo-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--bo-sidebar-w);
    z-index: 1030;
  }
  body.bo-auth .bo-main { margin-left: var(--bo-sidebar-w); }
}
@media (max-width: 991.98px) {
  .bo-sidebar.offcanvas-lg { width: 290px; background: linear-gradient(180deg, var(--bo-navy) 0%, var(--bo-navy-2) 100%); }
}
.bo-brand {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem 1.25rem .75rem;
}
.bo-brand .btn-close { position: absolute; top: 1rem; right: 1rem; }
.bo-brand a { display: block; }
.bo-logo { display: block; height: 46px; width: auto; max-width: 100%; }
.bo-user {
  margin: 0 1rem .75rem; padding: .65rem .9rem; text-align: center;
  background: rgba(255,255,255,.08); border-radius: .6rem;
}
.bo-user small { color: rgba(255,255,255,.6); text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; }

.bo-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 .75rem .75rem; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.bo-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.bo-nav a, .bo-nav .bo-locked {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .85rem; border-radius: .5rem;
  color: rgba(255,255,255,.8); text-decoration: none; font-size: .92rem;
}
.bo-nav a > i:first-child, .bo-nav .bo-locked > i:first-child { width: 1.2rem; text-align: center; flex: 0 0 auto; }
.bo-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.bo-nav a.active { background: #fff; color: var(--bo-navy); font-weight: 600; }
.bo-nav .bo-locked { opacity: .5; cursor: not-allowed; }
.bo-nav .bo-locked .fa-lock { margin-left: auto; font-size: .75rem; }

/* Açılır gruplar */
.bo-nav .bo-group-toggle .bo-chevron { margin-left: auto; font-size: .7rem; transition: transform .2s; }
.bo-nav .bo-group-toggle[aria-expanded="true"] .bo-chevron { transform: rotate(180deg); }
.bo-nav .bo-group-toggle[aria-expanded="true"] { color: #fff; }
.bo-nav .bo-sub { margin: 2px 0 4px 1.1rem; padding-left: .3rem; border-left: 2px solid rgba(255,255,255,.18); }
.bo-nav .bo-sub a, .bo-nav .bo-sub .bo-locked { padding: .42rem .7rem; font-size: .87rem; }
.bo-nav .bo-sub .bo-sub { margin-left: .6rem; }
.bo-nav .bo-sub a > i:first-child, .bo-nav .bo-sub .bo-locked > i:first-child { width: 1rem; }
.bo-nav .bo-sub a, .bo-nav .bo-sub .bo-locked { gap: .55rem; }
.bo-nav .bo-divider { border-top: 1px solid rgba(255,255,255,.15); margin: .35rem .5rem; }

.bo-sidebar-footer { padding: .85rem 1.25rem; color: rgba(255,255,255,.55); font-size: .75rem; border-top: 1px solid rgba(255,255,255,.1); }
.bo-sidebar-footer a { color: rgba(255,255,255,.75); text-decoration: none; }
.bo-sidebar-footer .badge { background: rgba(255,255,255,.15); font-weight: 500; }

/* --- Üst bar ------------------------------------------------------------ */
.bo-topbar {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem 1.5rem; z-index: 1020;
  background: #fff; border-bottom: 1px solid var(--bo-border);
}
.bo-topbar-brand img { height: 30px; width: auto; }
/* Giriş yapmış kullanıcıda üst bar logosu: tablet genişliğinde ve masaüstünde menü kapalıyken */
.bo-topbar-brand-auth { display: none; }
@media (min-width: 576px) and (max-width: 991.98px) { .bo-topbar-brand-auth { display: inline; } }

/* Masaüstünde sol menüyü kapatma (html.bo-nav-collapsed, tercih localStorage'da) */
@media (min-width: 992px) {
  html.bo-nav-collapsed .bo-sidebar { transform: translateX(-100%) !important; }
  html.bo-nav-collapsed body.bo-auth .bo-main { margin-left: 0; }
  html.bo-nav-collapsed .bo-topbar-brand-auth { display: inline; }
  html.bo-nav-animate .bo-sidebar { transition: transform .25s ease; }
  html.bo-nav-animate body.bo-auth .bo-main { transition: margin-left .25s ease; }
}
.bo-topbar .btn-outline-light {
  color: #33465a; border-color: transparent; background: transparent;
}
.bo-topbar .btn-outline-light:hover,
.bo-topbar .btn-outline-light:focus,
.bo-topbar .btn-outline-light.show { color: var(--bo-navy); background: #eef2f7; border-color: transparent; }
.bo-topbar .bo-icon-btn {
  color: #33465a; background: transparent; border: 0; border-radius: .4rem;
  padding: .3rem .55rem; position: relative; text-decoration: none; line-height: 1.5;
}
.bo-topbar .bo-icon-btn:hover { background: #eef2f7; color: var(--bo-navy); }
.bo-topbar .bo-icon-btn .badge { font-size: .62rem; }
.bo-topbar .dropdown-menu { font-size: .9rem; }
.bo-user-menu { min-width: 260px; max-height: 80vh; overflow-y: auto; }

[data-theme="dark"] .bo-topbar { background: #1a1a1a; border-bottom-color: var(--bo-border); }
[data-theme="dark"] .bo-topbar .btn-outline-light,
[data-theme="dark"] .bo-topbar .bo-icon-btn { color: #e6e6e6; }
[data-theme="dark"] .bo-topbar .btn-outline-light:hover,
[data-theme="dark"] .bo-topbar .btn-outline-light.show,
[data-theme="dark"] .bo-topbar .bo-icon-btn:hover { background: #2d2d2d; color: #fff; }
[data-theme="dark"] .bo-topbar .btn-light { background: #2d2d2d; border-color: #2d2d2d; color: #fff; }

/* --- İçerik ------------------------------------------------------------- */
.bo-content { padding: 1.5rem; }
.bo-content > .bo-container { max-width: 1600px; padding: 0; margin: 0 auto; }
body:not(.bo-auth) .bo-content > .bo-container { max-width: 1140px; }
@media (max-width: 575.98px) {
  .bo-content { padding: 1rem .75rem; }
  .bo-topbar { padding: .5rem .75rem; }
}

/* KPI kartları (ana sayfa özeti): beyaz kart + yumuşak renkli ikon kutusu */
.bo-kpi {
  height: 100%; display: flex; gap: .85rem; align-items: flex-start;
  padding: .85rem 1rem; background: #fff; color: #1f2d3d; text-decoration: none;
  border: 1px solid var(--bo-border); border-radius: .75rem;
  box-shadow: 0 1px 2px rgba(16,40,70,.04); transition: box-shadow .15s, transform .15s;
}
a.bo-kpi:hover { color: #1f2d3d; box-shadow: 0 6px 16px rgba(16,40,70,.08); transform: translateY(-1px); }
.bo-kpi-icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: .65rem;
  display: grid; place-items: center; font-size: 1.1rem;
}
.bo-kpi-icon.blue { background: #e7f1fb; color: #1b7fd1; }
.bo-kpi-icon.green { background: #e6f6ee; color: #198754; }
.bo-kpi-icon.teal { background: #e3f5f7; color: #0f8a9d; }
.bo-kpi-icon.amber { background: #fff4e0; color: #c77700; }
.bo-kpi-body { flex: 1; min-width: 0; }
.bo-kpi-label { color: var(--bo-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.bo-kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin-top: .1rem; }
.bo-kpi-amounts { font-variant-numeric: tabular-nums; }
.bo-soft-amber { background: #fff4e0; color: #9a5c00; }
.bo-soft-red { background: #fdecec; color: #b02a37; }
[data-theme="dark"] .bo-kpi, [data-theme="dark"] a.bo-kpi:hover { background: #1e1e1e; color: #e6e6e6; }
[data-theme="dark"] .bo-kpi .text-muted { color: var(--bo-muted) !important; }
[data-theme="dark"] .bo-kpi-icon.blue { background: rgba(27,127,209,.18); color: #6cb2ec; }
[data-theme="dark"] .bo-kpi-icon.green { background: rgba(25,135,84,.2); color: #5fcf98; }
[data-theme="dark"] .bo-kpi-icon.teal { background: rgba(15,138,157,.2); color: #5cc7d6; }
[data-theme="dark"] .bo-kpi-icon.amber { background: rgba(199,119,0,.2); color: #f0b453; }

/* --- Kayıt formları (tekne, müşteri ...): sayfa başlığı + bölüm kartları ---------------------- */
.bo-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.bo-page-head h1 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.bo-page-head .bo-page-sub { color: var(--bo-muted); font-size: .85rem; margin-top: .15rem; }
.bo-form-section {
  background: #fff; border: 1px solid var(--bo-border); border-radius: .75rem;
  box-shadow: 0 1px 2px rgba(16,40,70,.04); height: 100%;
}
.bo-form-section-head {
  display: flex; align-items: center; gap: .55rem;
  padding: .7rem 1.1rem; border-bottom: 1px solid var(--bo-border);
  font-size: .95rem; font-weight: 600;
}
.bo-form-section-head i { color: var(--bo-accent); width: 1.1rem; text-align: center; }
.bo-form-section-body { padding: 1rem 1.1rem 1.1rem; }
.bo-form .form-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  font-size: .78rem; font-weight: 600; color: #4a5a6c; margin-bottom: .3rem;
}
.bo-form .form-label .bo-req { color: #c0392b; margin-left: .15rem; }
.bo-form .form-label .bo-add-link { font-size: .74rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.bo-form .form-control, .bo-form .form-select { font-size: .9rem; }
.bo-form .bo-field-error { color: #c0392b; font-size: .78rem; margin-top: .25rem; }
.bo-form .is-invalid + .select2-container .select2-selection { border-color: #dc3545; }
.bo-form .select2-container { width: 100% !important; font-size: .9rem; }
.bo-form-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 1rem; }
[data-theme="dark"] .bo-form-section { background: #1e1e1e; }
[data-theme="dark"] .bo-form .form-label { color: #c5ccd4; }

/* --- Kayıt pencereleri (.bo-modal): beyaz başlık, gri gövde üzerinde bölüm kartları, toplamlı alt bar --- */
.bo-modal .modal-content { border: 0; border-radius: .85rem; box-shadow: 0 20px 50px rgba(16,40,70,.25); overflow: hidden; }
.bo-modal .modal-header { background: #fff; border-bottom: 1px solid var(--bo-border); padding: .85rem 1.25rem; }
.bo-modal .modal-title { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: .55rem; }
.bo-modal .modal-title i { color: var(--bo-accent); }
.bo-modal .modal-body { background: var(--bo-bg); padding: 1rem 1.25rem; }
.bo-modal .modal-footer { background: #fff; border-top: 1px solid var(--bo-border); padding: .7rem 1.25rem; }
.bo-modal-section { background: #fff; border: 1px solid var(--bo-border); border-radius: .65rem; padding: .85rem 1rem 1rem; }
.bo-modal-section + .bo-modal-section { margin-top: .85rem; }
.bo-modal-section-head {
  display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem;
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--bo-muted);
}
.bo-modal-section-head i { color: var(--bo-accent); }
.bo-modal .form-label { font-size: .78rem; font-weight: 600; color: #4a5a6c; margin-bottom: .25rem; }
.bo-modal .form-label .bo-req { color: #c0392b; margin-left: .15rem; }
.bo-modal-total { display: flex; flex-direction: column; line-height: 1.15; }
.bo-modal-total .label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--bo-muted); }
.bo-modal-total .value { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .bo-modal .modal-header, [data-theme="dark"] .bo-modal .modal-footer, [data-theme="dark"] .bo-modal-section { background: #1e1e1e; }
[data-theme="dark"] .bo-modal .form-label { color: #c5ccd4; }

/* Muhasebe tabloları: kenarlıklı, yatayda kendi içinde kayan kutu */
.acc-table-wrap {
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: .375rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}
.acc-table-wrap > table { margin-bottom: 0; }
.acc-table-wrap tfoot td { font-weight: 600; background: var(--bs-light, #f8f9fa); white-space: nowrap; }

@media print {
  .bo-sidebar, .bo-topbar { display: none !important; }
  body.bo-auth .bo-main { margin-left: 0 !important; }
  body.bo { background: #fff; }
  .bo-content { padding: 0; }
}
