:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Arial,sans-serif;color:#dce9ef;background:#0b1420;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}button{cursor:pointer;border:1px solid #2e485b;border-radius:9px;background:#183142;color:#e2f0f5;padding:10px 14px;transition:filter .15s}button:hover{filter:brightness(1.18)}button:disabled{opacity:.48;cursor:not-allowed}input,textarea{width:100%;border:1px solid #314c5c;border-radius:9px;background:#101f2a;color:#e7f0f5;padding:12px;outline:none}input:focus,textarea:focus{border-color:#38bdf8}label{display:block;color:#bfd2dd;font-size:13px;font-weight:600;margin:0 0 15px}label input{margin-top:7px}.primary{background:#0284c7;color:#e0f2fe;border:1px solid #0284c7;font-weight:750}.danger{background:#4f2731;border-color:#93515f;color:#ffd6df}.subtle{background:transparent;border:1px solid #335060}.muted,small{color:#8ca7b6;font-size:12px}.error{color:#ff9da9;font-size:13px;min-height:18px}.hidden{display:none!important}.login-page{min-height:100vh;display:grid;place-items:center;padding:20px;background:radial-gradient(circle at 30% 20%,#123d68,#0b1420 55%)}.login-card{width:min(100%,420px);background:#12222e;border:1px solid #294454;padding:33px;border-radius:18px;box-shadow:0 22px 80px #0005}.login-card h1{font-size:25px;margin:16px 0 3px}.login-card>p{margin:0 0 26px}.login-card button{width:100%}.logo{background:#0284c7;color:#e0f2fe;font-size:22px;font-weight:1000;width:47px;height:47px;border-radius:14px;display:grid;place-items:center;letter-spacing:-2px}.logo span{color:white}.logo.small{width:38px;height:38px;font-size:18px;border-radius:11px}.app-page{display:flex;height:100vh;min-height:600px}.sidebar{width:250px;flex-shrink:0;background:#0c1b26;border-right:1px solid #203746;display:flex;flex-direction:column;padding:20px 12px}.brandmark{display:flex;align-items:center;gap:10px;padding:3px 11px 25px}.brandmark b{font-size:14px}.brandmark small{display:block;margin-top:3px}.side-caption{color:#637e8d;font-size:10px;font-weight:900;letter-spacing:1.4px;margin:20px 13px 9px}.brand-list{max-height:34vh;overflow:auto}.brand-button,.nav{display:flex;width:100%;align-items:center;gap:7px;text-align:left;background:transparent;border:0;padding:11px 14px;border-radius:9px;font-size:13px;color:#a7beca;margin:3px 0}.brand-button.active,.nav.active{background:#183e44;color:#aff1d9}.brand-button .mini-dot{width:8px;height:8px;background:#38bdf8;border-radius:50%;margin-right:5px}.sidebar-bottom{margin-top:auto;padding:14px 12px;border-top:1px solid #254052;color:#a7c2cf;font-size:13px}.sidebar-bottom button{width:100%;margin-top:12px}.main{flex:1;min-width:0;display:flex;flex-direction:column}.topbar{height:83px;min-height:83px;padding:18px 27px;border-bottom:1px solid #233949;display:flex;justify-content:space-between;align-items:center}.topbar h2{font-size:19px;margin:0 0 4px}.clock{font-size:13px;color:#a6c1cd;text-align:right}.tab-pane{flex:1;min-height:0;overflow-y:auto}.inbox-layout{display:grid;grid-template-columns:315px 1fr}.conversations{border-right:1px solid #263d4a;display:flex;flex-direction:column;min-height:0}.pane-heading{display:flex;align-items:center;justify-content:space-between;padding:19px 16px 12px}.conversations>input{margin:0 13px 12px;width:calc(100% - 26px)}.pill{background:#21464a;padding:3px 9px;border-radius:10px;font-size:12px}.conversation-list{overflow:auto;flex:1}.conversation-item{width:100%;padding:14px;border:0;border-radius:0;border-bottom:1px solid #213645;display:flex;gap:10px;text-align:left;background:transparent}.conversation-item.selected{background:#193640}.avatar{display:grid;place-items:center;min-width:38px;width:38px;height:38px;border-radius:50%;background:#245867;color:#d5fff0;font-weight:750}.conv-content{flex:1;min-width:0}.conv-top{display:flex;align-items:center;justify-content:space-between;gap:9px}.conv-top b{font-size:13px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.conv-content p{font-size:12px;margin:5px 0;color:#87a7b6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.conv-top small{white-space:nowrap;font-size:10px}.unread{background:#0284c7;color:#e0f2fe;border-radius:20px;padding:2px 7px;font-size:11px}.chat{min-height:0;display:flex;flex-direction:column}.chat-header{padding:15px 21px;border-bottom:1px solid #233d4c;min-height:66px}.chat-header b,.chat-header small{display:block}.chat-header small{margin-top:5px}.message-list{flex:1;overflow:auto;padding:20px 22px;display:flex;flex-direction:column;align-items:flex-start;gap:10px;background:repeating-linear-gradient(135deg,#0c1823,#0c1823 60px,#0d1b26 61px,#0d1b26 63px)}.bubble{max-width:min(78%,650px);background:#203444;padding:11px 13px;border-radius:12px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}.bubble.mine{background:#125747;align-self:flex-end}.bubble .meta{display:block;color:#9fb9bc;font-size:10px;text-align:right;margin-top:8px}.reply-form{display:flex;gap:10px;border-top:1px solid #233d4c;padding:13px}.reply-form textarea{resize:vertical;min-height:50px;max-height:150px}.reply-form button{align-self:end;height:50px}.placeholder{padding:16px;color:#8aa3b2;font-size:13px}.panel-width{padding:27px;width:min(100%,900px);margin:auto}.panel-width h3{margin:0 0 12px;font-size:19px}.panel-width>p{margin:0 0 23px}.card{background:#122632;border:1px solid #284757;border-radius:14px;padding:21px;margin:0 0 20px}.card h3{font-size:15px;margin:0 0 15px}.button-row,.inline-form{display:flex;align-items:center;gap:11px;flex-wrap:wrap}.inline-form input{flex:1;min-width:185px}.status-row{font-weight:700;padding:8px 0 5px}.qr-container{margin:18px 0}.qr-container img{width:230px;height:230px;background:white;border-radius:12px;padding:7px}.pair-form{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin:14px 0}.pair-form label{flex:1;min-width:200px;margin:0}.pair-code{font-size:20px;letter-spacing:3px;font-weight:800;color:#7dd3fc}.checks{display:flex;gap:15px;flex-wrap:wrap;margin:12px 0}.checks label{display:inline-flex;align-items:center;gap:6px;margin:0}.checks input{width:auto}.user-row{padding:16px 0;border-bottom:1px solid #274454}.user-head{display:flex;justify-content:space-between;gap:10px;align-items:center}.user-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:11px}.user-actions button{font-size:11px;padding:7px 9px}.status-badge{padding:3px 8px;border-radius:7px;background:#1f5648;color:#a2efd8;font-size:11px}.status-badge.off{background:#50373a;color:#ffb9bf}.audit-row{padding:12px 2px;border-bottom:1px solid #244252;font-size:12px}.audit-row small{display:block;margin-top:5px}.stack-form{max-width:420px}.stack-form button{width:100%}.flash{background:#0c4a6e;color:#e0f2fe;padding:11px 20px;font-size:13px}.flash.bad{background:#65303e;color:#fff}.flash:not(.hidden){display:block}@media(max-width:850px){.sidebar{width:195px}.inbox-layout{grid-template-columns:245px 1fr}.topbar{padding:12px 17px}}@media(max-width:640px){.app-page{height:auto;min-height:100vh;display:block}.sidebar{width:100%;padding:10px;display:block}.brandmark{padding:5px}.side-caption{margin:6px 8px}.brand-list{display:flex;max-height:none;overflow:auto}.brand-button{min-width:115px}.nav{width:auto;display:inline-flex;margin:3px}.sidebar-bottom{display:flex;gap:9px;justify-content:space-between;align-items:center}.sidebar-bottom button{width:auto;margin:0}.main{height:calc(100vh - 270px);min-height:520px}.topbar{height:65px;min-height:65px}.inbox-layout{grid-template-columns:140px 1fr}.conversation-item{padding:9px 6px}.avatar{display:none}.conv-top small{display:none}.message-list{padding:9px}.reply-form{padding:8px;gap:6px}.reply-form button{padding:8px}.panel-width{padding:15px}.clock{font-size:10px}}

