/* JolfaCloud client theme — brand layer on top of Huraga (Bootstrap 5).
   Palette and type follow mockups/client-area.html. RTL comes from the
   rtlcss-flipped *.rtl.css builds loaded by the layouts. */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-wght.woff2") format("woff2-variations"), url("../fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root, [data-bs-theme=light] {
  --jc-charcoal: #1F3A3D; --jc-deep: #132628; --jc-steel: #2E4A4E; --jc-pale: #D2E0E0; --jc-cloud: #A9C2C4;
  --jc-accent: #08706A; --jc-accent-hi: #0F9A93; --jc-accent-lo: #065A55;
  --jc-bg: #F3F7F6; --jc-line: #DCE6E5;

  --bs-font-sans-serif: "Vazirmatn", Tahoma, "Segoe UI", system-ui, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-body-font-size: .95rem;
  --bs-body-line-height: 1.75;
  --bs-body-color: #1F3A3D;
  --bs-body-bg: var(--jc-bg);
  --bs-secondary-color: #4B6B6F;
  --bs-border-color: var(--jc-line);
  --bs-border-radius: .6rem;
  --bs-border-radius-lg: .875rem;
  --bs-primary: #08706A; --bs-primary-rgb: 8, 112, 106;
  --bs-primary-text-emphasis: #065A55; --bs-primary-bg-subtle: #E3ECEB; --bs-primary-border-subtle: #A9C2C4;
  --bs-link-color: #08706A; --bs-link-color-rgb: 8, 112, 106;
  --bs-link-hover-color: #065A55; --bs-link-hover-color-rgb: 6, 90, 85;
  --bs-focus-ring-color: rgba(8, 112, 106, .25);
}

[data-bs-theme=dark] {
  --jc-bg: #0F1E20; --jc-line: #2E4A4E;
  --bs-body-bg: var(--jc-bg);
  --bs-body-color: #E3ECEB;
  --bs-secondary-color: #A9C2C4;
  --bs-border-color: var(--jc-line);
  --bs-tertiary-bg: #132628;
  --bs-primary: #0F9A93; --bs-primary-rgb: 15, 154, 147;
  --bs-link-color: #4FC4BC; --bs-link-color-rgb: 79, 196, 188;
  --bs-link-hover-color: #7FD8D1; --bs-link-hover-color-rgb: 127, 216, 209;
}

body { font-family: var(--bs-body-font-family); }
code, kbd, pre, samp, .font-monospace { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; }
/* Numbers, emails, domains and codes stay readable left-to-right inside RTL text. */
[dir=rtl] input[type=email], [dir=rtl] input[type=tel], [dir=rtl] input[type=url], [dir=rtl] input[type=password],
[dir=rtl] input[name*=domain], [dir=rtl] input[name=sld] { direction: ltr; text-align: right; }

