html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 14px;
  }
}

/* ========== EBYS design tokens ========== */
:root {
  --ebys-brand: #003366;
  --ebys-brand-2: #0a4d8c;
  --ebys-brand-3: #1a6fb5;
  --ebys-surface: #f8fafc;
  --ebys-border: rgba(0, 0, 0, 0.06);
  --ebys-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
  --ebys-radius: 0.5rem;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #fcfcfd;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Layout shell */
.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ebys-brand) !important;
}

.navbar .nav-link {
  font-size: 0.9rem;
}

.ebys-main {
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

/* Page chrome */
.ebys-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ebys-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  line-height: 1.3;
}

.ebys-page-subtitle {
  color: #6c757d;
  font-size: 0.875rem;
  margin-top: 0.15rem;
}

.ebys-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Cards / filters / tables */
.ebys-filter-card .card-header,
.card.ebys-filter-card .card-header {
  font-weight: 600;
  background: var(--ebys-surface);
}

.ebys-panel > .card-header {
  background: var(--ebys-surface);
  border-bottom: 1px solid var(--ebys-border);
}

.ebys-table {
  font-size: 0.875rem;
}

.ebys-table thead th {
  white-space: nowrap;
  background: var(--ebys-surface);
  font-weight: 600;
  font-size: 0.8rem;
}

.ebys-empty-state {
  text-align: center;
  color: #6c757d;
  padding: 2rem 1rem;
}

.ebys-empty-state i {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.5rem;
  opacity: 0.55;
}

/* Form pages — constrained width */
.ebys-form-page {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.ebys-narrow-page {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.ebys-pager .pagination {
  --bs-pagination-padding-x: 0.65rem;
  --bs-pagination-padding-y: 0.3rem;
}

/* Soft unify common cards */
main .card.shadow-sm {
  border: 1px solid var(--ebys-border);
  border-radius: var(--ebys-radius);
  box-shadow: var(--ebys-shadow) !important;
}

main .alert {
  border-radius: var(--ebys-radius);
}

/* Dashboard */
.dashboard-hero {
  background: linear-gradient(135deg, var(--ebys-brand) 0%, var(--ebys-brand-2) 55%, var(--ebys-brand-3) 100%);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 10px 28px rgba(0, 51, 102, 0.22);
}

.dashboard-kicker {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.stat-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 1rem;
  height: 100%;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.stat-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
  font-size: 1.1rem;
}

.stat-label {
  color: #6c757d;
  font-size: 0.8rem;
  margin-bottom: 0.15rem;
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}

.dashboard-panel {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.dashboard-panel .card-header {
  background: #f8fafc;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dashboard-list li:last-child {
  border-bottom: 0 !important;
}

/* FileManager compact layout */
.filemanager .filemanager-table > :not(caption) > * > * {
  padding: 0.3rem 0.45rem;
}

.filemanager .filemanager-table {
  font-size: 0.875rem;
}

.filemanager .filemanager-table thead th {
  white-space: nowrap;
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.8rem;
}

.filemanager .fm-actions .btn {
  padding: 0.15rem 0.4rem;
}

.filemanager .table-responsive {
  overflow: visible;
}

.filemanager .card,
.filemanager .card-body {
  overflow: visible;
}

.filemanager .fm-actions-menu {
  z-index: 1080;
  max-height: min(70vh, 420px);
  overflow-y: auto;
}

.filemanager .fm-name-cell {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filemanager .fm-scope-list .list-group-item {
  font-size: 0.875rem;
}

.fm-birim-list {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.fm-birim-list .list-group-item {
  border-left: 0;
  border-right: 0;
}

.filemanager.fm-sidebar-collapsed .fm-main,
#fmLayout.fm-sidebar-collapsed .fm-main {
  flex: 0 0 100%;
  max-width: 100%;
}

.preview-modal-body {
  height: 80vh;
  overflow: hidden;
  background: #111827;
}

.preview-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.preview-image-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.75rem;
}

.preview-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.filemanager #fmBatchBar {
  border-color: #cfe2ff !important;
  background: #f0f6ff !important;
}

.filemanager tr.fm-dragging {
  opacity: 0.45;
}

.filemanager tr.fm-drop-target {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
  background: #e7f1ff !important;
}

.filemanager tr.fm-row[draggable="true"] {
  cursor: grab;
}

.filemanager tr.fm-row[draggable="true"]:active {
  cursor: grabbing;
}

.filemanager .fm-breadcrumb .breadcrumb {
  --bs-breadcrumb-divider: "/";
  font-size: 0.875rem;
  background: transparent;
  padding: 0;
}

.filemanager .fm-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: #adb5bd;
}

.filemanager .fm-breadcrumb .breadcrumb-item a {
  color: #0d6efd;
}

.filemanager .fm-breadcrumb .breadcrumb-item.active {
  color: #212529;
  font-weight: 600;
}

/* Navbar Yönetim dropdown — compact */
.dropdown-menu-admin {
  min-width: 11.5rem;
  font-size: 0.875rem;
  --bs-dropdown-item-padding-x: 0.75rem;
  --bs-dropdown-item-padding-y: 0.28rem;
}

.dropdown-menu-admin .dropdown-item {
  line-height: 1.25;
}

.dropdown-menu-admin .dropdown-item i {
  width: 1rem;
  text-align: center;
  opacity: 0.75;
}

/* Footer — Powered by Softdestek */
.ebys-powered-by {
  color: #444;
  font-size: 0.9rem;
  white-space: nowrap;
}

.ebys-powered-by .ebys-brand-soft {
  color: #007bff;
  font-weight: 700;
}

.ebys-powered-by .ebys-brand-destek {
  color: #222;
  font-weight: 700;
}