/* =========================================================
   Admin + Owner panel layout
   ========================================================= */
.panel-body { background: #f3f6fa; min-height: 100vh; }
.panel-admin { --side-bg: #0b1324; --side-accent: #6366f1; --side-accent-soft: rgba(99, 102, 241, .16); }
.panel-user { --side-bg: #062a2e; --side-accent: #14b8a6; --side-accent-soft: rgba(20, 184, 166, .16); }

.panel-sidebar { width: 268px; background: var(--side-bg); color: rgba(255, 255, 255, .7); display: flex; flex-direction: column; }
.panel-sidebar.offcanvas-lg { background-color: var(--side-bg) !important; }
@media (min-width: 992px) {
  .panel-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1035; overflow-y: auto; }
  .panel-main { margin-left: 268px; }
}
@media (max-width: 991.98px) {
  .panel-sidebar.offcanvas-lg { --bs-offcanvas-bg: var(--side-bg); --bs-offcanvas-width: 280px; }
}
.sidebar-brand { padding: 1.2rem 1.2rem 1rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.sidebar-brand .brand-logo { color: #fff !important; font-size: 1.05rem; line-height: 1.15; }
.panel-admin .sidebar-brand .logo-mark { background: linear-gradient(135deg, #6366f1, #8b5cf6); box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .7); }
.panel-tag { font-size: .7rem; font-weight: 600; color: rgba(255, 255, 255, .5); letter-spacing: .06em; text-transform: uppercase; }
.sidebar-nav { padding: 1rem .8rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.sidebar-nav a { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 12px; color: rgba(255, 255, 255, .72); font-weight: 600; font-size: .93rem; transition: .15s; }
.sidebar-nav a i { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar-nav a.active { background: var(--side-accent-soft); color: #fff; box-shadow: inset 3px 0 0 var(--side-accent); }
.sidebar-nav a.active i { color: var(--side-accent); }
.sidebar-sep { height: 1px; background: rgba(255, 255, 255, .07); margin: .8rem .4rem; }

.panel-topbar { position: sticky; top: 0; z-index: 1020; background: rgba(243, 246, 250, .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; align-items: center; gap: .8rem; padding: .85rem 1.5rem; border-bottom: 1px solid #e5eaf1; }
.panel-title { font-size: 1.2rem; font-weight: 800; margin: 0; min-width: 0; }
.panel-topbar .btn-light { background: #fff; border: 1px solid #e5eaf1; }
.panel-content { padding: 1.5rem; }
@media (max-width: 575px) { .panel-content { padding: 1rem; } .panel-topbar { padding: .7rem 1rem; } }

.p-card { background: #fff; border-radius: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); border: 1px solid #e9eef5; }
.p-card-head { padding: 1rem 1.25rem; border-bottom: 1px solid #eef2f7; display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; }
.p-card-head h2 { font-size: 1rem; font-weight: 800; margin: 0; }
.p-card-body { padding: 1.25rem; }

.kpi { background: #fff; border-radius: 16px; padding: 1.15rem 1.2rem; border: 1px solid #e9eef5; display: flex; align-items: center; gap: 1rem; height: 100%; }
.kpi .ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.kpi .v { font-size: 1.55rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.kpi .l { font-size: .82rem; color: var(--muted); font-weight: 600; }
.ic-teal { background: #ccfbf1; color: #0f766e; }
.ic-indigo { background: #e0e7ff; color: #4338ca; }
.ic-amber { background: #fef3c7; color: #b45309; }
.ic-rose { background: #ffe4e6; color: #be123c; }
.ic-sky { background: #e0f2fe; color: #0369a1; }
.ic-violet { background: #ede9fe; color: #6d28d9; }

.table-panel { margin: 0; }
.table-panel th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #f8fafc; border-bottom: 1px solid #eef2f7; padding: .8rem 1rem; white-space: nowrap; }
.table-panel td { padding: .8rem 1rem; vertical-align: middle; border-color: #f1f5f9; }
.table-panel tr:last-child td { border-bottom: 0; }
.thumb { width: 64px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--brand-50); flex-shrink: 0; }
.thumb-sm { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--brand-50); }

.panel-admin .btn-brand { background: #4f46e5; border-color: #4f46e5; }
.panel-admin .btn-brand:hover { background: #4338ca; border-color: #4338ca; }

/* Login pages */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-side { position: relative; color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-side.user { background: linear-gradient(140deg, #062a2e, #0f766e); }
.auth-side.admin { background: linear-gradient(140deg, #0b1324, #312e81); }
.auth-side::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px; background: rgba(255, 255, 255, .06); }
.auth-side h2 { color: #fff; font-weight: 800; font-size: 2.2rem; letter-spacing: -.03em; }
.auth-side .brand-logo { color: #fff !important; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: #fff; }
.auth-form .inner { width: 100%; max-width: 400px; }
.auth-feature { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; position: relative; z-index: 2; }
.auth-feature i { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .12); display: grid; place-items: center; }
@media (max-width: 991px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* Owner chat inbox */
.inbox { display: grid; grid-template-columns: 360px 1fr; height: calc(100vh - 64px - 3rem); min-height: 520px; overflow: hidden; }
.inbox-list { border-right: 1px solid #eef2f7; display: flex; flex-direction: column; min-height: 0; }
.inbox-tools { padding: .9rem; border-bottom: 1px solid #eef2f7; }
.inbox-items { overflow-y: auto; flex: 1; }
.inbox-item { display: flex; gap: .75rem; padding: .85rem .9rem; border-bottom: 1px solid #f3f5f9; cursor: pointer; transition: background .15s; position: relative; }
.inbox-item:hover { background: #f8fafc; }
.inbox-item.active { background: var(--brand-50); }
.inbox-item.unread .nm { font-weight: 800; }
.inbox-item.unread .lm { color: var(--ink); font-weight: 600; }
.inbox-item .nm { font-weight: 700; color: var(--ink); font-size: .93rem; }
.inbox-item .lm { font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item .pt { font-size: .76rem; color: var(--brand); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item .tm { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.inbox-item .avatar { width: 44px; height: 44px; font-size: .9rem; }
.inbox-conv { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.conv-head { padding: .8rem 1rem; border-bottom: 1px solid #eef2f7; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.conv-prop { display: flex; gap: .7rem; align-items: center; background: #f8fafc; border: 1px solid #eef2f7; border-radius: 12px; padding: .55rem .7rem; margin: .7rem 1rem 0; }
.conv-prop .t { font-weight: 700; color: var(--ink); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-conv .chat-messages { flex: 1; height: auto; min-height: 0; }
.quick-replies { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; padding-bottom: 2px; }
.quick-replies::-webkit-scrollbar { display: none; }
.quick-replies .btn { white-space: nowrap; flex-shrink: 0; }
.conv-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 2rem; }
.conv-empty i { font-size: 3.5rem; color: var(--brand); opacity: .35; }
@media (max-width: 991px) {
  .inbox { grid-template-columns: 1fr; height: calc(100vh - 60px - 2rem); }
  .inbox.show-conv .inbox-list { display: none; }
  .inbox:not(.show-conv) .inbox-conv { display: none; }
}
