/* Ayur Myntra CRM v5.2 — unified professional desktop and mobile interface */
:root{
  --crm-bg:#f3f7f6;--crm-surface:#fff;--crm-surface-soft:#f8fbfa;--crm-text:#103c35;
  --crm-muted:#60766f;--crm-line:#dce8e4;--crm-brand:#087f70;--crm-brand-deep:#075f55;
  --crm-radius:14px;--crm-shadow:0 8px 28px rgba(20,66,57,.065);
}
body{color:var(--crm-text);background:var(--crm-bg)}
.app{background:radial-gradient(circle at 86% 0,rgba(29,178,145,.07),transparent 28%),var(--crm-bg)}
.sidebar{width:248px;padding:18px 14px;background:linear-gradient(180deg,#073f37,#052f2a 72%,#042823);box-shadow:12px 0 34px rgba(4,40,35,.08)}
.logo-row{padding:0 5px 17px;margin-bottom:11px;border-bottom:1px solid rgba(255,255,255,.09)}
.sidebar nav{gap:3px}.nav-btn{min-height:43px;padding:7px 9px;border-radius:11px;color:#c8ded8;font-weight:650;letter-spacing:-.01em}
.nav-btn:hover{color:#fff;background:rgba(255,255,255,.07)}.nav-btn.active{color:#fff;background:linear-gradient(110deg,rgba(9,183,154,.26),rgba(9,183,154,.11));box-shadow:inset 3px 0 #25d7b6}
.nav-glyph{display:grid;place-items:center;width:29px;height:29px;flex:0 0 29px;border:1px solid rgba(255,255,255,.09);border-radius:9px;color:#8fe4d2;background:rgba(255,255,255,.055);font-style:normal;font-size:14px}
.nav-btn.active .nav-glyph{color:#fff;border-color:rgba(64,232,198,.2);background:rgba(18,202,166,.18)}
.bulk-nav-submenu{margin:2px 0 7px 17px;padding:4px 0 4px 15px;border-left:1px solid rgba(128,213,194,.22)}
.bulk-subnav-btn{min-height:34px!important;padding:5px 7px!important;border-radius:8px!important}.bulk-subnav-btn i{font-size:8px!important}
.user-box{padding:10px;border:1px solid rgba(255,255,255,.1);border-radius:13px;background:rgba(255,255,255,.055)}
.main{max-width:1680px;padding:20px clamp(18px,2.6vw,38px) 46px}
.topbar{min-height:68px;margin-bottom:18px;padding:0 2px 15px;border-bottom:1px solid rgba(170,201,191,.62)}
.topbar h1{font-size:clamp(23px,2vw,30px);letter-spacing:-.045em}.topbar p{margin-top:3px;color:var(--crm-muted);font-size:12px}
.view{max-width:1500px;margin:0 auto}.panel{padding:18px;border:1px solid var(--crm-line);border-radius:var(--crm-radius);background:rgba(255,255,255,.94);box-shadow:var(--crm-shadow)}
.panel+.panel{margin-top:14px}.panel-head{align-items:flex-start;gap:14px;margin-bottom:14px}.panel-head h3{margin:0;color:var(--crm-text);font-size:17px;letter-spacing:-.02em}.panel-head p{margin:4px 0 0;color:var(--crm-muted);font-size:11px;line-height:1.45}
.btn{min-height:38px;padding:8px 13px;border-radius:9px;font-weight:700;box-shadow:none}.btn.primary{background:linear-gradient(135deg,var(--crm-brand),var(--crm-brand-deep));box-shadow:0 6px 16px rgba(8,127,112,.16)}.btn.ghost{background:#fff;border-color:var(--crm-line)}
.btn:hover{transform:translateY(-1px)}input,select,textarea{border-color:#cbded7!important;border-radius:10px!important;background:#fff!important}input:focus,select:focus,textarea:focus{outline:0;border-color:var(--crm-brand)!important;box-shadow:0 0 0 3px rgba(8,127,112,.1)!important}
.stats-grid,.card-grid{gap:11px}.stat-card,.info-card,.coin-card{min-width:0;padding:14px!important;border:1px solid var(--crm-line)!important;border-radius:12px!important;background:#fff!important;box-shadow:0 5px 18px rgba(20,66,57,.045)!important}.stat-card strong,.info-card>b{font-size:clamp(21px,2vw,29px)!important;letter-spacing:-.04em}
.filter-strip{gap:10px;padding:12px!important;border-radius:13px!important;background:#f8fbfa!important}.filter-grid{gap:9px!important}.filter-grid label{font-size:10px!important}.table-wrap{border:1px solid var(--crm-line);border-radius:12px;background:#fff}.table-wrap table{border-collapse:separate;border-spacing:0}.table-wrap th{position:sticky;top:0;z-index:2;padding:10px 12px!important;color:#6e817b;background:#f4f8f6!important;font-size:9px!important;letter-spacing:.055em}.table-wrap td{padding:11px 12px!important;border-top:1px solid #e8efed!important;font-size:11px}.table-wrap tbody tr:hover td{background:#f5fbf8}
.row-actions,.inline-actions,.v3-actions{gap:6px!important}.row-actions .btn,.inline-actions .btn{min-height:32px;padding:6px 9px;font-size:10px}
.drawer-body,.modal-form{border-radius:18px}.tabs{gap:4px;padding:4px;border-radius:11px;background:#eff5f3}.tab{border-radius:8px!important}.tab.active{color:#fff!important;background:var(--crm-brand)!important;border:0!important}
.timeline{gap:8px}.timeline-item{padding:12px!important;border:1px solid var(--crm-line);border-radius:11px;background:#fff}
.chat-shell{border-color:var(--crm-line);border-radius:16px;box-shadow:0 12px 38px rgba(20,66,57,.09)}
.chat-list-head{padding:14px}.chat-search{margin:9px 11px;width:calc(100% - 22px)}.chat-row{padding:11px 12px}.chat-messages{padding:16px clamp(12px,2vw,26px)}.chat-bubble{padding:9px 11px 6px}.chat-composer{padding:9px 11px calc(9px + env(safe-area-inset-bottom));gap:6px}.chat-composer textarea{min-height:46px}

@media(max-width:820px){
  :root{--mobile-nav-height:64px}
  body{background:#f5f8f7}.main{padding:calc(6px + var(--mobile-safe-top)) 8px calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 17px)!important}
  .topbar{min-height:51px;margin:0 -8px 8px;padding:7px 9px 7px;gap:7px;background:rgba(248,251,250,.96)}.topbar h1{font-size:19px}.mobile-page-back{width:35px;height:35px;min-width:35px;border-radius:11px;font-size:25px}
  .mobile-tab-bar{min-height:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom));padding:3px 5px calc(3px + var(--mobile-safe-bottom));gap:1px}.mobile-tab{min-height:55px;border-radius:12px}.mobile-tab-icon{font-size:17px!important}.mobile-tab-label{font-size:9px!important}
  .view{margin:0}.panel{padding:12px;border-radius:12px;box-shadow:0 4px 16px rgba(20,66,57,.045)}.panel+.panel{margin-top:9px}.panel-head{gap:7px;margin-bottom:10px}.panel-head h3{font-size:15px}.panel-head p{font-size:10px}
  .btn{min-height:36px;padding:7px 10px;border-radius:9px;font-size:11px}.header-actions #addLeadBtn{right:12px;bottom:calc(var(--mobile-nav-height) + var(--mobile-safe-bottom) + 11px);width:50px;height:50px;min-height:50px;border-radius:16px}
  .stats-grid,.card-grid{display:flex!important;gap:7px!important;margin:0 -2px 10px!important;overflow-x:auto;scroll-snap-type:x proximity;padding:2px 2px 7px}.stat-card,.info-card{flex:0 0 min(42vw,170px);min-height:82px;padding:11px!important;scroll-snap-align:start}.stat-card span,.info-card p{font-size:9px!important}.stat-card strong,.info-card>b{font-size:22px!important}
  .filter-strip{padding:9px!important}.filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.filter-grid>*{min-width:0!important}.filter-grid label:last-child:nth-child(odd){grid-column:1/-1}
  .panel-head-actions{width:100%;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px!important}.panel-head-actions>.btn{width:100%}
  .table-wrap{overflow:visible;border:0;background:transparent}.table-wrap table:not(.keep-table){min-width:0!important}.table-wrap table:not(.keep-table) thead{display:none}.table-wrap table:not(.keep-table) tbody,.table-wrap table:not(.keep-table) tr,.table-wrap table:not(.keep-table) td{display:block;width:100%}.table-wrap table:not(.keep-table) tr{margin-bottom:8px;padding:9px 10px;border:1px solid var(--crm-line);border-radius:11px;background:#fff;box-shadow:0 3px 12px rgba(20,66,57,.035)}.table-wrap table:not(.keep-table) td{display:grid;grid-template-columns:88px minmax(0,1fr);gap:8px;padding:5px 0!important;border:0!important;font-size:10px}.table-wrap table:not(.keep-table) td::before{content:attr(data-label);color:#73857f;font-size:8px;font-weight:800;letter-spacing:.045em;text-transform:uppercase}.table-wrap table:not(.keep-table) td:empty{display:none}
  .row-actions,.inline-actions{flex-wrap:wrap}.row-actions .btn,.inline-actions .btn{min-height:30px;padding:5px 8px}
  .chat-shell{height:calc(100dvh - var(--mobile-nav-height) - var(--mobile-safe-bottom) - 65px)!important;min-height:0;border-radius:0}.chat-head{padding:8px 10px}.chat-messages{padding:11px 8px}.chat-bubble{max-width:88%;font-size:12px}.chat-composer{grid-template-columns:repeat(3,minmax(0,1fr));padding:7px 8px calc(7px + env(safe-area-inset-bottom))}.chat-composer textarea{grid-column:1/-1;min-height:44px}.chat-composer .btn,.chat-attach{min-width:0;min-height:36px;padding:6px;font-size:10px}.whatsapp-window-notice{padding:7px 9px;font-size:9px}
  .modal-form,.drawer-body{width:100vw!important;max-width:none!important;border-radius:20px 20px 0 0!important}.form-grid.two{grid-template-columns:1fr!important}
}

@media(max-width:420px){
  .filter-grid{grid-template-columns:1fr!important}.filter-grid label:last-child:nth-child(odd){grid-column:auto}.stat-card,.info-card{flex-basis:46vw}.panel-head-actions{grid-template-columns:1fr}.chat-row{grid-template-columns:38px minmax(0,1fr) auto}.chat-row-avatar{width:38px;height:38px}
}