select{font:inherit;width:100%;border:1px solid #314c5c;border-radius:9px;background:#101f2a;color:#e7f0f5;padding:12px;outline:none;margin-top:7px}.report-filters{display:flex;gap:12px;align-items:end;flex-wrap:wrap}.report-filters label{flex:1;min-width:155px;margin:0}.report-filters button{min-height:45px}.report-row{padding:14px 0;border-bottom:1px solid #284757}.report-row .report-head{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}.report-body{margin:9px 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}.report-row button{padding:6px 10px;font-size:12px}

/* v0.3 Manajemen Brand — frontend-only */
.brand-manage-list{display:grid;gap:12px;margin-top:18px}
.brand-edit-row{display:grid;grid-template-columns:110px minmax(120px,1fr) auto;gap:12px;align-items:center;margin:0}
.brand-edit-row label{font-size:13px;font-weight:600;margin:0}
.brand-edit-row input{margin:0;min-width:0}
.brand-edit-row button{white-space:nowrap}
@media(max-width:640px){.brand-edit-row{grid-template-columns:1fr}.brand-edit-row button{width:100%}}

/* v0.6 notification controls */
.topbar-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap}
.notif-bell{position:relative;min-width:45px;border-radius:10px;white-space:nowrap}
.notif-badge{display:inline-flex;align-items:center;justify-content:center;background:#e53935;color:white;
  font-size:11px;font-weight:700;min-width:18px;height:18px;border-radius:99px;padding:0 5px;margin-left:6px;line-height:1}
