/* ── ClientFlow CRM — Full-Screen Shell ─────────────────────────────────── */

/* ══ Kill everything from the theme ══ */
.cfcrm-fullscreen-body,
.cfcrm-fullscreen-body body {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  background: #f5f5f7 !important;
}
/* Admin bar — hide completely */
.cfcrm-fullscreen-body #wpadminbar { display: none !important; }
.cfcrm-fullscreen-body.admin-bar   { margin-top: 0 !important; padding-top: 0 !important; }
.cfcrm-fullscreen-body.admin-bar #cfcrm-app-shell { margin-top: 0 !important; top: 0 !important; }

/* ══ App shell — full viewport ══ */
.cfcrm-app-shell {
  display: flex;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  position: fixed;
  top: 0; left: 0;
}

/* ══════════════ SIDEBAR ══════════════ */
.cfcrm-sidebar {
  width: 216px;
  min-width: 216px;
  background: #1c1c1e;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .25s ease;
}

.cfcrm-sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: #fff; flex-shrink: 0;
}
.cfcrm-sidebar-title { font-size: 15px; font-weight: 700; letter-spacing: -.3px; }

.cfcrm-nav {
  flex: 1; overflow-y: auto; padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.cfcrm-nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: 8px;
  border: none; background: transparent;
  color: rgba(255,255,255,.5);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left; width: 100%;
  font-family: inherit; transition: all .12s; position: relative;
}
.cfcrm-nav-item:hover  { background: rgba(255,255,255,.07); color: rgba(255,255,255,.85); }
.cfcrm-nav-item.active { background: rgba(255,255,255,.12); color: #fff; }
.cfcrm-nav-item svg    { flex-shrink: 0; opacity: .65; }
.cfcrm-nav-item.active svg { opacity: 1; }

.cfcrm-nav-badge {
  margin-left: auto; background: #ff3b30; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 20px; min-width: 18px; text-align: center;
}

.cfcrm-sidebar-footer {
  padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.cfcrm-user-chip  { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.cfcrm-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, #0071e3, #5856d6);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cfcrm-user-info  { min-width: 0; }
.cfcrm-user-name  { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfcrm-user-role  { font-size: 10px; color: rgba(255,255,255,.38); }
.cfcrm-logout-btn {
  color: rgba(255,255,255,.3); text-decoration: none;
  display: flex; align-items: center; padding: 5px; border-radius: 6px; transition: .12s; flex-shrink: 0;
}
.cfcrm-logout-btn:hover { background: rgba(255,255,255,.07); color: #fff; }

/* ══════════════ TOPBAR (mobile only) ══════════════ */
.cfcrm-topbar {
  display: none; align-items: center; gap: 12px;
  padding: 0 16px; height: 50px;
  background: #1c1c1e;
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  flex-shrink: 0;
}
.cfcrm-menu-toggle {
  background: none; border: none; cursor: pointer; color: #fff;
  display: flex; align-items: center; padding: 4px;
}
.cfcrm-topbar-title { font-size: 15px; font-weight: 700; color: #fff; flex: 1; }
.cfcrm-topbar-avatar { font-size: 10px; }

/* ══════════════ MAIN CONTENT ══════════════ */
.cfcrm-main {
  flex: 1; min-width: 0;
  height: 100dvh;
  overflow-y: auto;
  background: #f5f5f7;
  display: flex; flex-direction: column;
}

.cfcrm-fullscreen-app {
  padding: 24px 28px;
  flex: 1; max-width: 100%;
  box-sizing: border-box;
}

/* Page header */
.cfcrm-page-header {
  margin-bottom: 20px;
}
.cfcrm-page-header h1 {
  font-size: 22px; font-weight: 700; color: #1d1d1f;
  margin: 0 0 2px; letter-spacing: -.5px;
}
.cfcrm-page-header p {
  font-size: 13px; color: #6e6e73; margin: 0;
}

/* Override card wrap inside fullscreen */
.cfcrm-fullscreen-app .cfcrm-front-wrap {
  background: transparent !important;
  padding: 0 !important;
  max-width: 100% !important;
  border-radius: 0 !important;
}

/* Views */
.cfcrm-view { display: none; }
.cfcrm-view.active { display: block; }

/* ══════════════ LOCK SCREEN ══════════════ */
.cfcrm-lock-screen {
  min-height: 100dvh; display: flex; align-items: center;
  justify-content: center; background: #f5f5f7; padding: 20px;
}
.cfcrm-lock-card {
  background: #fff; border-radius: 18px; padding: 44px 36px;
  text-align: center; max-width: 360px; width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
}
.cfcrm-lock-logo {
  width: 68px; height: 68px; border-radius: 16px;
  background: #1c1c1e; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 18px; color: #fff;
}
.cfcrm-lock-card h1 { font-size: 20px; font-weight: 700; margin: 0 0 8px; color: #1d1d1f; }
.cfcrm-lock-card p  { font-size: 14px; color: #6e6e73; margin: 0 0 24px; }
.cfcrm-lock-btn {
  display: inline-block; background: #0071e3; color: #fff;
  text-decoration: none; padding: 11px 28px; border-radius: 9px;
  font-size: 14px; font-weight: 600; font-family: inherit; transition: .15s;
}
.cfcrm-lock-btn:hover { background: #005ec4; color: #fff; }

/* ══════════════ RESPONSIVE ══════════════ */
@media (max-width: 768px) {
  .cfcrm-topbar { display: flex; }
  .cfcrm-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    z-index: 300; padding-top: 50px;
  }
  .cfcrm-sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,.3); }
  .cfcrm-main { padding-top: 50px; }
  .cfcrm-fullscreen-app { padding: 14px; }
}
@media (min-width: 769px) {
  .cfcrm-topbar { display: none; }
}

/* ══ CRM content styles inside fullscreen shell ══ */
.cfcrm-fullscreen-app .cr-toolbar{display:flex;align-items:center;gap:8px;margin-bottom:14px;flex-wrap:wrap}
.cfcrm-fullscreen-app .cr-search{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #d1d1d6;border-radius:9px;padding:0 12px;flex:1;min-width:180px;max-width:340px;height:38px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.cfcrm-fullscreen-app .cr-search-icon{color:#8e8e93;font-size:15px;flex-shrink:0}
.cfcrm-fullscreen-app .cr-search-input{border:none;outline:none;font-size:13.5px;color:#1c1c1e;background:transparent;width:100%;padding:0;margin:0;box-shadow:none;font-family:inherit}
.cfcrm-fullscreen-app .cr-search-input::placeholder{color:#aeaeb2}
.cfcrm-fullscreen-app .cr-select{padding:0 10px;border:1px solid #d1d1d6;border-radius:9px;font-size:13px;color:#1c1c1e;background:#fff;cursor:pointer;outline:none;height:38px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.cfcrm-fullscreen-app .cr-btn{display:inline-flex;align-items:center;gap:5px;padding:0 16px;border-radius:9px;font-size:13px;font-weight:500;border:none;cursor:pointer;white-space:nowrap;height:38px;text-decoration:none;font-family:inherit;transition:background .15s}
.cfcrm-fullscreen-app .cr-btn-primary{background:#0071e3;color:#fff}
.cfcrm-fullscreen-app .cr-btn-primary:hover{background:#0064c8;color:#fff}
.cfcrm-fullscreen-app .cr-btn-outline{background:#fff;color:#1c1c1e;border:1px solid #d1d1d6;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.cfcrm-fullscreen-app .cr-btn-outline:hover{background:#f5f5f7}
.cfcrm-fullscreen-app .cr-btn-danger{background:#ff3b30;color:#fff}
.cfcrm-fullscreen-app .cr-btn-sm{padding:0 12px;font-size:12px;height:30px}
.cfcrm-fullscreen-app .cr-bulk-bar{display:none;align-items:center;gap:8px;background:#fff8e1;border:1px solid #ff9500;border-radius:9px;padding:8px 14px;margin-bottom:12px;font-size:13px;color:#1c1c1e}
.cfcrm-fullscreen-app .cr-bulk-bar.visible{display:flex}
.cfcrm-fullscreen-app .cr-table-wrap{background:#fff;border:1px solid #d1d1d6;border-radius:12px;overflow:auto;box-shadow:0 1px 4px rgba(0,0,0,.07)}
.cfcrm-fullscreen-app .cr-table{width:100%;border-collapse:collapse;font-size:13px;min-width:600px}
.cfcrm-fullscreen-app .cr-table thead th{background:#f2f2f7;color:#8e8e93;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.5px;padding:10px 13px;text-align:left;border-bottom:1px solid #e5e5ea;white-space:nowrap}
.cfcrm-fullscreen-app .cr-table tbody tr{border-bottom:1px solid #f2f2f7}
.cfcrm-fullscreen-app .cr-table tbody tr:last-child{border-bottom:none}
.cfcrm-fullscreen-app .cr-table tbody tr:hover{background:#f9f9fb}
.cfcrm-fullscreen-app .cr-table tbody td{padding:11px 13px;vertical-align:middle;color:#1c1c1e;font-size:13px;border:none;background:transparent}
.cfcrm-fullscreen-app .cr-table .col-chk{width:36px}
.cfcrm-fullscreen-app .cr-table .col-bm{width:38px}
.cfcrm-fullscreen-app .cr-table .col-act{width:160px;white-space:nowrap}
.cfcrm-fullscreen-app .cr-table input[type=checkbox]{width:15px;height:15px;cursor:pointer;accent-color:#0071e3;margin:0}
.cfcrm-fullscreen-app .cr-bm{background:none;border:none;cursor:pointer;font-size:18px;line-height:1;color:#c7c7cc;padding:2px 4px;display:inline-block;transition:color .15s}
.cfcrm-fullscreen-app .cr-bm:hover,.cfcrm-fullscreen-app .cr-bm.active{color:#ff9500}
.cfcrm-fullscreen-app .cr-badge{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:20px;font-size:11.5px;font-weight:600;white-space:nowrap;border:none}
.cfcrm-fullscreen-app .cr-dot{width:6px;height:6px;border-radius:50%;flex-shrink:0;display:inline-block}
.cfcrm-fullscreen-app .cr-act-wrap{display:inline-flex;gap:3px;flex-wrap:nowrap;align-items:center}
.cfcrm-fullscreen-app .cr-act{display:inline-flex;align-items:center;justify-content:center;padding:4px 8px;border-radius:6px;border:1px solid #d1d1d6;background:#fff;font-size:11.5px;font-weight:500;cursor:pointer;color:#1c1c1e;transition:background .12s;margin:0;text-decoration:none;white-space:nowrap;height:26px;font-family:inherit}
.cfcrm-fullscreen-app .cr-act:hover{background:#f5f5f7}
.cfcrm-fullscreen-app .cr-act.del{color:#ff3b30;border-color:#fca5a5}
.cfcrm-fullscreen-app .cr-act.del:hover{background:#fff0f0}
.cfcrm-fullscreen-app .cr-act.cr-activity{color:#0071e3;border-color:#bfdbfe}
.cfcrm-fullscreen-app .cr-act.cr-activity:hover{background:#eff6ff}
.cfcrm-fullscreen-app .cr-act.cr-log{color:#8b5cf6;border-color:#ddd6fe}
.cfcrm-fullscreen-app .cr-act.cr-log:hover{background:#f5f3ff}
.cfcrm-fullscreen-app .cr-wa{color:#16a34a;font-weight:500;text-decoration:none;font-size:12.5px}
.cfcrm-fullscreen-app .cr-email{color:#0071e3;text-decoration:none}
.cfcrm-fullscreen-app .cr-url{color:#0071e3;text-decoration:none;word-break:break-all}
.cfcrm-fullscreen-app .cr-overdue{color:#ff3b30;font-weight:600}
.cfcrm-fullscreen-app .cr-today{color:#ff9500;font-weight:600}
.cfcrm-fullscreen-app .cr-pagination{display:flex;align-items:center;gap:6px;margin-top:16px;flex-wrap:wrap}
.cfcrm-fullscreen-app .cr-pg-info{font-size:12.5px;color:#8e8e93;margin-right:4px}
.cfcrm-fullscreen-app .cr-pg-btn{padding:5px 14px;border:1px solid #d1d1d6;border-radius:8px;background:#fff;font-size:13px;cursor:pointer;color:#1c1c1e;transition:background .12s;height:32px;font-family:inherit}
.cfcrm-fullscreen-app .cr-pg-btn:hover:not(:disabled){background:#f5f5f7}
.cfcrm-fullscreen-app .cr-pg-btn:disabled{opacity:.4;cursor:not-allowed}
.cfcrm-fullscreen-app .cr-pg-nums{display:flex;gap:3px}
.cfcrm-fullscreen-app .cr-pg-num{width:32px;height:32px;padding:0;border:1px solid #d1d1d6;border-radius:7px;background:#fff;font-size:12.5px;cursor:pointer;color:#1c1c1e;transition:background .12s;font-family:inherit}
.cfcrm-fullscreen-app .cr-pg-num:hover{background:#f5f5f7}
.cfcrm-fullscreen-app .cr-pg-num.current{background:#0071e3;color:#fff;border-color:#0071e3}

/* Modal styles */
#cfcrm-modal-overlay{position:fixed!important;inset:0!important;background:rgba(0,0,0,.5)!important;z-index:9999999!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:20px!important;backdrop-filter:blur(4px)!important;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",Arial,sans-serif!important}
#cfcrm-modal-overlay *{box-sizing:border-box!important;font-family:inherit!important}
#cfcrm-modal-box{background:#fff!important;border-radius:18px!important;width:100%!important;max-width:540px!important;max-height:92vh!important;overflow-y:auto!important;box-shadow:0 24px 64px rgba(0,0,0,.22)!important;animation:crUp .2s ease!important}
@keyframes crUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
#cfcrm-modal-overlay .cr-modal-head{display:flex!important;align-items:center!important;justify-content:space-between!important;padding:18px 22px 14px!important;border-bottom:1px solid #e5e5ea!important;position:sticky!important;top:0!important;background:#fff!important;z-index:2!important;border-radius:18px 18px 0 0!important}
#cfcrm-modal-overlay .cr-modal-title{font-size:17px!important;font-weight:700!important;margin:0!important;color:#1c1c1e!important;letter-spacing:-.3px!important}
#cfcrm-modal-overlay .cr-modal-close{background:#f2f2f7!important;border:none!important;cursor:pointer!important;width:28px!important;height:28px!important;border-radius:50%!important;font-size:13px!important;color:#6c6c70!important;display:flex!important;align-items:center!important;justify-content:center!important}
#cfcrm-modal-overlay .cr-modal-close:hover{background:#e5e5ea!important;color:#1c1c1e!important}
#cfcrm-modal-overlay .cr-modal-body{padding:16px 22px!important;display:flex!important;flex-direction:column!important;gap:13px!important}
#cfcrm-modal-overlay .cr-modal-row2{display:grid!important;grid-template-columns:1fr 1fr!important;gap:13px!important}
#cfcrm-modal-overlay .cr-fg{display:flex!important;flex-direction:column!important;gap:5px!important}
#cfcrm-modal-overlay .cr-label{font-size:11px!important;font-weight:600!important;color:#8e8e93!important;text-transform:uppercase!important;letter-spacing:.5px!important;margin:0!important}
#cfcrm-modal-overlay .cr-inp{padding:9px 12px!important;border:1px solid #d1d1d6!important;border-radius:9px!important;font-size:13.5px!important;color:#1c1c1e!important;background:#fff!important;width:100%!important;outline:none!important;margin:0!important;box-shadow:none!important;-webkit-appearance:none!important;appearance:none!important}
#cfcrm-modal-overlay .cr-inp:focus{border-color:#0071e3!important;box-shadow:0 0 0 3px rgba(0,113,227,.13)!important}
#cfcrm-modal-overlay textarea.cr-inp{resize:vertical!important;min-height:72px!important}
#cfcrm-modal-overlay .cr-phone-wrap{display:flex!important;flex-direction:column!important;gap:7px!important}
#cfcrm-modal-overlay .cr-wa-label{display:flex!important;align-items:center!important;gap:7px!important;font-size:12.5px!important;color:#6c6c70!important;cursor:pointer!important;font-weight:400!important;text-transform:none!important;letter-spacing:0!important}
#cfcrm-modal-overlay .cr-wa-chk{width:15px!important;height:15px!important;accent-color:#16a34a!important;cursor:pointer!important;margin:0!important}
#cfcrm-modal-overlay .cr-modal-foot{display:flex!important;gap:8px!important;justify-content:flex-end!important;padding:14px 22px!important;border-top:1px solid #e5e5ea!important;position:sticky!important;bottom:0!important;background:#fff!important;border-radius:0 0 18px 18px!important;z-index:2!important}
#cfcrm-modal-overlay .cr-modal-btn{display:inline-flex!important;align-items:center!important;padding:9px 20px!important;border-radius:9px!important;font-size:13px!important;font-weight:500!important;border:none!important;cursor:pointer!important;height:38px!important}
#cfcrm-modal-overlay .cr-modal-btn.primary{background:#0071e3!important;color:#fff!important}
#cfcrm-modal-overlay .cr-modal-btn.primary:hover{background:#0064c8!important}
#cfcrm-modal-overlay .cr-modal-btn.cancel{background:#f2f2f7!important;color:#1c1c1e!important;border:1px solid #d1d1d6!important}
#cfcrm-modal-overlay .cr-modal-btn.cancel:hover{background:#e5e5ea!important}
#cfcrm-modal-overlay .cr-modal-btn:disabled{opacity:.45!important;cursor:not-allowed!important}
@media(max-width:580px){#cfcrm-modal-overlay .cr-modal-row2{grid-template-columns:1fr!important}}