/* --- Design tokens --- */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --muted-2: #94a3b8;
  --primary: #2563eb;
  --accent: #10b981;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 16px;
  
}

/* --- Page base --- */
body {
  background: var(--bg) !important;
  font-family: "Inter", "SF Pro Display", system-ui, -apple-system, sans-serif;
  color: var(--ink);
}

/* Utility */
.shadow-soft { box-shadow: var(--shadow); }
.round-16 { border-radius: var(--radius); }
.round-20 { border-radius: 20px; }
.round-24 { border-radius: 24px; }
.text-muted-700 { color: var(--muted); }

/* Top bar */
.topbar {
  display: flex; align-items: center;
  gap: 10px; padding: 6px 8px; color: var(--ink);
}

/* Cards */
.card {
  border: 0; border-radius: 16px;
  box-shadow: var(--shadow);
  background: var(--surface);
}

/* Profile panel */
.profile-panel {
  padding: 18px; border-radius: 18px;
  background: var(--surface);
  border:1px solid #e2e8f0;
  box-shadow: 0 10px 28px rgba(15,23,42,.05);
  color: var(--ink);
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e2e8f0;
}
.profile-name { font-weight: 700; font-size: 1.08rem; color: var(--ink); margin-top: 12px; }
.btn-edit {
  border: 0; padding: 6px 12px; border-radius: 999px;
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 8px 18px rgba(37,99,235,.25);
}
.btn-edit:hover { filter: brightness(0.97); }

/* Shortcuts */
/* Sidebar nav */
.sidebar-shell{
  background: var(--surface);
  border-radius: 18px;
  border:1px solid #e2e8f0;
  box-shadow: var(--shadow);
  padding: 12px;
  transition: width .2s ease, padding .2s ease;
  position: relative;
}
.sidebar-nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.sidebar-mobile-toggle{
  display:none;
}
.sidebar-mobile-collapse{
  display:block;
}
.nav-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:12px;
  text-decoration:none;
  color:var(--ink);
  background:#f8fafc;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}