.notif-badge.hidden{display:none!important}
.brand-button .notif-badge{margin-left:auto}
.sound-toggle{font-size:12px;white-space:nowrap}
@media(max-width:650px){.topbar-actions{gap:5px}.sound-toggle{font-size:11px}.clock{font-size:10px}}

/* v0.7 read-only WhatsApp account archive */
.archive-item{padding:12px 0;border-bottom:1px solid #294655;display:flex;gap:7px;align-items:flex-start;flex-direction:column}
.archive-item b{font-size:13px}.archive-item small{display:block;white-space:pre-wrap;overflow-wrap:anywhere}
.archive-item button{font-size:12px;padding:7px 11px}.archive-list{max-height:400px;overflow:auto}
.archive-message{padding:12px;margin:8px 0;border-radius:10px;background:#1e3947;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}
.archive-message.mine{background:#165749}.archive-message small{display:block;margin-top:5px}


/* v0.8 kredensial sekali dengan tombol salin */
.one-time-credential-dialog{width:min(96vw,530px);max-height:90vh;overflow:auto;background:#122632;color:#e8f2f6;border:1px solid #416273;border-radius:15px;padding:0;box-shadow:0 22px 90px #000b}
.one-time-credential-dialog::backdrop{background:#000b}
.one-time-inner{padding:22px;display:flex;flex-direction:column;gap:13px}
.one-time-inner h3{margin:0;font-size:19px}
.one-time-inner label{margin:0;flex:1;min-width:170px}
.one-time-inner input{margin-top:7px;font-family:ui-monospace,monospace;user-select:text}
.temp-field{display:flex;align-items:end;flex-wrap:wrap;gap:7px}
.temp-field button{white-space:nowrap;padding:11px}
#tempCredFeedback{min-height:21px;font-size:12px;color:#a4e9d4}
#tempCredClose{width:100%}


/* WA CS Panel v0.10 — compact brand selector */
/* 5 brands fit without a scrollbar; extra brands scroll only when needed. */
#appPage .sidebar #brandList.brand-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 5px;
  width: 100%;
  max-height: clamp(114px, 26vh, 260px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #365763 transparent;
}
#appPage .sidebar #brandList .brand-button {
  min-width: 0;
  min-height: 33px;
  width: 100%;
  margin: 0;
  padding: 6px 8px;
  gap: 5px;
  font-size: 12px;
  line-height: 19px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-radius: 8px;
}
#appPage .sidebar #brandList .brand-button .mini-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  margin-right: 0;
}
#appPage .sidebar #brandList .brand-button .notif-badge {
  flex: 0 0 auto;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  padding: 0 4px;
  margin-left: auto;
}
#appPage .sidebar #brandList .brand-button:focus-visible {
  outline: 2px solid #56d8bd;
  outline-offset: -2px;
}
/* On phones, use the available width. No horizontal brand scrolling. */
@media (max-width: 640px) {
  #appPage .sidebar #brandList.brand-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: clamp(80px, 24vh, 210px);
  }
  #appPage .sidebar #brandList .brand-button {
    min-width: 0;
    padding: 6px;
    font-size: 11px;
  }
}
@media (max-width: 420px) {
  #appPage .sidebar #brandList.brand-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* End WA CS Panel v0.10 compact brand selector */



/* v0.11: scoped operational controls */
.workflow-strip{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 14px;border-bottom:1px solid #254454;background:#112431}
.workflow-strip .workflow-status{font-size:12px;flex:1;min-width:140px;color:#b8d7dc}
.workflow-strip button,.workflow-strip select{font-size:12px;padding:7px;min-width:0;width:auto;margin:0}
.internal-notes{border-bottom:1px solid #254454;background:#0d1f2a;padding:7px 14px}
.internal-notes summary{cursor:pointer;font-size:12px;color:#b5d6d6}
.internal-notes textarea{min-height:55px;resize:vertical;margin:7px 0}
.internal-notes .note-row{padding:5px;border-bottom:1px solid #284554;font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere}
.internal-notes .note-row small{display:block;margin-top:3px}
.quick-reply-picker{border-top:1px solid #233d4c;padding:7px 12px;display:flex;gap:8px;align-items:center}
.quick-reply-picker select{margin:0;padding:6px;font-size:12px;min-width:0;flex:1}
.quick-reply-picker button{padding:6px 10px;font-size:12px}
.quick-reply-item{border-bottom:1px solid #254454;padding:10px 2px;display:flex;gap:10px;justify-content:space-between;align-items:center}
.quick-reply-item b{font-size:13px}.quick-reply-item p{font-size:12px;white-space:pre-wrap;overflow-wrap:anywhere;margin:5px 0}
.quick-reply-item button{flex-shrink:0}
.wa-overview-item{border-bottom:1px solid #254454;padding:12px 0;display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap}
.wa-overview-item small{display:block}
.otp-setup-qr{display:block;max-width:184px;background:white;padding:7px;border-radius:8px;margin:5px auto}
.otp-setup-tip{font-size:12px;color:#b9d8d6;white-space:normal;margin:6px 0}
.login-otp-tip{font-size:11px;color:#a1bfca;margin:-7px 0 16px}
@media(max-width:640px){.workflow-strip{padding:6px}.workflow-strip .workflow-status{width:100%}.quick-reply-picker{padding:6px}}


/* v0.12 media attachment UI (global for all roles) */
.reply-form #attachFile {flex:0 0 auto;min-width:44px;font-size:22px;line-height:1.2;align-self:stretch}
.media-pending {display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 14px;background:#122b35;border:1px solid #386175;border-radius:10px;color:#d5e8ef;max-height:180px;overflow:auto}
.media-pending.hidden {display:none!important}
.media-pending img {max-width:105px;max-height:120px;object-fit:contain;border-radius:6px}
.media-pending span {flex:1;min-width:160px;overflow-wrap:anywhere;font-size:13px}
.media-pending button {flex:0 0 auto}


/* v0.11 sidebar correction: preserve visible brand list after more nav items */
#appPage .sidebar {overflow-y:auto;min-height:0}
#appPage .sidebar #brandList.brand-list {flex:0 0 auto;max-height:none;overflow:visible}
#appPage .sidebar .nav,#appPage .sidebar .side-caption,#appPage .sidebar .brandmark,#appPage .sidebar .sidebar-bottom {flex-shrink:0}

/* Telegram theme and collapsible navigation */
:root{--accent:#38bdf8;--accent2:#0284c7;--green:#38bdf8;--green-dark:#0284c7}
button.primary{background:#0284c7;color:#fff}.brand-button.active,.nav.active{background:#0c4a6e;color:#e0f2fe}.logo{background:#0284c7;color:white}.logo span{color:#bae6fd}.mini-dot{background:#38bdf8}.bubble.mine{background:#153e62}.media-preview{max-width:340px;max-height:220px;object-fit:contain}.delivery-card{padding:16px;border:1px solid #334155;border-radius:12px;margin:12px 0;overflow-wrap:anywhere}.delivery-card small{display:block}.checks label{display:flex;gap:8px;align-items:center}.checks input{width:auto}.stack-form{display:grid;gap:14px}.nav-collapsed .sidebar{display:none}.nav-collapsed .app-page{grid-template-columns:1fr}.nav-collapsed .main{width:100%;margin-left:0}.bubble a{color:#7dd3fc}.delivery-card p{white-space:pre-wrap}#targetList{display:grid}#navToggle{flex-shrink:0}
@media(max-width:800px){.sidebar{display:none}.app-page{grid-template-columns:1fr}.mobile-nav .sidebar{display:flex;position:fixed;inset:0 auto 0 0;width:270px;z-index:40;overflow-y:auto}.topbar{gap:10px}.topbar-actions{flex-wrap:wrap}.panel-width{padding:12px}.clock{font-size:11px}.inbox-layout{grid-template-columns:1fr}.conversations{max-height:260px}.chat{min-height:450px}}

.sidebar{overflow-y:auto}.brand-list{flex-shrink:0}.brand-button .mini-dot{background:#38bdf8}.flash{background:#0c4a6e;color:#e0f2fe}.flash.bad{background:#65303e}.stack-form{max-width:640px}
@media(max-width:800px){.main{height:auto;min-height:100vh}.app-page{height:auto;min-height:100vh}.topbar{height:auto;min-height:83px}.inbox-layout{display:flex;flex-direction:column}.conversations{min-height:200px}.chat{height:65vh;min-height:450px}.sidebar{display:none}.mobile-nav .sidebar{display:block;width:270px;height:100vh}}
