/* Cep Rapor — native mobile app shell */

:root {
  --rr-bg: #10151b;
  --rr-surface: #1a212b;
  --rr-surface-2: #232b36;
  --rr-border: rgba(255, 255, 255, 0.08);
  --rr-text: #f3f5f7;
  --rr-muted: #9aa4b2;
  --rr-accent: #2db8a8;
  --rr-accent-soft: rgba(45, 184, 168, 0.16);
  --rr-coral: #ff8f7a;
  --rr-coral-soft: rgba(255, 143, 122, 0.16);
  --rr-safe-top: env(safe-area-inset-top, 0px);
  --rr-safe-bottom: env(safe-area-inset-bottom, 0px);
  --rr-touch: 48px;
}

html:has(.rr-shell),
html:has(.rr-shell) body {
  background: var(--rr-bg) !important;
  overscroll-behavior-y: none;
  /* Cep Rapor rol teması — global primary'yi yeşil/teal'e ez */
  --primary: #2db8a8;
  --info: #3dceb8;
  --secondary: #1a212b;
  --rr-accent: #2db8a8;
  --rr-accent-soft: rgba(45, 184, 168, 0.16);
  scrollbar-width: thin !important;
  scrollbar-color: #2db8a8 #151b22 !important;
}

/* Scrollbar: yeşil tema (Chrome / Safari / Edge) */
html:has(.rr-shell) ::-webkit-scrollbar,
.rr-shell ::-webkit-scrollbar,
.rr-sheet-body ::-webkit-scrollbar,
.rr-detail-page .horizontal-scroll ::-webkit-scrollbar {
  width: 10px !important;
  height: 10px !important;
}

html:has(.rr-shell) ::-webkit-scrollbar-track,
.rr-shell ::-webkit-scrollbar-track,
.rr-sheet-body ::-webkit-scrollbar-track,
.rr-detail-page .horizontal-scroll ::-webkit-scrollbar-track {
  background: #151b22 !important;
  border-radius: 999px !important;
}

html:has(.rr-shell) ::-webkit-scrollbar-thumb,
.rr-shell ::-webkit-scrollbar-thumb,
.rr-sheet-body ::-webkit-scrollbar-thumb,
.rr-detail-page .horizontal-scroll ::-webkit-scrollbar-thumb {
  background: #2db8a8 !important;
  border-radius: 999px !important;
  border: 2px solid #151b22 !important;
}

html:has(.rr-shell) ::-webkit-scrollbar-thumb:hover,
.rr-shell ::-webkit-scrollbar-thumb:hover,
.rr-sheet-body ::-webkit-scrollbar-thumb:hover,
.rr-detail-page .horizontal-scroll ::-webkit-scrollbar-thumb:hover {
  background: #4ad4c4 !important;
}

html:has(.rr-shell) ::-webkit-scrollbar-corner,
.rr-shell ::-webkit-scrollbar-corner {
  background: #151b22 !important;
}

.rr-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(45, 184, 168, 0.12), transparent 50%),
    radial-gradient(100% 70% at 100% 0%, rgba(255, 143, 122, 0.08), transparent 45%),
    var(--rr-bg);
  color: var(--rr-text);
  padding-bottom: var(--rr-safe-bottom);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  scrollbar-width: thin;
  scrollbar-color: #2db8a8 #151b22;
}

.rr-sheet-body,
.rr-detail-page .horizontal-scroll,
.rr-page {
  scrollbar-width: thin;
  scrollbar-color: #2db8a8 #151b22;
}

.rr-appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  min-height: calc(3.4rem + var(--rr-safe-top));
  height: auto !important;
  margin: 0 !important;
  padding: calc(0.55rem + var(--rr-safe-top)) 0.9rem 0.65rem 0.9rem !important;
  background: rgba(26, 33, 43, 0.92) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rr-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.rr-appbar-left,
.rr-appbar-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: var(--rr-touch);
}

.rr-appbar-left { justify-content: flex-start; }
.rr-appbar-right { justify-content: flex-end; }

.rr-appbar-title {
  margin: 0;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
  color: var(--rr-text) !important;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--rr-touch);
  height: var(--rr-touch);
  border-radius: 14px;
  background: var(--rr-surface-2);
  border: 1px solid var(--rr-border);
  color: var(--rr-text);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.rr-icon-btn:active {
  transform: scale(0.96);
  background: var(--rr-accent-soft);
}

.rr-icon-btn i {
  font-size: 1.05rem !important;
  color: inherit !important;
}