.nav-item:hover{
  background:#eef4ff;
  transform: translateY(-1px);
  box-shadow:0 10px 22px rgba(15,23,42,.06);
}
.nav-ico{
  width:36px; height:36px;
  display:inline-grid; place-items:center;
  border-radius:10px;
  background:rgba(37,99,235,.12);
  color:var(--primary);
  font-size:18px;
}
.nav-label{ font-weight:600; font-size:14px; color:var(--ink); }
.nav-item.nav-danger{ background:#fff1f0; color:#b91c1c; border:1px solid #fecdd3; }
.nav-item.nav-danger .nav-ico{ background:rgba(239,68,68,.12); color:#b91c1c; }

/* Collapse controls removed */

/* Dashboard row layout */
.dashboard-row{
  display:flex;
  flex-wrap:nowrap;
  gap:18px;
}
.dashboard-row > .col-md-3{
  flex:0 0 260px;
  max-width:260px;
}
.dashboard-row > .col-md-9,
.dashboard-row > .main-area{
  flex:1 1 auto;
  max-width: calc(100% - 260px);
  min-width:0;
}


/* Section head */
.section-head { display: flex; align-items: center; justify-content: space-between; }
.btn-pill {
  border: 0; padding: 8px 14px; border-radius: 12px; font-weight: 700;
  background: var(--primary); color: #fff; box-shadow: 0 8px 16px rgba(37,99,235,.20);
  text-decoration: none;
}
.btn-pill:hover { filter: brightness(.97); }
.btn-pill.ghost{ background:#f8fafc; color:#2563eb; border:1px solid #e2e8f0; }
.btn-pill.danger{ background:#ef4444; box-shadow:0 8px 16px rgba(239,68,68,.25); }

/* Sales */
#salesChart { background: var(--surface); border-radius: 12px; }

/* List tiles (shared Orders / Users / etc.) */
.list-tile {
  background:#f8fafc; border-radius:12px; padding:14px 16px; margin:12px auto;
  border:1px solid #e2e8f0; transition: all .15s ease;
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
}
.list-tile:hover { border-color:#2563eb; box-shadow: 0 10px 22px rgba(37,99,235,.14); background:#f1f5ff; }
.tile-view-btn { border-radius: 999px; box-shadow: 0 4px 10px rgba(0,0,0,.05); }

/* Orders list tabs */
.orders-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.orders-tab{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:90px;
  border:1px solid #dbeafe;
  background:#f8fbff;
  color:#1d4ed8;
  text-decoration:none;
  font-weight:700;
  font-size:13px;
  border-radius:999px;
  padding:8px 14px;
}
.orders-tab:hover{
  color:#1e40af;
  background:#eef5ff;
}
.orders-tab.is-active{
  background:#2563eb;
  border-color:#2563eb;
  color:#fff;
  box-shadow:0 8px 16px rgba(37,99,235,.22);
}
.badge-soft{
  background:#e5edff;
  color:#1e3a8a;
  border-radius:999px;
  padding:4px 8px;
  font-size:12px;
  font-weight:700;
}
.page-link-soft{
  text-decoration:none;
  border:1px solid #dbeafe;
  background:#f8fbff;
  color:#1d4ed8;
  border-radius:10px;
  padding:7px 12px;
  font-weight:700;
}
.page-link-soft:hover{
  background:#eef5ff;
}
.page-link-soft.is-disabled{
  pointer-events:none;
  opacity:.45;
}
.page-info{
  display:inline-flex;
  align-items:center;
  font-size:14px;
  font-weight:600;
  color:#475569;
}

/* Place list + form styling */
.place-shell{ max-width:1100px; }
.places-card{
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.places-head{
  display:grid;
  grid-template-columns: auto 1fr auto;
  align-items:center;
  gap:12px;
  margin-bottom:18px;
}
.places-head.hero{
  align-items:center;
}
.places-title{
  margin:0; text-align:center; font-weight:800; color:var(--primary);
}
.back-link{
  text-decoration:none; color:var(--muted); font-weight:700;
}
.head-center{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.head-actions{
  display:flex; gap:10px; align-items:center; justify-content:flex-end;
}
.search-bar{
  display:flex; gap:10px; align-items:center;
  background:#eef4ff;
  border:1px solid #d7e3ff;
  border-radius:14px;
  padding:8px 12px;
}
.search-bar input{
  border:0; background:transparent; outline:none; min-width:260px;
}
.search-bar button{
  border:0; background:transparent; color:#6b7280; padding:0 2px; border-radius:10px;
}
.create-btn{
  display:inline-flex; align-items:center; gap:6px;
}

/* .place-gallery{
  display:grid;
  grid-template-columns: repeat(auto-fit,minmax(240px,1fr));
  gap:16px;
} */
.place-card-visual{
  background:#e6f2fb;
  border:4px solid #52b7f4;
  border-radius:16px;
  padding:8px;
  box-shadow:0 10px 24px rgba(82,183,244,.25);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}
.thumb-wrap{
  width:100%;
  aspect-ratio:4/3;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}
.thumb-wrap img{ width:100%; height:100%; object-fit:cover; display:block; }
.thumb-placeholder{
  width:100%; height:100%; display:grid; place-items:center; color:#94a3b8; font-size:12px;
}
.place-card-title{
  font-weight:800;
  text-align:center;
  color:#0f172a;
  padding:6px 4px;
}
.place-card-actions{
  display:flex;
  gap:16px;
  justify-content:center;
  width:100%;
  padding:6px 0;
}
.place-card-actions a,
.place-card-actions button{
  border:none;
  background:transparent;
  color:#0f172a;
  font-size:18px;
  cursor:pointer;
}
.place-card-actions button{ padding:0; }
.place-card-actions i{ pointer-events:none; }

.place-form{ display:flex; flex-direction:column; gap:16px; }
.upload-dropzone{
  border:1px dashed #cbd5e1;
  border-radius:14px;
  background: linear-gradient(135deg,#e0ecff,#ffe9b0);
  padding:24px;
  position:relative;
  text-align:center;
}
.upload-dropzone input[type=file]{ opacity:0; position:absolute; inset:0; cursor:pointer; }
.upload-instructions{ display:grid; place-items:center; gap:6px; color:#0f172a; font-weight:700; }
.upload-ico{ width:40px; height:40px; border-radius:12px; background:rgba(37,99,235,.12); display:grid; place-items:center; font-size:18px; }

.form-grid{ display:grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap:14px; }
.form-group input, .form-group textarea, .form-group select{
  width:100%; border:1px solid #e2e8f0; border-radius:10px; padding:10px 12px; background:#f8fafc;
}
.form-actions{ display:flex; justify-content:flex-end; gap:10px; }

.uploader{ padding:14px; border-radius:12px; background:linear-gradient(135deg,#0E98D6 0%, #FCCB56 100%); }
  /* Empty state (create or after remove) */
  .upload-empty{
    width:100%; min-height:140px; border-radius:12px; border:2px dashed rgba(255,255,255,.65);
    background:transparent; color:#fff; display:flex; align-items:center; justify-content:center; gap:14px;
    cursor:pointer; user-select:none; transition:filter .15s ease, transform .1s ease;
  }
  .upload-empty:hover{ filter:brightness(.98); }
  .upload-empty:active{ transform:scale(.998); }
  .up-icon{ font-size:30px; line-height:1; display:flex; align-items:center; }
  .up-title{ font-weight:800; }
  .up-sub{ font-size:12px; opacity:.9; }

  /* Drag-over effect */
  .uploader.drag-over .upload-empty{
    border-color:#fff; box-shadow:0 0 0 3px rgba(255,255,255,.25) inset;
  }


  /* Preview state */
  .preview-wrap{
    position:relative;
    width:84px; height:84px; border-radius:999px;
    background:#fff; border:3px solid #fff;
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 6px 14px rgba(16,24,40,.16);
    cursor:pointer; user-select:none;
  }
  .preview{ width:78px; height:78px; object-fit:cover; border-radius:999px; display:block; }
  .remove-btn{
    position:absolute; top:-6px; right:-6px;
    width:24px; height:24px; border-radius:999px;
    background:#fff; color:#0E98D6; border:2px solid #fff;
    display:flex; align-items:center; justify-content:center;
    font-weight:900; line-height:1; cursor:pointer;
    box-shadow:0 4px 10px rgba(16,24,40,.18);
  }
  .remove-btn:hover{ filter:brightness(.96); }

  /* Hide Django's default clear/change text but keep inputs alive */
  .django-file-wrap{ display:none; }

   /* helper */
  .is-hidden{ display:none !important; }
@media (max-width: 600px){
  .places-card{ padding:14px; }
  .places-head{ grid-template-columns: 1fr; text-align:center; }
  .back-link{ justify-self:flex-start; }
  .head-actions{ flex-direction:column; align-items:stretch; justify-content:center; }
  .search-bar{ width:100%; }
  .search-bar input{ min-width:0; width:100%; }
  .create-btn{ justify-content:center; }
  .places-list{ gap:12px; }
  .place-row{ flex-direction:column; align-items:flex-start; }
  .place-actions-inline{ width:100%; justify-content:flex-start; }
  .place-shell{ padding:0 6px; }
  .form-grid{ grid-template-columns:1fr; }
  .upload-dropzone{ padding:16px; }
  .form-actions{ flex-direction:column; align-items:stretch; }
  .form-actions .btn-pill{ width:100%; text-align:center; }
}

/* Place grid */
.place-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill,minmax(260px,1fr));
  gap:16px;
}
.place-card{
  background: var(--surface);
  border:1px solid #e2e8f0;
  border-radius:16px;
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.place-thumb{
  width:100%; aspect-ratio:16/9;
  background-size:cover; background-position:center;
}
.place-thumb.empty{ background:#f1f5f9; display:grid; place-items:center; color:#94a3b8; }
.place-body{ padding:14px; display:flex; flex-direction:column; gap:6px; }
.place-meta{ display:flex; gap:8px; flex-wrap:wrap; }
.place-tag{ background:#eef4ff; color:#2563eb; padding:4px 8px; border-radius:999px; font-size:12px; font-weight:700; }
.place-region{ color:#475569; font-size:12px; }
.place-title{ font-weight:800; font-size:16px; margin:0; }
.place-desc{ font-size:13px; color:#475569; margin:0; min-height:40px; }
.place-actions{ display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
.btn-pill.ghost{ background:#f8fafc; color:#2563eb; border:1px solid #e2e8f0; }
.btn-pill.danger{ background:#ef4444; box-shadow:0 8px 16px rgba(239,68,68,.25); }
/* Icon-only action buttons (row actions) */
.btn-icon{
  width: 40px; height: 40px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.btn-icon i { font-size: 1rem; line-height: 1; }

/* Edit / Delete / View colors */
.btn-edit-invoice {
  background:#1e40af; color:#fff; border:1px solid rgba(255,255,255,0.0);
}
.btn-edit-invoice:hover { filter:brightness(.97); color:#fff; }
.btn-delete-invoice {
  background:#dc2626; color:#fff; border:1px solid rgba(255,255,255,0.0);
}
.btn-delete-invoice:hover { filter:brightness(.97); color:#fff; }
.btn-view-invoice { color:#111827; }

/* Make list tiles neat on small screens; circular buttons on mobile only */
@media (max-width: 576px) {
  .list-tile { flex-direction:column; align-items:flex-start; gap:10px; }
  .btn-icon{
    width: 44px; height: 44px;
    border-radius: 999px; /* rounded on mobile only */
  }
  /* keep actions aligned right on small screens if they wrap */
  .list-tile > .d-flex:last-child { align-self: flex-end; }
}

/* Messages page (kept) */
.chat-shell { border-radius: 18px; border-left: 1px solid rgba(0,0,0,0.08); }
.btn-back { color:#6b7280; text-decoration:none; display:inline-flex; align-items:center; }
.sidebar { height: 70vh; overflow-y: auto; }
.sidebar.no-border { border-right: 1px solid rgba(0,0,0,0.08); }
.sidebar-header { padding: .25rem 0; }
.sidebar-tile { background:#f7f9fc; border-radius:12px; padding:.75rem .9rem; display:flex; align-items:center; justify-content:space-between; }
.sidebar-tile + .sidebar-tile { margin-top:.5rem; }
.sidebar-name{ font-weight:600; color:#374151; }
.sidebar-snippet{ font-size:.85rem; color:#6b7280; }
.sidebar-time{ font-size:.8rem; color:#9ca3af; }
.sidebar-badge{ background:#2f80ed; color:#fff; }
.sidebar-main{ min-width:0; } .sidebar-meta{ min-width:68px; }
.chat-user{ display:inline-flex; align-items:center; gap:.6rem; }
.chat-avatar{ width:34px; height:34px; border-radius:50%; background:#2f80ed; color:#fff; display:flex; align-items:center; justify-content:center; }
.chat-username{ color:#111827; }
.thread{ height: 70vh; overflow-y: auto; padding: 1rem .25rem; }
.msg-row{ margin:14px 0; display:flex; }
.msg-left{ justify-content:flex-start; } .msg-right{ justify-content:flex-end; }
.bubble{ max-width:68%; border-radius:999px; padding:6px 12px; line-height:1.2; display:inline-flex; align-items:center; gap:8px; word-break:break-word; white-space:pre-wrap; }
.bubble-left{ background:#e9f0f7; color:#374151; }
.bubble-right{ background:#2f80ed; color:#fff; }
.bubble-time{ font-size:.72rem; color:rgba(255,255,255,.85); margin-left:2px; }
.bubble-tick{ font-size:.8rem; color:rgba(255,255,255,.85); }
.bubble-tick.read{ color:#fff; }
.composer{ border-top:1px solid rgba(0,0,0,0.06); padding-top:.75rem; }
.composer .form-control{ border-radius:999px 0 0 999px; background:#f5f7fb; border:1px solid rgba(0,0,0,0.06); }
.composer .btn-send{ border-radius:0 999px 999px 0; }

/* Extras */
.custom-card { background-color: #E8EFF5; color: #000; }
.btn-active { background: #60a5fa !important; color: #fff !important; }
.create-buttn { background-color: #128a3a!important; color: #ffffff; border: solid 1px #888282; }

/* === Sticky pill navbar (public) ======================================== */
.site-header{
  position: sticky;
  top: 0;
  z-index: 1050;
  padding: 14px 0;
  background: transparent;
}

.site-nav{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  background: #1e88d6;
  color: #fff;
  border-radius: 999px;
  padding: 12px 50px;
  box-shadow: 0 10px 26px rgba(2, 33, 78, 0.12);


}

/* Logo */
.nav-logo{
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 999px; background: #fff;
  text-decoration: none;
}
.nav-logo img{ width: 38px; height: 38px; object-fit: contain; display: block; }

/* Desktop links (center) */
.nav-links{
  list-style: none; display: flex; align-items: center; justify-content: center;
  gap: clamp(14px, 1vw, 34px); margin: 0; padding: 0;
}
.nav-links a{
  color: #fff; font-weight: 800; text-decoration: none; letter-spacing: .2px; white-space: nowrap;
}
.nav-links a:hover, .nav-links a:focus{
  text-decoration: underline; text-underline-offset: 3px;
}

/* Right login */
.nav-login{
  display: inline-flex; align-items: center; gap: 1px; color: #fff; text-decoration: none; font-weight: 800;
  
}
.login-ico{
  width: 36px; height: 36px; border-radius: 999px; background: #fff; color: #1e88d6;
  display: inline-grid; place-items: center; font-size: 18px; left: 15px !important;
}
.nav-login:hover{ opacity:.95; }

/* Mobile "Menu" trigger (center) – hidden on desktop by default */
.nav-menu-trigger{
  appearance:none; border:none; background:transparent; color:#fff; font-weight:800;
  display:none; align-items:center; gap:10px; justify-self:center;
}
.nav-menu-trigger .menu-text{ font-size:16px; }
.nav-menu-trigger .login-ico{
  width: 36px; height: 36px; border-radius: 999px; background:#fff; color:#1e88d6;
  display:inline-grid; place-items:center; font-size: 20px;
}

/* Offcanvas links */
.offcanvas .off-link{
  display:block; padding:10px 6px; border-radius:8px; color:#0f172a; text-decoration:none; font-weight:600; 
}
.offcanvas .off-link:hover{ background:#eef5ff; color:#0b4a8f; }


/* Responsiveness */
@media (max-width: 768px){
  .container-fluid.mt-3 { padding: 0 14px; }
  .site-nav{
    padding: 10px 12px;
    grid-template-columns: auto 1fr;
  }
  .nav-logo{ width: 48px; height: 48px; }
  .nav-logo img{ width: 32px; height: 32px; }

  /* Hide desktop links, show Menu button */
  .nav-links{ display:none; }
  .nav-actions{ display:none; }
  .nav-menu-trigger{
    display:inline-flex;
    justify-self:end;
  }
  .nav-dashboard-mobile-hide{ display:none !important; }

  /* Slightly smaller label next to icons */
  .nav-login .login-text, .nav-menu-trigger .menu-text{ font-size: 14px; }
  .btn-pill { padding: 4px 10px; font-size: 9px; }

  .sidebar-mobile-toggle{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    border:0;
    background:transparent;
    color:#60a5fa;
    font-size:28px;
    line-height:1;
    padding:8px 0 6px;
    margin-top:6px;
  }
  .sidebar-mobile-toggle i{
    transition:transform .2s ease;
  }
  .sidebar-shell.nav-open .sidebar-mobile-toggle i{
    transform:rotate(180deg);
  }
  .sidebar-mobile-collapse{
    max-height:0;
    opacity:0;
    overflow:hidden;
    pointer-events:none;
    transition:max-height .24s ease, opacity .2s ease;
  }
  .sidebar-shell.nav-open .sidebar-mobile-collapse{
    max-height:900px;
    opacity:1;
    pointer-events:auto;
  }
  .sidebar-mobile-collapse .sidebar-nav{
    margin-top:8px !important;
  }
}

/* Nice scroll anchoring when sticky header exists */
body{ scroll-padding-top: 70px; }

.off-canvas-zdenk{
  z-index: 9999 !important;
}

@media (max-width: 991px){
  .dashboard-row{ flex-wrap:wrap; }
  .dashboard-row > .col-md-3,
  .dashboard-row > .col-md-9{ flex:0 0 100%; max-width:100%; }
}

@media (max-width: 780px){
  .dashboard-row{ flex-wrap:wrap; }
  .dashboard-row > .col-md-3,
  .dashboard-row > .col-md-9{ flex:0 0 100%; max-width:100%; }
}
.place-gallery{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:16px;
  align-items:stretch;
}
.place-card-visual{
  background:#e6f2fb;
  border:4px solid #52b7f4;
  border-radius:16px;
  padding:8px;
  box-shadow:0 10px 24px rgba(82,183,244,.25);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
}
.thumb-wrap{
  width:100%;
  aspect-ratio:4/3;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}
.thumb-wrap img{ width:100%; height:100%; object-fit:cover; display:block; }
.thumb-placeholder{
  width:100%; height:100%; display:grid; place-items:center; color:#94a3b8; font-size:12px;
}
.place-card-title{
  font-weight:800;
  text-align:center;
  color:#0f172a;
  padding:6px 4px;
}
.place-card-actions{
  display:flex;
  gap:16px;
  justify-content:center;
  width:100%;
  padding:6px 0;
}
.place-card-actions a,
.place-card-actions button{
  border:none;
  background:transparent;
  color:#0f172a;
  font-size:18px;
  cursor:pointer;
}
.place-card-actions button{ padding:0; }
.place-card-actions i{ pointer-events:none; }

@media (max-width: 1200px){
  .place-gallery{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px){
  .place-gallery{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap:14px;
  }
}

@media (max-width: 560px){
  .place-gallery{
    grid-template-columns: 1fr;
    gap:12px;
  }
  .place-card-visual{
    border-width:3px;
    padding:7px;
    border-radius:14px;
  }
  .place-card-title{
    font-size:1.1rem;
    line-height:1.2;
  }
  .place-card-actions{
    gap:14px;
  }
}