/* Buttons */
.btn-primary {
  --bs-btn-bg: #08706A; --bs-btn-border-color: #08706A;
  --bs-btn-hover-bg: #065A55; --bs-btn-hover-border-color: #065A55;
  --bs-btn-active-bg: #054A46; --bs-btn-active-border-color: #054A46;
  --bs-btn-disabled-bg: #08706A; --bs-btn-disabled-border-color: #08706A;
  --bs-btn-focus-shadow-rgb: 8, 112, 106;
  font-weight: 600;
}
.btn-outline-primary {
  --bs-btn-color: #08706A; --bs-btn-border-color: #08706A;
  --bs-btn-hover-bg: #08706A; --bs-btn-hover-border-color: #08706A;
  --bs-btn-active-bg: #065A55; --bs-btn-active-border-color: #065A55;
  font-weight: 600;
}
[data-bs-theme=dark] .btn-outline-primary { --bs-btn-color: #4FC4BC; --bs-btn-border-color: #0F9A93; }
.btn { border-radius: .6rem; }
.form-control, .form-select { border-radius: .6rem; }
.form-control:focus, .form-select:focus { border-color: #0F9A93; box-shadow: 0 0 0 .2rem rgba(8, 112, 106, .18); }
.form-check-input:checked { background-color: #08706A; border-color: #08706A; }
.page-link { color: #08706A; }
.active > .page-link, .page-link.active { background-color: #08706A; border-color: #08706A; }
.text-primary { color: #08706A !important; }
.bg-primary { background-color: #08706A !important; }
.badge.bg-primary, .badge.text-bg-primary { background-color: #08706A !important; }

/* Cards: flat, soft border, rounded like the mockup */
.card {
  --bs-card-border-color: var(--jc-line);
  --bs-card-border-radius: .875rem;
  --bs-card-inner-border-radius: calc(.875rem - 1px);
  --bs-card-cap-bg: transparent;
  box-shadow: 0 1px 2px rgba(19, 38, 40, .04);
}
.card-header { font-weight: 700; }
.table { --bs-table-bg: transparent; }
.table > thead th { color: var(--bs-secondary-color); font-weight: 600; font-size: .85rem; }

/* Header */
header .navbar { padding-block: 1rem !important; }
header .navbar-brand img { height: 40px; width: auto; }
header .navbar-brand span { font-weight: 800; color: var(--jc-charcoal); }
[data-bs-theme=dark] header .navbar-brand span { color: #E3ECEB; }
/* The light logo has dark text; in dark mode give it a light plate so it stays legible. */
[data-bs-theme=dark] header .navbar-brand img.hide-theme-light { background: #E3ECEB; border-radius: .6rem; padding: 3px 8px; }

/* Side menu: dark panel with teal active item (desktop) */
@media (min-width: 768px) {
  #sidebarMenu {
    background-color: var(--jc-charcoal) !important; /* .offcanvas-md forces transparent !important */
    border-radius: .875rem;
    padding: .75rem;
    position: sticky;
    top: 1rem;
  }
  #sidebarMenu .nav-item, #sidebarMenu .nav-item.active { background: none !important; }
  #sidebarMenu .nav-link { color: var(--jc-pale); border-radius: .6rem; padding: .6rem .75rem; font-weight: 500; }
  #sidebarMenu .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  #sidebarMenu .nav-link.active, #sidebarMenu .nav-item.active > .nav-link { background: var(--jc-accent) !important; color: #fff !important; }
  #sidebarMenu .icon { opacity: .9; }
  #sidebarMenu hr { border-color: rgba(255, 255, 255, .12); }
  #sidebarMenu .text-body-secondary, #sidebarMenu small { color: var(--jc-cloud) !important; }
  #sidebarMenu, #sidebarMenu h1, #sidebarMenu h2, #sidebarMenu h3, #sidebarMenu h4, #sidebarMenu h5, #sidebarMenu h6, #sidebarMenu .card, #sidebarMenu .card-body { color: #fff; background: transparent; border-color: rgba(255,255,255,.12); }
}

/* Login / signup (public layout) */
.layout-public, body:has(.auth-form) { background: linear-gradient(160deg, #E3ECEB 0%, #F3F7F6 55%); }
[data-bs-theme=dark] body:has(.auth-form) { background: var(--jc-bg); }

/* Alerts tinted to the palette */
.alert-info { --bs-alert-bg: #E3ECEB; --bs-alert-border-color: #A9C2C4; --bs-alert-color: #1F3A3D; }
[data-bs-theme=dark] .alert-info { --bs-alert-bg: #132628; --bs-alert-border-color: #2E4A4E; --bs-alert-color: #E3ECEB; }

/* RTL details rtlcss can't know about */
[dir=rtl] .dropdown-toggle::after { margin-inline-start: .3em; margin-left: 0; }
[dir=rtl] .breadcrumb-item + .breadcrumb-item::before { float: right; padding-left: var(--bs-breadcrumb-item-padding-x); padding-right: 0; }
[dir=rtl] .icon-arrow-right, [dir=rtl] use[href="#arrow-right"], [dir=rtl] use[href="#chevron-right"] { transform: scaleX(-1); transform-origin: center; }

/* Spam honeypot fields are pushed off-screen with left:-9999px; in RTL that
   widens the page sideways, so hide them by clipping instead. */
div[style*="-9999px"] { left: 0 !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* Dashboard (html/mod_index_dashboard.html.twig) */
.jc-todo-item { display: flex; align-items: center; gap: .75rem; padding-block: .8rem; }
.jc-dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; background: #0F9A93; }
.jc-bad .jc-dot { background: #D93C41; }
.jc-warn .jc-dot { background: #B7791F; }
.jc-allgood { border-color: #A9C2C4; background: #E3ECEB; }
[data-bs-theme=dark] .jc-allgood { background: #132628; border-color: #2E4A4E; }
.jc-service { transition: border-color .15s; }
.jc-service:hover { border-color: #0F9A93; }
.jc-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.jc-stats small { display: block; color: var(--bs-secondary-color); font-size: .8rem; }
.jc-stats b { font-size: 1.1rem; }
.jc-mono { font-family: "JetBrains Mono", ui-monospace, Consolas, monospace; font-size: .9rem; }
.jc-chip { display: inline-block; padding: .4rem .85rem; border-radius: 999px; background: #E3ECEB; color: #065A55; text-decoration: none; font-weight: 500; font-size: .9rem; }
.jc-chip:hover { background: #D2E0E0; color: #065A55; }
[data-bs-theme=dark] .jc-chip { background: #132628; color: #7FD8D1; }

/* Wallet (html/mod_client_balance.html.twig) */
.jc-wallet { background: linear-gradient(150deg, #1F3A3D 0%, #132628 100%); border: 0; color: #fff; }
.jc-wallet-label { color: var(--jc-cloud); }
.jc-wallet-amount { font-size: 1.9rem; font-weight: 800; line-height: 1.3; }
.jc-pos { color: #1E7F4F; }
.jc-neg { color: #C2353A; }
[data-bs-theme=dark] .jc-pos { color: #5FD39A; }
[data-bs-theme=dark] .jc-neg { color: #F08A8E; }

/* Mobile bottom bar (html/partial_bottom_nav.html.twig) */
.jc-bottom-nav { display: none; }
@media (max-width: 767.98px) {
  .jc-bottom-nav {
    display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 1030;
    background: var(--jc-charcoal); padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
  }
  .jc-bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem; color: var(--jc-cloud); text-decoration: none; font-size: .72rem; padding: .3rem 0; border-radius: .5rem; }
  .jc-bottom-nav a.active { color: #fff; background: rgba(15, 154, 147, .35); }
  .jc-bottom-nav .icon { width: 1.3rem; height: 1.3rem; }
  body.has-bottom-nav { padding-bottom: 4.5rem; }
}