.rr-page {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 0.85rem 0.9rem calc(1.5rem + var(--rr-safe-bottom));
  box-sizing: border-box;
}

.rr-page-wide {
  max-width: 960px;
}

.rr-hero {
  margin: 0.25rem 0 0.9rem;
}

.rr-hero-kicker {
  display: block;
  color: var(--rr-muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.rr-hero-title {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--rr-text);
}

.rr-segment {
  display: flex;
  gap: 0.35rem;
  padding: 0.3rem;
  margin-bottom: 0.95rem;
  border-radius: 16px;
  background: var(--rr-surface);
  border: 1px solid var(--rr-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rr-segment::-webkit-scrollbar { display: none; }

.rr-chip {
  flex: 1 0 auto;
  min-width: max-content;
  min-height: 2.4rem;
  padding: 0.45rem 0.95rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--rr-muted);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.rr-chip.active {
  background: var(--rr-accent);
  color: #0b1b1a;
  box-shadow: 0 6px 16px rgba(45, 184, 168, 0.28);
}

.rr-branch-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.rr-branch-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 4.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--rr-border);
  border-radius: 16px;
  background: linear-gradient(160deg, var(--rr-surface-2), var(--rr-surface));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.rr-branch-card:active {
  transform: scale(0.985);
}

.rr-branch-meta {
  min-width: 0;
  flex: 1;
}

.rr-branch-name {
  display: block;
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--rr-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-branch-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--rr-muted);
  font-weight: 600;
}

.rr-amount-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  min-height: 2.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--rr-coral-soft);
  color: var(--rr-coral);
  font-size: 0.9rem;
  font-weight: 800;
}

.rr-branch-chevron {
  color: var(--rr-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.rr-total-bar {
  position: sticky;
  bottom: calc(0.65rem + var(--rr-safe-bottom));
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.95rem 1.05rem;
  border-radius: 18px;
  background: rgba(35, 43, 54, 0.94);
  border: 1px solid var(--rr-border);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.rr-total-label {
  color: var(--rr-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rr-total-value {
  color: var(--rr-text);
  font-size: 1.2rem;
  font-weight: 800;
}

.rr-filter-card {
  padding: 0.95rem;
  margin-bottom: 0.95rem;
  border-radius: 18px;
  background: var(--rr-surface);
  border: 1px solid var(--rr-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.rr-filter-card .rr-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.95rem;
}

.rr-filter-card .rr-field:last-child {
  margin-bottom: 0;
}

.rr-filter-card .rr-field-label {
  margin: 0;
  padding: 0 0.2rem;
  color: var(--rr-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Sheet trigger fields */
.rr-sheet-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.45rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--rr-border);
  background: var(--rr-surface-2);
  color: var(--rr-text);
  font-size: 1.05rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.rr-sheet-trigger:active {
  transform: scale(0.985);
  border-color: rgba(45, 184, 168, 0.55);
  box-shadow: 0 0 0 3px var(--rr-accent-soft);
}

.rr-sheet-trigger-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rr-sheet-trigger-icon {
  color: var(--rr-accent);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Bottom sheet */
.rr-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.rr-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 22px 22px 0 0;
  background: var(--rr-surface);
  border: 1px solid var(--rr-border);
  border-bottom: 0;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.45);
  padding-bottom: calc(0.75rem + var(--rr-safe-bottom));
  animation: rr-sheet-up 0.22s ease-out;
}

@keyframes rr-sheet-up {
  from { transform: translateY(110%); }
  to { transform: translateY(0); }
}

.rr-sheet-handle {
  width: 42px;
  height: 5px;
  margin: 0.55rem auto 0.25rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.rr-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem 0.75rem;
  border-bottom: 1px solid var(--rr-border);
}

.rr-sheet-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--rr-text);
}

.rr-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 12px;
  background: var(--rr-surface-2);
  color: var(--rr-text);
  cursor: pointer;
}

.rr-sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.55rem 0.75rem 0.85rem;
}

.rr-sheet-empty {
  padding: 1.5rem 0.75rem;
  text-align: center;
  color: var(--rr-muted);
  font-weight: 650;
}

.rr-sheet-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.35rem;
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.4rem;
  border-radius: 14px;
  border: 1px solid var(--rr-border);
  background: var(--rr-surface-2);
  color: var(--rr-text);
  font-size: 1.02rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.rr-sheet-option.active {
  border-color: rgba(45, 184, 168, 0.55);
  background: var(--rr-accent-soft);
  color: #9ff3e9;
}

.rr-sheet-option i {
  color: var(--rr-accent);
}

.rr-cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.rr-cal-month {
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: capitalize;
  color: var(--rr-text);
}

.rr-cal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 12px;
  background: var(--rr-surface-2);
  color: var(--rr-text);
  cursor: pointer;
}

.rr-cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.rr-cal-week span {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--rr-muted);
  padding: 0.25rem 0;
}

