/* Tabler ustiga kichik qo'shimchalar */

/* ---------- Yon menyu ---------- */
.navbar-vertical .nav-item.active .badge { background: var(--tblr-primary) !important; color: #fff !important; }
.navbar-vertical .nav-item.alert-tab .badge { background: var(--tblr-red) !important; color: #fff !important; }
.navbar-vertical .nav-link { gap: .25rem; }
.theme-btn { background: none; border: 0; }
@media (min-width: 992px) {
  .navbar-vertical .navbar-collapse { display: flex !important; flex-direction: column; }
}

/* ---------- Umumiy ---------- */
.money { font-variant-numeric: tabular-nums; }
.money small { display: block; font-size: .8125rem; font-weight: 600; color: var(--tblr-secondary); }
.search-box { min-width: 220px; }
.sort-box { width: auto; }

/* ---------- Katakli jadval (kompyuter) ---------- */
.table-grid { margin: 0; }
.table-grid th, .table-grid td { white-space: nowrap; }
.table-grid .c-num { width: 1%; text-align: center; color: var(--tblr-secondary); }
.table-grid .c-wrap { white-space: normal; min-width: 150px; max-width: 280px; overflow-wrap: anywhere; }
.table-grid .c-money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.table-grid .c-act { width: 1%; }
.table-grid tr.row-late > td:first-child { box-shadow: inset 4px 0 0 var(--tblr-red); }
.table-grid tr.row-soon > td:first-child { box-shadow: inset 4px 0 0 var(--tblr-yellow); }

/* Telefonlar katak ichida */
.phone-list { display: flex; flex-direction: column; gap: 2px; }
.phone-line { display: inline-flex; align-items: center; gap: 2px; font-family: var(--tblr-font-monospace); font-size: .8125rem; }
.phone-line .btn { padding: 2px; }

/* Holat tanlagichi */
.status-sel { width: auto; padding-top: 2px; padding-bottom: 2px; font-weight: 600; font-size: .8125rem; border-color: transparent; }
.status-sel.s-new { background-color: var(--tblr-blue-lt); color: var(--tblr-blue); }
.status-sel.s-work { background-color: var(--tblr-yellow-lt); color: var(--tblr-yellow); }
.status-sel.s-done { background-color: var(--tblr-teal-lt); color: var(--tblr-teal); }
.status-sel.s-paid { background-color: var(--tblr-green-lt); color: var(--tblr-green); }
.status-sel.s-cancel { background-color: var(--tblr-red-lt); color: var(--tblr-red); }

/* ---------- Forma oynasi ---------- */
.sheet.offcanvas-end { width: min(500px, 100%); }
.offcanvas-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1.25rem calc(.75rem + env(safe-area-inset-bottom, 0px)); border-top: var(--tblr-border-width) solid var(--tblr-border-color); }
.phones { display: flex; flex-direction: column; gap: .5rem; }
.phones .form-control { font-family: var(--tblr-font-monospace); }
.currency { max-width: 96px; }
[data-f].is-invalid > .invalid-feedback { display: block; }
.amount-input { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Telefon: jadval qatorlari kartochkaga aylanadi ---------- */
@media (max-width: 767.98px) {
  .page-header .btn { padding-left: .75rem; padding-right: .75rem; }
  .search-box { min-width: 0; flex-basis: 100%; }
  .sort-box { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .chips .btn { flex: none; }

  .table-responsive { overflow: visible; }
  .table-grid, .table-grid tbody, .table-grid tr, .table-grid td { display: block; width: 100%; }
  .table-grid thead { display: none; }
  .table-grid tr { padding: .5rem 0; border-bottom: var(--tblr-border-width) solid var(--tblr-border-color); }
  .table-grid tbody tr:last-child { border-bottom: 0; }
  .table-grid tr.row-late { box-shadow: inset 4px 0 0 var(--tblr-red); }
  .table-grid tr.row-soon { box-shadow: inset 4px 0 0 var(--tblr-yellow); }
  .table-grid td {
    border: 0 !important; box-shadow: none !important;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: .3rem 1rem; text-align: right; white-space: normal;
    min-width: 0; max-width: none;
  }
  .table-grid td::before {
    content: attr(data-label); flex: none; text-align: left;
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tblr-secondary);
  }
  .table-grid td.c-num { display: none; }
  .table-grid td.c-name { font-size: 1rem; justify-content: flex-start; text-align: left; padding-top: .5rem; }
  .table-grid td.c-name::before, .table-grid td.c-act::before { display: none; }
  .table-grid td.c-act { justify-content: flex-end; padding-top: .5rem; }
  .table-grid td.c-act .btn-list { flex-wrap: wrap; justify-content: flex-end; }
  .table-grid .c-wrap { overflow-wrap: anywhere; }
  .phone-list { align-items: flex-end; }
  .phone-line { font-size: .875rem; }
}

/* ================= Animatsiyalar ================= */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes rowIn    { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes pop      { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake    { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@keyframes float1   { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 40px) scale(1.15); } }
@keyframes float2   { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-50px, -60px) scale(1.1); } }
@keyframes pulseRed { 0%, 100% { box-shadow: 0 0 0 0 rgba(214, 57, 57, .5); } 50% { box-shadow: 0 0 0 5px rgba(214, 57, 57, 0); } }

@media (prefers-reduced-motion: no-preference) {
  /* Sahifa ochilishi */
  .page { animation: fadeIn .35s ease-out; }
  body.leaving .page, body.leaving .login-bg { opacity: 0; transform: scale(.98); transition: opacity .2s, transform .2s; }

  /* Bo'lim ochilganda: sarlavha, kartochkalar, jadval qatorlari ketma-ket */
  .view-enter .page-header { animation: fadeUp .4s ease-out both; }
  .view-enter .row-cards > div { animation: fadeUp .45s cubic-bezier(.2, .8, .2, 1) both; }
  .view-enter .row-cards > div:nth-child(1) { animation-delay: .05s; }
  .view-enter .row-cards > div:nth-child(2) { animation-delay: .12s; }
  .view-enter .row-cards > div:nth-child(3) { animation-delay: .19s; }
  .view-enter .row-cards > div:nth-child(4) { animation-delay: .26s; }
  .view-enter .row-cards .avatar { animation: pop .5s ease-out .3s both; }
  .view-enter .page-body .card:not(.card-sm) { animation: fadeUp .45s ease-out .3s both; }
  .view-enter .table-grid tbody tr { animation: rowIn .35s ease-out both; animation-delay: calc(.4s + var(--i, 0) * 40ms); }
  .view-enter .empty { animation: fadeUp .45s ease-out .35s both; }

  /* Kartochkalar sichqoncha ostida biroz ko'tariladi */
  .row-cards .card-sm { transition: transform .2s ease, box-shadow .2s ease; }
  .row-cards .card-sm:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }

  /* Tugmalar, menyu, jadval */
  .btn { transition: transform .12s ease, background-color .15s, color .15s, border-color .15s, box-shadow .15s; }
  .btn:active:not(:disabled) { transform: scale(.96); }
  .navbar-vertical .nav-link { transition: background-color .2s, color .2s, padding-left .2s; }
  .navbar-vertical .nav-link:hover { padding-left: 1.4rem; }
  .table-grid tbody td { transition: background-color .15s; }
  .chips .btn .badge { transition: transform .2s; }
  .chips .btn:hover .badge { transform: scale(1.12); }
  .phones .phone-row { animation: fadeUp .25s ease-out both; }
  .navbar-vertical .nav-item.alert-tab .badge { animation: pulseRed 1.6s ease-in-out infinite; }
  .table-grid tr.row-late .badge.bg-red { animation: pulseRed 1.6s ease-in-out infinite; }
  .status-sel { transition: background-color .25s, color .25s; }

  /* Kirish sahifasi */
  .login-brand { animation: fadeUp .5s ease-out both; }
  .login-brand .avatar { animation: pop .6s ease-out .1s both; }
  .login-card { animation: fadeUp .55s cubic-bezier(.2, .8, .2, 1) .12s both; }
  .login-card.shake { animation: shake .45s ease-in-out; }
  .login-bg span:nth-child(1) { animation: float1 16s ease-in-out infinite; }
  .login-bg span:nth-child(2) { animation: float2 19s ease-in-out infinite; }
  .login-bg span:nth-child(3) { animation: float1 22s ease-in-out infinite reverse; }
}

/* ---------- Kirish sahifasi foni ---------- */
.login-page { position: relative; min-height: 100vh; overflow-x: hidden; }
.login-page .page { position: relative; z-index: 1; background: transparent; }
.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.login-bg span { position: absolute; width: 42vmax; height: 42vmax; border-radius: 50%; filter: blur(70px); opacity: .22; }
.login-bg span:nth-child(1) { background: var(--tblr-primary); top: -12vmax; left: -10vmax; }
.login-bg span:nth-child(2) { background: var(--tblr-azure); bottom: -16vmax; right: -12vmax; }
.login-bg span:nth-child(3) { background: var(--tblr-purple); top: 40%; left: 45%; width: 26vmax; height: 26vmax; opacity: .14; }
.login-card { backdrop-filter: blur(6px); }

/* Yon menyu pastidagi admin bloki */
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .08); }
.admin-box .min-w-0 { min-width: 0; }
