@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@500;700&family=Plus+Jakarta+Sans:wght@400;600;800&display=swap");

:root{
  --turq:#9cc2be;
  --blue:#0e2b58;
  --accent:#3d9691;

  --bg:#f5f7fa;
  --card:#ffffff;
  --text:#0b1220;
  --muted:rgba(11,18,32,.65);
  --border:rgba(14,43,88,.14);
  --shadow:0 10px 30px rgba(0,0,0,.10);
  --radius:18px;
}
.theme-dark{
  --bg:#0f141b;
  --card:#141b24;
  --text:#eef2f7;
  --muted:rgba(238,242,247,.6);
  --border:rgba(238,242,247,.14);
  --shadow:0 10px 30px rgba(0,0,0,.45);
  --blue:#cfe0ff;
}

*{box-sizing:border-box}
html,body{height:100%;background:#0c131c}
body{
  margin:0;
  font-family:"Plus Jakarta Sans",system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
  color:var(--text);
  background:#0c131c;
  overscroll-behavior: none;
}
body.email-shell{
  background:transparent;
}

.logo{height:58px;width:auto;max-width:none;object-fit:contain}
.logo.sm{height:52px;width:auto;max-width:none}
.brand-logo{height:58px;width:auto;max-width:none;object-fit:contain}

.btn{
  border:1px solid transparent;
  border-radius:16px;
  padding:12px 16px;
  font-weight:900;
  cursor:pointer;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
}
.btn:disabled{opacity:.55;cursor:not-allowed}
.btn.primary{background:var(--blue);color:#fff}
.btn.tab-active{background:var(--blue);color:#fff;border-color:var(--blue)}
.btn.secondary{background:var(--card);color:var(--blue);border-color:var(--border)}
.btn.ghost{background:transparent;color:var(--blue);border-color:var(--border)}
.btn.teal{background:var(--turq);color:var(--blue);border-color:rgba(14,43,88,.20)}
.btn.light{background:#fff;color:#111;border-color:var(--border);font-weight:600}
.theme-dark .btn.light{background:#d6dbe3;color:#111;border-color:#d6dbe3}
.btn.wide{width:100%}
.btn.ghost:hover,
.btn.light:hover{filter:brightness(1.04)}
.btn.ghost:active,
.btn.light:active{transform:translateY(1px);filter:brightness(.96)}
.btn.primary:active,
.btn.tab-active:active{transform:translateY(1px);filter:brightness(.94)}
.btn, button{
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}

.input, input, select, textarea{
  width:100%;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid var(--border);
  outline:none;
  background:var(--card);
  color:var(--text);
  font-size:16px;
}
input:focus, select:focus{border-color:rgba(14,43,88,.35)}

label{display:block;font-size:12px;color:var(--muted);margin:12px 0 8px}

.msg{display:none;margin-top:10px;font-size:13px}
.msg.err{color:#fca5a5}
.msg.info{display:none;padding:10px 12px;border-radius:12px;background:rgba(61,150,144,.12);border:1px solid rgba(61,150,144,.28);color:var(--text)}
.msg.ok{color:#065f46}

.h3{margin:0 0 10px;color:var(--blue);font-size:15px}
.hint{margin-top:10px;color:var(--muted);font-size:12px}

.badge{
  display:inline-block;
  padding:5px 10px;
  border-radius:999px;
  font-weight:900;
  font-size:12px;
  border:1px solid var(--border);
}
.badge.ok{background:rgba(34,197,94,.12);color:#166534;border-color:rgba(34,197,94,.25)}
.badge.warn{background:rgba(249,115,22,.12);color:#9a3412;border-color:rgba(249,115,22,.25)}
.badge.off{background:rgba(239,68,68,.12);color:#991b1b;border-color:rgba(239,68,68,.25)}

.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace}

/* LOGIN */
.login-screen{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  transform:translateY(-6px);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(61,150,145,.35), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(156,194,190,.35), transparent 55%),
    linear-gradient(180deg,#0c131c,#0e1723);
  overscroll-behavior: contain;
}
body.email-shell .login-screen{
  background:transparent;
  padding:0;
  transform:none;
  min-height:100%;
}

/* APP TOPBAR (Admin-like) */
.topbar{
  background:linear-gradient(90deg,var(--turq),#b8d5d2);
  border-bottom:1px solid rgba(14,43,88,.10);
  position:sticky;
  top:0;
  z-index:40;
}
.topbar-inner{
  max-width:1400px;
  margin:0 auto;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.topbar-actions{
  position: relative;
  display:flex;
  align-items:center;
  gap:10px;
}
.topbar-timer{
  font-size:12px;
  font-weight:800;
  color:var(--blue);
  background:rgba(14,43,88,.08);
  border:1px solid rgba(14,43,88,.2);
  padding:6px 10px;
  border-radius:999px;
}
.topbar-brand{display:flex;align-items:center;gap:12px}
.t1{font-weight:1000;color:var(--blue);line-height:1;word-spacing:3px}
.t2{font-size:12px;color:rgba(14,43,88,.6);margin-top:4px}
.theme-dark .t2{color:#ffffff}
.dark .topbar .t2{color:#ffffff}
.theme-dark .t1{color:#ffffff}

.menubtn{
  width:44px;
  height:44px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.burger{
  width:20px;
  height:14px;
  display:inline-flex;
  flex-direction:column;
  justify-content:space-between;
}
.burger span{
  display:block;
  height:2px;
  width:100%;
  background:currentColor;
  border-radius:2px;
  opacity:.9;
}
.menu-dd{
  position:absolute;
  top:52px;
  right:0;
  min-width:220px;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 12px 30px rgba(0,0,0,.12);
  padding:8px;
  z-index:50;
}
.menu-item{
  width:100%;
  text-align:left;
  padding:10px 12px;
  border:0;
  border-radius:12px;
  background:transparent;
  cursor:pointer;
  font-weight:600;
  color:rgba(14,43,88,.75);
}
.menu-toprow{
  display:flex;
  align-items:center;
  gap:8px;
  padding:2px 2px 8px;
}
.menu-toprow .menu-item{flex:1}
.menu-theme{
  display:flex;
  align-items:center;
  gap:10px;
}
.theme-icon{
  width:28px;
  height:28px;
  border-radius:999px;
  background:rgba(14,43,88,.12);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
}
.theme-icon svg{width:16px;height:16px;display:block;fill:currentColor}
.menu-item:hover{background:rgba(14,43,88,.08)}
.menu-item.danger:hover{background:rgba(220, 0, 0, .08)}
.menu-sep{
  height:1px;
  background:var(--border);
  margin:6px 0;
  border-radius:1px;
}
.menu-timer{
  cursor: default;
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--blue);
  background: rgba(14,43,88,.06);
  border: 1px solid rgba(14,43,88,.25);
  pointer-events:none;
}
.theme-dark .menu-item{color:rgba(235,240,248,.82)}
.theme-dark .menu-timer{
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.3);
  color: rgba(240,245,255,.9);
}
.theme-dark .topbar{
  background:linear-gradient(90deg,#1a2531,#111926);
  border-bottom:1px solid rgba(255,255,255,.12);
}
.theme-dark .theme-icon{
  background:rgba(255,255,255,.14);
  border-color:rgba(255,255,255,.22);
}

/* Modals */
.portal-modal{
  position:fixed;
  inset:0;
  background:rgba(4,8,12,.6);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:60;
}
.portal-modal-card{
  width:min(520px,100%);
  background:#16202c;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  box-shadow:0 20px 50px rgba(0,0,0,.45);
  padding:18px;
  color:#e8f0ff;
  display:flex;
  flex-direction:column;
  max-height:85vh;
}
.portal-modal-card .btn.primary{
  background:#2b3850;
  border-color:#2b3850;
  color:#ffffff;
}
.portal-modal-card .lbl{color:#e8f0ff}
.portal-modal-body input{
  background:#0f1726;
  border:1px solid rgba(255,255,255,.16);
  color:#f3f7ff;
  border-radius:999px;
}
.portal-modal-body textarea{
  background:#0f1726;
  border:1px solid rgba(255,255,255,.16);
  color:#f3f7ff;
  border-radius:12px;
  resize:vertical;
}
.portal-modal-card .btn{border-radius:999px}
.portal-modal-card .btn.ghost:hover{background:rgba(255,255,255,.06)}
.portal-modal-card .btn.ghost:active{background:rgba(255,255,255,.1)}
.portal-modal.theme-light .portal-modal-card .btn.ghost:hover{background:rgba(14,43,88,.08)}
.portal-modal.theme-light .portal-modal-card .btn.ghost:active{background:rgba(14,43,88,.12)}
.portal-modal-title{
  font-size:18px;
  font-weight:800;
  margin-bottom:10px;
}
.portal-modal-body{
  overflow:auto;
  max-height:60vh;
  padding-right:4px;
}
.portal-modal-hint{
  font-size:12px;
  color:rgba(232,240,255,.7);
  margin-bottom:8px;
}
.portal-modal.theme-light .portal-modal-card{
  background:#ffffff;
  color:#0b1220;
  border:1px solid rgba(14,43,88,.14);
}
.portal-modal.theme-light .portal-modal-card .portal-modal-title{
  color:#0b1220;
}
.portal-modal.theme-light .portal-modal-card .portal-modal-hint{
  color:rgba(11,18,32,.7);
}
.portal-modal.theme-light .portal-modal-card .lbl{color:#0b1220}
.portal-modal.theme-light .portal-modal-body input{
  background:#f5f7fa;
  border:1px solid rgba(14,43,88,.2);
  color:#0b1220;
  border-radius:999px;
}
.portal-modal.theme-light .portal-modal-body textarea{
  background:#f5f7fa;
  border:1px solid rgba(14,43,88,.2);
  color:#0b1220;
  border-radius:12px;
}
.portal-modal.theme-light .portal-modal-card .msg.err{color:#b91c1c}
.portal-modal.theme-light .portal-modal-card .msg.info{color:#0b1220;background:rgba(14,43,88,.08);border-color:rgba(14,43,88,.2)}
.portal-modal.theme-light .portal-modal-card .codebox{
  background:#f5f7fa;
  border-color:rgba(14,43,88,.2);
  color:#0b1220;
}
.portal-modal.theme-light .portal-modal-card .twofa-secret code{
  background:#f5f7fa;
  border-color:rgba(14,43,88,.2);
  color:#0b1220;
}
.portal-modal-actions{
  margin-top:12px;
}
.portal-modal-actions .btn + .btn{margin-top:10px}
.twofa-qr{
  display:flex;
  justify-content:center;
  margin:10px 0;
}
.twofa-qr img{
  width:200px;
  height:200px;
  border-radius:14px;
  background:#fff;
  padding:6px;
}
.twofa-secret code{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  background:#0b122008;
  border:1px solid rgba(255,255,255,.16);
  word-break:break-all;
  color:#f3f7ff;
}
.codebox{
  margin:8px 0 0 0;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background:#0b122008;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  white-space:pre-wrap;
  line-height:1.4;
}

@media (max-width: 900px){
  .topbar-inner{padding:10px 12px}
  .topbar-timer{display:none}
  .menu-dd{min-width:92vw; right:8px;}
  .login-screen{
    position:fixed;
    inset:0;
    padding:12px 22px 22px;
    align-items:center;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
  }
  .login-card{
    max-height:none;
    overflow:visible;
    padding-bottom:48px;
  }
  #registerForm .login-fields{padding-bottom:140px}
  body.login-lock{overflow:hidden;height:100%}
}
.login-card{
  width:min(460px,100%);
  background:#16202c;
  border-radius:22px;
  box-shadow:var(--shadow);
  border:1px solid rgba(255,255,255,.12);
  padding:16px 16px 18px;
  position:relative;
  max-height:calc(100vh - 44px);
  overflow:auto;
  scrollbar-width:none;
}
body.email-shell .login-card{
  border:none;
  box-shadow:none;
}
.login-card::-webkit-scrollbar{width:0;height:0}
.login-screen .logo{height:56px;width:auto;max-width:none;object-fit:contain}
.login-brand{display:flex;align-items:center;gap:12px;margin:0 auto 12px;max-width:400px}
.brand-text{display:flex;flex-direction:column;justify-content:center}
.brand-text .brand-name{font-family:"Fraunces",serif;font-weight:700;color:#e8f0ff;font-size:22px;line-height:1.1}
.brand-text .brand-sub{color:rgba(232,240,255,.8);margin-top:2px;font-weight:900;font-size:13px;line-height:1.1}

.login-tabs{display:flex;gap:10px;margin:10px auto 12px;max-width:400px}
.login-tab{
  border:1px solid rgba(255,255,255,.18);
  color:#f2f6ff;
  background:rgba(255,255,255,.08);
  padding:0 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:900;
  flex:1;
  height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.login-tab.active{background:#2b3850;border-color:#2b3850}

.login-fields{max-width:400px;margin:0 auto}
.section-title{
  font-size:20px;
  font-weight:800;
  color:#e8f0ff;
  margin:8px 0 4px;
  word-spacing:6px;
}
.section-sub{
  color:rgba(232,240,255,.7);
  font-size:13px;
  margin-bottom:10px;
}
.login-fields input,
.login-fields select{
  height:54px;
  border-radius:20px;
  background:#0f1726;
  border:1px solid rgba(255,255,255,.16);
  color:#f3f7ff;
}
.addr-results{
  margin-top:8px;
  border:1px solid rgba(255,255,255,.16);
  background:#0f1726;
  border-radius:14px;
  max-height:220px;
  overflow:auto;
}
.addr-item{
  display:block;
  width:100%;
  text-align:left;
  padding:10px 12px;
  color:#f3f7ff;
  font-size:12px;
  background:transparent;
  border:0;
  border-bottom:1px solid rgba(255,255,255,.08);
  cursor:pointer;
}
.addr-item:last-child{border-bottom:0}
.addr-item:hover{background:rgba(255,255,255,.06)}
.login-fields input::placeholder{color:rgba(243,247,255,.6)}
.login-card .lbl,
.login-card label{
  color:#ffffff !important;
  word-spacing:4px;
}
.login-fields .btn{height:54px;border-radius:20px;margin-top:14px;font-size:15px}
.login-fields .btn + .btn{margin-top:10px}
.paircode-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
}
.paircode-value{
  flex:1;
  height:44px;
  display:flex;
  align-items:center;
  padding:14px;
  border-radius:12px;
  background:rgba(43,56,80,.12);
  color:#2b3850;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
  font-size:18px;
  font-weight:700;
}
.paircode-copy{
  flex:0 0 44px;
  width:44px;
  height:44px;
  border-radius:12px;
  border:1px solid rgba(43,56,80,.25);
  background:rgba(43,56,80,.10);
  color:#2b3850;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
}
.paircode-copy:active{transform:translateY(1px)}
.paircode-copy.copied{
  border-color:rgba(34,197,94,.45);
  background:rgba(34,197,94,.14);
}
.dark .paircode-copy.copied{
  border-color:rgba(34,197,94,.45);
  background:rgba(34,197,94,.14);
}
.dark .paircode-value{
  background:rgba(255,255,255,.08);
  color:#e8f0ff;
}
.dark .paircode-copy{
  border-color:rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  color:#e8f0ff;
}
.paircode-copy .copy-icon{
  width:20px;
  height:20px;
  display:none;
}
.paircode-copy .copy-icon.light{display:block}
.dark .paircode-copy .copy-icon.light{display:none}
.dark .paircode-copy .copy-icon.dark{display:block}
@media (prefers-color-scheme: dark){
  html:not(.light) .paircode-copy .copy-icon.light{display:none}
  html:not(.light) .paircode-copy .copy-icon.dark{display:block}
}

.device-title-row{
  display:flex;
  align-items:center;
  gap:8px;
}
.device-title{
  font-size:14px;
  font-weight:700;
}
.btn-edit-device{
  width:28px;
  height:28px;
  border-radius:999px;
  border:1px solid rgba(43,56,80,.25);
  background:rgba(43,56,80,.08);
  color:#2b3850;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
}
.dark .btn-edit-device{
  border-color:rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  color:#e8f0ff;
}
.btn-edit-device .edit-icon{
  width:14px;
  height:14px;
  display:none;
}
.btn-edit-device .edit-icon.light{display:block}
.dark .btn-edit-device .edit-icon.light{display:none}
.dark .btn-edit-device .edit-icon.dark{display:block}
.device-edit-row{
  display:flex;
  align-items:center;
  gap:6px;
  margin-top:6px;
  margin-bottom:8px;
}
.device-title-input{
  flex:1;
  height:32px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid rgba(43,56,80,.25);
  background:rgba(43,56,80,.08);
  color:#2b3850;
  font-size:13px;
}
.dark .device-title-input{
  border-color:rgba(255,255,255,.18);
  background:rgba(255,255,255,.08);
  color:#e8f0ff;
}
.btn-save-device,
.btn-cancel-device{
  height:32px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid rgba(43,56,80,.25);
  background:transparent;
  color:#2b3850;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.dark .btn-save-device,
.dark .btn-cancel-device{
  border-color:rgba(255,255,255,.18);
  color:#e8f0ff;
}
.btn-unpair{
  border:1px solid rgba(244,63,94,.55);
  border-radius:999px;
  padding:4px 10px;
  background:transparent;
  transition:transform 0.06s ease, background 0.12s ease;
}
.btn-unpair:active{
  transform:translateY(1px);
  background:rgba(244,63,94,.08);
}
.btn-projects{
  border:1px solid rgba(61,150,144,.55);
  border-radius:999px;
  padding:4px 10px;
  background:transparent;
  color:#3d9691;
  transition:transform 0.06s ease, background 0.12s ease;
}
.btn-projects:active{
  transform:translateY(1px);
  background:rgba(61,150,144,.12);
}
.recaptcha-wrap{
  margin:12px 0 4px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:10px;
}
.recaptcha-wrap .g-recaptcha{
  background:#f5f7fb;
  padding:10px 12px;
  border-radius:16px;
  box-shadow:0 8px 20px rgba(0,0,0,.08);
}
.recaptcha-note{
  max-width:360px;
  text-align:left;
  font-size:11px;
  color:rgba(232,240,255,.85);
  line-height:1.45;
  margin:8px auto 0;
}
.legal-links{
  display:block;
  white-space:normal;
  word-break:break-word;
  max-width:360px;
  margin:8px auto 0;
}
.notify-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.notify-row input{
  width:18px;
  height:18px;
  accent-color:#0e2b58;
}

@media (max-width: 640px){
  .grecaptcha-badge{visibility:hidden !important;}
}
.recaptcha-note a{
  color:#9cc2be;
  text-decoration:underline;
}
.recaptcha-more{
  background:none;
  border:0;
  padding:0;
  margin-top:2px;
  font-size:11px;
  color:#9cc2be;
  cursor:pointer;
}
.recaptcha-more-text{margin-top:6px}
.login-screen .btn.primary{background:#2b3850;color:#f5f7fb;border-color:#2b3850}
.login-screen .btn.ghost,
.login-screen .btn.ghost *{
  color:#ffffff !important;
  border-color:rgba(255,255,255,.7) !important;
}
.login-screen .btn.ghost:hover{background:rgba(255,255,255,.06)}
.login-screen .msg{color:#e8f0ff}
.login-screen .msg.info{background:rgba(156,194,190,.16);border-color:rgba(156,194,190,.32)}
.lang-switch{
  position:absolute;
  top:12px;
  right:12px;
  display:flex;
  align-items:flex-start;
  gap:6px;
  z-index:5;
}
.auth-lang-switch{
  position:absolute;
  top:18px;
  right:max(12px, calc(50% - 200px));
  z-index:6;
}
.lang-btn{
  display:flex;
  align-items:center;
  gap:6px;
  padding:6px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.2);
  background:rgba(255,255,255,.12);
  color:#f3f7ff;
  font-weight:800;
  cursor:pointer;
  font-size:12px;
}
.lang-btn img{width:18px;height:12px;border-radius:2px;display:block}
.lang-btn.active{background:#2b3850;border-color:#2b3850}
.lang-menu{
  position:absolute;
  top:38px;
  right:0;
  min-width:110px;
  background:#101826;
  border:1px solid rgba(255,255,255,.18);
  border-radius:14px;
  padding:6px;
  box-shadow:0 12px 30px rgba(0,0,0,.4);
}
.lang-menu.hidden{display:none}
.lang-option{
  width:100%;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid transparent;
  background:transparent;
  color:#f3f7ff;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.menu-dd .lang-switch{
  position:relative;
  top:auto;
  right:auto;
  z-index:auto;
}
.menu-dd .lang-btn{
  border-color:rgba(14,43,88,.16);
  background:rgba(14,43,88,.08);
  color:rgba(14,43,88,.9);
}
.menu-dd .lang-btn.active{
  background:rgba(14,43,88,.14);
  border-color:rgba(14,43,88,.24);
}
.theme-dark .menu-dd .lang-btn{
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.10);
  color:#f3f7ff;
}
.theme-dark .menu-dd .lang-btn.active{
  background:#2b3850;
  border-color:#2b3850;
}
.menu-dd .lang-menu{
  position:absolute;
  top:44px;
  right:0;
  margin-top:0;
  background:#f8fafc;
  border:1px solid rgba(14,43,88,.12);
  color:#0b1220;
  box-shadow:0 14px 26px rgba(14,43,88,.12);
}
.menu-dd .lang-option{color:#0b1220}
.menu-dd .lang-option:hover{background:rgba(14,43,88,.06)}
.theme-dark .menu-dd .lang-menu{
  background:#101826;
  border:1px solid rgba(255,255,255,.18);
  color:#f3f7ff;
  box-shadow:0 12px 30px rgba(0,0,0,.4);
}
.theme-dark .menu-dd .lang-option{color:#f3f7ff}
.theme-dark .menu-dd .lang-option:hover{background:rgba(255,255,255,.08)}
.lang-option:hover{background:rgba(255,255,255,.08)}
.lang-option img{width:18px;height:12px;border-radius:2px}

/* VERIFY */
.verify-body{background:#0c131c}
.verify-screen{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px;
  background:
    radial-gradient(900px 500px at 15% 5%, rgba(61,150,145,.35), transparent 55%),
    radial-gradient(800px 480px at 95% 10%, rgba(33,104,168,.35), transparent 60%),
    linear-gradient(180deg,#0b111a,#0f1726);
}
.verify-card{
  width:min(620px,100%);
  background:#141d2a;
  border-radius:24px;
  padding:24px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 50px rgba(0,0,0,.45);
  position:relative;
  color:#e8f0ff;
}
.verify-card .lang-switch{
  position:static;
  justify-content:flex-end;
  flex-wrap:nowrap;
  gap:8px;
  margin-bottom:12px;
}
.verify-card .lang-switch .lang-menu{
  right:0;
  left:auto;
}
.verify-card .lang-btn{
  padding:6px 10px;
  font-size:12px;
}
.verify-card .lang-btn img{width:18px;height:12px}
.verify-card .lang-menu{
  top:38px;
  right:0;
}
.verify-card .lang-option.active{
  background:#2b3850;
  border-color:#2b3850;
}
.verify-brand{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.verify-hero{margin-bottom:18px}
.verify-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 12px;
  border-radius:999px;
  background:rgba(61,150,145,.18);
  color:#d6f1ee;
  font-weight:800;
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.verify-title{
  margin:12px 0 8px;
  font-family:"Fraunces",serif;
  font-size:28px;
}
.verify-sub{
  margin:0;
  color:rgba(232,240,255,.72);
  font-size:14px;
}
.verify-status{
  margin:18px 0 20px;
  padding:18px;
  border-radius:18px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
}
.status-icon{
  width:44px;
  height:44px;
  border-radius:14px;
  background:rgba(255,255,255,.08);
  margin-bottom:12px;
  position:relative;
}
.status-icon.ok{background:rgba(34,197,94,.18)}
.status-icon.bad{background:rgba(239,68,68,.18)}
.status-icon.expired{background:rgba(249,115,22,.18)}
.status-icon::after{
  content:"";
  position:absolute;
  inset:12px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.45);
}
.status-text{font-weight:800;font-size:18px}
.status-hint{margin-top:6px;color:rgba(232,240,255,.7);font-size:13px}
.verify-actions{display:grid;gap:10px}
.verify-actions .btn{height:54px;border-radius:18px}

@media (max-width:640px){
  .verify-card{padding:18px}
  .verify-title{font-size:24px}
}

/* APP */
.app-shell{min-height:100vh;display:flex;flex-direction:column}
.portal-shell{min-height:100vh;height:auto;overflow:visible}
.portal-main{overflow:visible}

@media (min-width: 801px){
  .portal-shell{height:100vh;overflow:hidden}
  .portal-main{overflow-y:auto}
}
.topbar{
  background:linear-gradient(90deg,var(--turq),#b8d5d2);
  border-bottom:1px solid rgba(14,43,88,.10);
}
.topbar-inner{
  max-width:1400px;
  margin:0 auto;
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.topbar-brand{display:flex;align-items:center;gap:12px}
.topbar-brand .t1{font-weight:900}
.topbar-brand .t2{font-size:12px;color:rgba(14,43,88,.75);font-weight:800}
.topbar-actions{display:flex;align-items:center;gap:10px}

.container{max-width:1400px;margin:0 auto;padding:18px}
.grid{display:grid;grid-template-columns:260px 1fr;gap:16px}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:16px;
  box-shadow:var(--shadow);
}

.sidebar{display:flex;flex-direction:column;gap:10px}
.navbtn{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:transparent;
  cursor:pointer;
  font-weight:900;
  color:var(--text);
  text-align:left;
}
.navbtn.active{background:rgba(61,150,144,.14);border-color:rgba(61,150,144,.35)}
.nav-spacer{flex:1}

.content{min-height:520px}
.content-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.content-head h2{margin:0}

.pills{display:flex;gap:8px;flex-wrap:wrap}
.pill{
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:transparent;
  cursor:pointer;
  font-weight:900;
  color:var(--text);
}
.pill.active{background:rgba(61,150,144,.16);border-color:rgba(61,150,144,.45)}

.section{display:none}
.section.active{display:block}

.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.stat-card{padding:16px;border-radius:16px;border:1px solid var(--border);background:var(--card)}
.stat-title{font-size:12px;color:var(--muted);font-weight:800}
.stat-value{font-size:24px;font-weight:1000;margin-top:6px}

.tablets{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.device-card{padding:14px;border:1px solid var(--border);border-radius:16px;background:var(--card)}
.device-title{font-weight:900}
.device-meta{color:var(--muted);font-size:12px;margin-top:6px}

.contract-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
.contract-item{padding:12px;border:1px solid var(--border);border-radius:14px;background:var(--card)}
.contract-item .lbl{font-size:12px;color:var(--muted);font-weight:800}
.contract-item .val{font-weight:900;margin-top:6px}

.chart-box{padding:16px;border:1px solid var(--border);border-radius:16px;background:var(--card)}
.bar-row{display:flex;align-items:flex-end;gap:8px;height:160px;margin-top:8px}
.bar{flex:1;background:rgba(61,150,144,.35);border-radius:8px}
.chart-scroll{
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:thin;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  align-items:center;
}
.chart-bars{display:flex;align-items:flex-end;min-height:240px;height:240px;min-width:720px;gap:10px;margin:0 auto}
.chart-bar{
  flex:0 0 18px;
  border-radius:10px;
  background:linear-gradient(180deg, rgba(61,150,144,.85), rgba(61,150,144,.25));
  cursor:pointer;
  box-shadow:0 8px 18px rgba(12,24,40,.2);
}
.chart-bar.friday{
  background:linear-gradient(180deg, rgba(233,120,67,.95), rgba(233,120,67,.35));
}
.chart-bar strong{display:block;text-align:center;font-size:10px;margin-top:6px;color:var(--muted)}
.chart-bar.max{position:relative}
.chart-bar.max .chart-max{
  position:absolute;
  top:-18px;
  left:50%;
  transform:translateX(-50%);
  font-size:10px;
  font-weight:900;
  color:var(--text);
  white-space:nowrap;
}
.chart-labels{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:18px;
  column-gap:10px;
  min-width:720px;
  justify-content:start;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:10px;
  margin:0 auto;
  margin-top:8px;
}
.chart-labels span{
  text-align:center;
  font-size:10px;
  font-weight:800;
  color:var(--muted);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:18px;
  width:18px;
}
.chart-labels span:not(:empty){
  background:transparent;
  border:none;
  border-radius:0;
  padding:0;
}
.chart-labels span:empty{visibility:hidden}
.legend-dot{display:inline-block;width:8px;height:8px;border-radius:999px;margin-left:6px}
.legend-dot.friday{background:rgba(233,120,67,.9)}
.chart-tooltip{
  position:absolute;
  z-index:10;
  min-width:140px;
  max-width:240px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--card);
  color:var(--text);
  font-size:11px;
  line-height:1.2;
  box-shadow:0 12px 24px rgba(5,15,30,.18);
  pointer-events:none;
}
.chart-tooltip .tt-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.chart-tooltip .tt-label{color:var(--muted);font-weight:700;text-transform:uppercase;font-size:10px;letter-spacing:.06em}
.chart-tooltip .tt-value{font-weight:800}

.plan-card{
  padding:20px;
  border-radius:18px;
  border:1px solid rgba(61,150,144,.25);
  background:linear-gradient(135deg, rgba(61,150,144,.08), rgba(18,32,54,.04));
}
.theme-dark .plan-card{
  background:linear-gradient(135deg, rgba(10,20,34,.9), rgba(16,28,48,.7));
  border-color:rgba(61,150,144,.35);
}
.plan-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.plan-chip{
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.7);
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:6px;
  min-height:72px;
}
.theme-dark .plan-chip{
  background:rgba(7,14,24,.75);
  border-color:rgba(255,255,255,.08);
}
.plan-chip-label{font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:800;color:var(--muted)}
.plan-chip-value{font-size:15px;font-weight:900;color:var(--text)}
.plan-chip.status-active{
  border-color:rgba(34,197,94,.35);
  background:rgba(34,197,94,.1);
}
.theme-dark .plan-chip.status-active{
  background:rgba(34,197,94,.12);
  border-color:rgba(34,197,94,.35);
}
.plan-chip.status-blocked{
  border-color:rgba(239,68,68,.45);
  background:rgba(239,68,68,.12);
}
.theme-dark .plan-chip.status-blocked{
  background:rgba(239,68,68,.14);
  border-color:rgba(239,68,68,.45);
}
.plan-chip.status-pending{
  border-color:rgba(249,115,22,.45);
  background:rgba(249,115,22,.12);
}
.theme-dark .plan-chip.status-pending{
  background:rgba(249,115,22,.14);
  border-color:rgba(249,115,22,.45);
}

.pill-select{
  height:44px;
  min-width:200px;
  max-width:260px;
  padding:8px 36px 8px 14px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.75);
  color:var(--text);
  font-size:12px;
  font-weight:800;
  appearance:none;
  background-image:linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:calc(100% - 18px) 18px, calc(100% - 12px) 18px;
  background-size:6px 6px, 6px 6px;
  background-repeat:no-repeat;
}
.theme-dark .pill-select{
  background:rgba(10,18,30,.92);
  border-color:rgba(255,255,255,.12);
  color:#f2f5fb;
}
.pill-select:focus{outline:none;box-shadow:0 0 0 2px rgba(61,150,144,.35)}
.pill-select option{color:#0f172a;background:#e5e7eb}
.theme-dark .pill-select option{background:#0b1322;color:#f2f5fb}

.calendar{display:flex;flex-direction:column;gap:14px}
.calendar-weekdays{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.calendar-weekdays span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:800;text-align:center}
.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:8px}
.calendar-day{
  min-height:48px;
  border:1px solid var(--border);
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  cursor:pointer;
  background:var(--card);
  color:var(--text);
  position:relative;
}
.calendar-day.inactive{opacity:.35;cursor:default}
.calendar-day.has-data{box-shadow:0 6px 14px rgba(10,25,40,.12)}
.calendar-day.friday{border-color:rgba(233,120,67,.65)}
.calendar-day.selected{
  outline:2px solid rgba(61,150,144,.55);
  background:rgba(61,150,144,.18);
}
.calendar-day.selected.friday{
  outline:2px solid rgba(233,120,67,.65);
  background:rgba(233,120,67,.18);
}
.calendar-day .cal-dot{
  position:absolute;
  bottom:6px;
  width:6px;
  height:6px;
  border-radius:999px;
  background:rgba(61,150,144,.6);
}
.calendar-day.friday .cal-dot{background:rgba(233,120,67,.9)}

.transactions-list{
  max-height:380px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:16px;
  padding-right:4px;
}
.tx-day{display:flex;flex-direction:column;gap:8px}
.tx-day-title{font-size:12px;font-weight:900;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.tx-items{display:flex;flex-direction:column;gap:8px}
.tx-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--card);
}
.tx-meta{font-size:12px;color:var(--muted);font-weight:700}
.tx-amount{font-weight:900}

.friday-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.friday-row{
  display:grid;
  grid-template-columns:220px 1fr;
  column-gap:18px;
  row-gap:8px;
  align-items:center;
}
.friday-date{
  height:36px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:900;
  color:#0b1220;
  background:rgba(61,150,144,.25);
  border:1px solid rgba(8,14,22,.45);
  white-space:nowrap;
  margin-bottom:0;
  margin-top:8px;
}
.theme-dark .friday-date{
  color:#e8f1ff;
  background:rgba(12,24,40,.8);
  border-color:rgba(10,16,26,.8);
}
.friday-bar{
  height:26px;
  border-radius:999px;
  background:linear-gradient(90deg, rgba(233,120,67,.95), rgba(233,120,67,.35));
}
.friday-bar-wrap{
  position:relative;
  height:26px;
  background:rgba(255,255,255,.06);
  border-radius:999px;
  border:1px solid var(--border);
}
.friday-bar-value{
  position:absolute;
  right:0;
  top:-16px;
  font-size:12px;
  font-weight:900;
  color:var(--text);
}

@media (max-width: 800px){
  .calendar-day{min-height:42px}
  .transactions-list{max-height:none;overflow:visible}
  .plan-grid{grid-template-columns:1fr}
  .plan-chip{min-height:64px}
  .pill-select{min-width:140px;max-width:200px;height:44px;text-align:center;border-radius:999px;appearance:none}
  .pill-select{display:block}
  .pill-select option{border-radius:999px}
  .calendar-controls,.activity-controls,.friday-controls{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px 10px;
    align-items:center;
  }
  .calendar-controls .control-pair,.activity-controls .control-pair,.friday-controls .control-pair{
    display:flex;
    flex-direction:column;
    gap:4px;
    align-items:center;
  }
  .calendar-controls label,.activity-controls label,.friday-controls label{width:100%;text-align:center}
  .calendar-controls select,.activity-controls select,.friday-controls select{
    width:100%;
    text-align:center;
    text-align-last:center;
    padding-left:0;
    padding-right:0;
  }
  .chart-scroll{overflow-x:hidden}
  .chart-bars{min-width:0;width:100%}
  .chart-bar{flex:1 1 0}
  .chart-labels{min-width:0;column-gap:6px;padding-top:8px}
  .mini-total-card{min-width:220px}
  .portal-shell{height:auto;min-height:100vh;overflow:visible}
  .portal-main{overflow:visible}
  .friday-row{grid-template-columns:1fr;gap:12px}
  .friday-date{justify-content:center;padding:0 10px}
  .friday-bar-wrap{margin-top:12px;margin-bottom:10px;max-width:100%}
  .friday-bar-value{top:-22px;font-size:12px}
  .circle-mobile{border-radius:999px}
  .circle-mobile{height:44px}
}
.bar strong{display:block;text-align:center;font-size:11px;margin-top:6px;color:var(--muted)}

.split{display:grid;grid-template-columns:1fr 1fr;gap:12px}

.hidden{display:none !important}
.row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

@media (max-width: 1100px){
  .grid{grid-template-columns:1fr}
  .sidebar{flex-direction:row;flex-wrap:wrap}
  .navbtn{width:auto}
}
@media (max-width: 800px){
  .stats-grid{grid-template-columns:1fr}
  .tablets{grid-template-columns:1fr}
  .contract-grid{grid-template-columns:1fr}
  .split{grid-template-columns:1fr}
}

/* Device projects modal */
.dp-stack{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.dp-item{border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:10px;background:rgba(8,16,28,.35)}
.theme-light .dp-item{border-color:rgba(14,43,88,.12);background:rgba(14,43,88,.04)}
.dp-item .row{gap:8px;flex-wrap:wrap}
.dp-item .input,.dp-item textarea{width:100%}
.status-dot{
  display:inline-block;
  width:8px;
  height:8px;
  border-radius:999px;
  margin-right:6px;
  vertical-align:middle;
}
.dp-item textarea{min-height:120px}
.dp-item input[type="checkbox"]{
  width:20px;
  height:20px;
  border-radius:6px;
  border:2px solid rgba(14,43,88,.45);
  background:transparent;
  appearance:none;
  display:grid;
  place-items:center;
}
.dp-item input[type="checkbox"]::after{
  content:"";
  width:6px;
  height:12px;
  border-right:2px solid #0e2b58;
  border-bottom:2px solid #0e2b58;
  transform:rotate(45deg) scale(0);
  transition:transform .08s ease-in-out;
}
.dp-item input[type="checkbox"]:checked{
  background:rgba(14,43,88,.12);
  border-color:#0e2b58;
}
.dp-item input[type="checkbox"]:checked::after{
  transform:rotate(45deg) scale(1);
}
.mini-total{
  margin-top:10px;
  display:flex;
  justify-content:center;
}
.mini-total.calendar-selected{
  margin-bottom:18px;
}
.mini-total-card{
  min-width:240px;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  text-align:center;
}
.mini-total-label{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:var(--muted);
  font-weight:800;
}
.mini-total-value{
  font-size:14px;
  font-weight:900;
  margin-top:4px;
}