.rr-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
}

.rr-cal-day {
  aspect-ratio: 1;
  min-height: 2.7rem;
  border: 0;
  border-radius: 12px;
  background: var(--rr-surface-2);
  color: var(--rr-text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.rr-cal-day.empty {
  background: transparent;
  pointer-events: none;
}

.rr-cal-day.today {
  box-shadow: inset 0 0 0 1px rgba(45, 184, 168, 0.55);
}

.rr-cal-day.selected {
  background: var(--rr-accent);
  color: #0b1b1a;
}

.rr-cal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.rr-cal-action {
  min-height: 3rem;
  border: 1px solid var(--rr-border);
  border-radius: 14px;
  background: var(--rr-surface-2);
  color: var(--rr-text);
  font-size: 0.98rem;
  font-weight: 750;
  cursor: pointer;
}

.rr-cal-action.primary {
  border-color: transparent;
  background: var(--rr-accent);
  color: #0b1b1a;
}

.rr-section-label {
  margin: 0.35rem 0 0.65rem;
  color: var(--rr-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rr-nav-list {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
  background: var(--rr-surface);
  border: 1px solid var(--rr-border);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.rr-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: var(--rr-touch);
  padding: 0.95rem 1rem;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rr-border);
  color: var(--rr-text);
  text-align: left;
  cursor: pointer;
}

.rr-nav-item:last-child {
  border-bottom: 0;
}

.rr-nav-item:active {
  background: var(--rr-accent-soft);
}

.rr-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 12px;
  background: var(--rr-accent-soft);
  color: var(--rr-accent);
  flex-shrink: 0;
}

.rr-nav-icon i {
  font-size: 0.95rem;
}

.rr-nav-label {
  flex: 1;
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.25;
}

.rr-nav-chevron {
  color: var(--rr-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Report detail — larger readable tables */
.rr-detail-page p,
.rr-detail-page p.mx-5,
.rr-detail-page p.mx-lg-0 {
  margin: 1.15rem 0 0.7rem !important;
  padding: 0 0.2rem !important;
  color: var(--rr-text) !important;
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  text-align: left !important;
  letter-spacing: 0.01em;
}

.rr-detail-page .horizontal-scroll {
  margin-bottom: 1.25rem;
  border-radius: 16px;
  border: 1px solid var(--rr-border);
  background: var(--rr-surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rr-detail-page .hover-table,
.rr-detail-page .table-c {
  margin: 0 !important;
  min-width: 640px;
  width: 100%;
}

.rr-detail-page .thead-dark {
  background: var(--rr-surface-2) !important;
  color: var(--rr-text) !important;
  height: auto !important;
  position: sticky;
  top: 0;
  z-index: 2;
}

.rr-detail-page .thead-dark th {
  padding: 1rem 0.9rem !important;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
  white-space: nowrap;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--rr-border) !important;
}

.rr-detail-page .table-h,
.rr-detail-page tbody.table-h {
  height: auto !important;
}

.rr-detail-page .tr-row {
  height: auto !important;
  min-height: 3.5rem;
}

.rr-detail-page .tr-row td,
.rr-detail-page .table-c td {
  padding: 1rem 0.9rem !important;
  font-size: 1.05rem !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  color: #ffc2b4 !important;
  vertical-align: middle !important;
  white-space: nowrap;
}

.rr-detail-page tfoot td {
  padding: 1rem 0.9rem !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
}

.rr-detail-page tfoot tr {
  background: #2a3340 !important;
}

/* Legacy class bridges used inside old markup */
.rr-shell .menu-text { color: var(--rr-coral) !important; }
.rr-shell .price-text {
  background: var(--rr-coral-soft) !important;
  color: var(--rr-coral) !important;
  border-radius: 999px !important;
}
.rr-shell .line { background: var(--rr-border); }
.rr-shell .menu-table { color: var(--rr-muted) !important; filter: none; }

@media (min-width: 768px) {
  .rr-page { padding-top: 1.1rem; }
  .rr-appbar-title { font-size: 1.15rem !important; }
}

@media (min-width: 992px) {
  .rr-page { max-width: 720px; }
  .rr-page-wide { max-width: 1100px; }
}
