/* SkinAAP Partner Hub - Common Styles */
:root{
  --bg:#F7F8FA; --card:#fff; --card-2:#fbfcff; --txt:#1c2230; --muted:#67708a;
  --border:#e8ebf2; --accent:#ff6c6c; --shadow:0 6px 20px rgba(15,25,40,.06);
  --r:14px;
}
[data-theme="dark"]{ --bg:#0f0f23; --card:#1a1a2e; --card-2:#222247; --txt:#e2e8f0; --muted:#94a3b8; --border:#2d3748; --accent:#ff6b6b; --shadow:0 6px 20px rgba(0,0,0,.35) }
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--txt);font-family:-apple-system,BlinkMacSystemFont,"Pretendard","Segoe UI",Roboto,"Noto Sans KR",Arial,sans-serif}

.container{max-width:1200px;margin:0 auto;padding:28px 16px 64px}

.auth-body{min-height:100vh;display:flex;align-items:center;justify-content:center;background:var(--bg);padding:32px}
.auth-shell{width:min(420px,100%);display:flex;flex-direction:column;gap:18px}
.auth-header{display:flex;justify-content:flex-end}
.auth-card{background:var(--card);border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);padding:32px;display:flex;flex-direction:column;gap:20px}
.auth-brand{display:flex;flex-direction:column;gap:6px}
.auth-brand-logos{display:flex;align-items:center;gap:10px}
.auth-brand-title{font-size:20px;font-weight:700;color:var(--txt)}
.auth-footer{text-align:center;font-size:12px}
.auth-msg{min-height:18px}
.auth-helper{text-align:center;font-size:13px;color:var(--muted)}
.auth-helper a{color:inherit;text-decoration:none}
.auth-helper a:hover{text-decoration:underline}

[data-theme="dark"] .auth-card{background:#1a1a2e;border-color:#3d4465}
[data-theme="dark"] .auth-footer{color:#94a3b8}
[data-theme="dark"] .function-item{background:#1e1e3f;border-color:#3d4465}
[data-theme="dark"] .product-image-preview{border-color:#3d4465;background:#1e1e3f}
[data-theme="dark"] .product-thumb{border-color:#3d4465;background:#1e1e3f}

.product-form-shell{display:grid;grid-template-columns:260px minmax(0,1fr);gap:28px;align-items:flex-start}
.product-form-shell .badge{margin-bottom:6px}
.product-form-aside{position:sticky;top:88px;display:flex;flex-direction:column;gap:14px;padding:22px;border-radius:16px;background:linear-gradient(145deg,rgba(37,99,235,.08),rgba(37,99,235,.02));border:1px solid rgba(37,99,235,.18);color:#1d2a52;font-size:13px;line-height:1.6}
[data-theme="dark"] .product-form-aside{background:linear-gradient(145deg,rgba(59,130,246,.16),rgba(59,130,246,.04));border-color:rgba(96,165,250,.28);color:#e2e8f0}
.product-aside-title{font-weight:700;font-size:16px;letter-spacing:-.01em;color:inherit}
.product-aside-desc{margin:0;color:inherit}
.product-aside-list{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:6px;color:inherit}
.product-aside-list li{list-style:disc}
.product-aside-tip{margin-top:4px;padding:10px 12px;border-radius:12px;background:rgba(37,99,235,.08);font-weight:500;color:inherit}
[data-theme="dark"] .product-aside-tip{background:rgba(96,165,250,.16)}
.product-form{display:flex;flex-direction:column;gap:30px;padding:26px;border:1px solid var(--border);border-radius:18px;background:var(--card-2);box-shadow:var(--shadow)}
.product-form-header{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
.product-form-header h3{margin:0;font-size:20px;font-weight:700;color:var(--txt);letter-spacing:-.01em}
.product-form-header p{margin:0;color:var(--muted);font-size:13px}
.product-form-row{display:grid;grid-template-columns:280px 1fr;gap:20px;align-items:flex-start}
.product-field{display:flex;flex-direction:column;gap:14px}
.product-image-upload{display:flex;flex-direction:column;gap:10px}
.product-image-actions{display:flex;flex-wrap:wrap;gap:8px}
.product-image-preview{width:100%;max-height:200px;object-fit:cover;border-radius:12px;border:1px solid var(--border);background:var(--card-2)}
.locale-list{display:flex;flex-direction:column;gap:8px}
.locale-row{display:grid;grid-template-columns:140px minmax(0,1fr) minmax(0,1fr) 80px;gap:8px;align-items:center}
.locale-row .locale-remove{white-space:nowrap}
.function-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:8px}
.function-item{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--border);border-radius:10px;background:var(--card-2);font-size:13px}
.function-item input{margin:0}
.product-thumb{width:64px;height:64px;border-radius:12px;object-fit:cover;border:1px solid var(--border);background:var(--card-2)}
.product-thumb-cell{text-align:center;vertical-align:middle}
.product-form .label{font-weight:600;font-size:15px;letter-spacing:-.01em;color:#2e3754}
[data-theme="dark"] .product-form .label{color:#e2e8f0}
.product-form .input,.product-form select,.product-form textarea{font-size:13.5px;padding:10px 12px;border-radius:12px}
.product-form .btn{font-size:13px}
.product-info-banner{padding:18px;border-radius:14px;background:linear-gradient(140deg,rgba(37,99,235,.12),rgba(37,99,235,.04));border:1px solid rgba(37,99,235,.18);display:flex;flex-direction:column;gap:6px}
.product-info-banner h4{margin:0;font-size:16px;font-weight:700;color:var(--txt)}
.product-info-banner p{margin:0;color:var(--muted);font-size:13px;line-height:1.5}
[data-theme="dark"] .product-info-banner{background:linear-gradient(140deg,rgba(96,165,250,.22),rgba(96,165,250,.08));border-color:rgba(96,165,250,.28)}
.field-label{display:block}
.field-desc{margin:0;color:var(--muted);font-size:13px;line-height:1.5}
.field-input{display:flex;flex-direction:column;gap:8px}
.field-actions{display:flex;gap:8px}
.dual-inputs{display:flex;gap:12px;flex-wrap:wrap}
.dual-inputs select{flex:1 1 180px}
.product-actions{display:flex;gap:12px;flex-wrap:wrap}

/* Notice preview / rendered content */
.notice-preview{margin-top:8px;padding:12px;border-radius:10px;background:var(--card-2);border:1px solid var(--border);max-height:280px;overflow:auto}
.notice-preview .notice-content{font-size:14px;line-height:1.6;color:var(--txt)}
.notice-preview .notice-content p{margin:0 0 10px}
.notice-preview .notice-content strong{font-weight:700}
.notice-preview .notice-content em{font-style:italic}
.notice-preview .notice-content br{line-height:1.2}
[data-theme="dark"] .notice-preview{background:rgba(255,255,255,0.02)}
.badge.badge-neutral{background:#eef2ff;border-color:#c7d2fe;color:#1e3a8a}
[data-theme="dark"] .badge.badge-neutral{background:#1e293b;border-color:#1e40af;color:#bfdbfe}

/* Header */
.app-header{position:sticky;top:0;z-index:120;background:var(--card);border-bottom:1px solid var(--border);backdrop-filter:saturate(180%) blur(8px);-webkit-backdrop-filter:saturate(180%) blur(8px)}
.app-header-inner{max-width:1200px;margin:0 auto;min-height:56px;padding:8px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand{display:flex;align-items:center;gap:10px}
.brand-logo{height:28px;width:auto;max-width:160px;display:block;object-fit:contain;flex-shrink:0}
.brand-logo-dark{display:none}
html[data-theme="dark"] .brand-logo-light{display:none}
html[data-theme="dark"] .brand-logo-dark{display:inline-block}
.auth-brand-logos .brand-logo{height:40px;max-width:220px}
.brand .brand-title{font-size:18px;font-weight:700;letter-spacing:-.2px;color:var(--txt)}
.nav{display:flex;align-items:center;gap:12px;margin-left:14px}
.nav a{display:inline-block;padding:8px 10px;border-radius:10px;color:var(--txt);text-decoration:none;font-size:13px;border:1px solid transparent}
.nav a.active,.nav a:hover{border-color:var(--border);background:rgba(0,0,0,.02)}
.actions{display:flex;align-items:center;gap:10px}
.actions .sep{width:1px;height:20px;background:var(--border)}

/* Mobile dropdown nav (hidden by default on desktop) */
.mobile-nav{display:none; margin-left:8px}
.mobile-nav-select{appearance:none;-webkit-appearance:none;-moz-appearance:none;padding:8px 12px;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--txt);font-size:13px;min-width:150px}
[data-theme="dark"] .mobile-nav-select{background:#252547;border-color:#3d4465;color:var(--txt)}

.btn{border:1px solid var(--border);background:#fff;padding:8px 12px;border-radius:10px;font-size:13px;cursor:pointer;color:var(--txt)}
.btn.primary{background:var(--accent);color:#fff;border-color:transparent}
.btn.outline{background:transparent}
.btn.outline:hover{border-color:var(--accent);color:var(--accent)}
[data-theme="dark"] .btn{background:#252547;border-color:#3d4465;color:var(--txt)}
[data-theme="dark"] .btn.primary{background:var(--accent);color:#fff;border-color:transparent}
[data-theme="dark"] .btn.outline{background:transparent;border-color:#3d4465;color:var(--txt)}
[data-theme="dark"] .btn.outline:hover{border-color:var(--accent);color:var(--accent);background:rgba(255,107,107,.08)}

/* Sections, cards */
.section{background:var(--card);border:1px solid var(--border);border-radius:var(--r);box-shadow:var(--shadow);padding:18px;margin:16px 0}
.section h2{margin:0 0 12px;font-size:18px;display:flex;align-items:center;gap:6px}
.container > .section:first-of-type{background:transparent;border:none;box-shadow:none;padding:0;margin:16px 0}
.dashboard-scope{display:flex;flex-direction:column;gap:16px;margin-top:16px}
.dashboard-scope .section{margin:0}
.dashboard-empty{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.dashboard-empty .empty-title{font-weight:600;color:var(--txt)}
.dashboard-empty .empty-actions{margin-top:4px}
.dashboard-empty .empty-actions .btn{display:inline-flex;align-items:center;gap:6px}
.section-filters{background:var(--card-2);padding:20px;border-radius:var(--r);border:1px solid var(--border);box-shadow:var(--shadow);display:flex;flex-direction:column;gap:14px}
.section-nested{position:relative}
.campaign-progress{padding:12px 14px;border-radius:12px;border:1px solid var(--border);background:var(--card);display:flex;align-items:center;gap:10px;font-size:13px}
.campaign-progress strong{color:var(--accent);font-size:14px}
.topbar{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end}
.topbar .group{display:flex;flex-direction:column;gap:6px;min-width:160px}
.topbar label{font-size:12px;color:var(--muted)}
.topbar .pill{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:999px;border:1px dashed var(--border);background:var(--card);font-size:12px;color:var(--muted)}
.topbar .btn{margin-left:auto;flex:0 0 auto}

.help{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;border:1px solid var(--border);background:var(--card);color:var(--muted);font-size:11px;font-weight:600;cursor:pointer;position:relative;transition:background .15s ease,color .15s ease,border-color .15s ease}
.help:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.help::after{content:attr(data-tip);position:absolute;top:calc(100% + 10px);left:50%;transform:translate(-50%,-6px);max-width:240px;padding:8px 10px;background:var(--card);color:var(--txt);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow);opacity:0;pointer-events:none;font-size:12px;line-height:1.45;transition:opacity .15s ease,transform .15s ease;z-index:90}
.help::before{content:"";position:absolute;top:100%;left:50%;transform:translate(-50%,2px);border:6px solid transparent;border-top-color:var(--card);opacity:0;transition:opacity .15s ease;z-index:89}
.help:hover,.help:focus-visible{background:rgba(0,0,0,.02);color:var(--accent);border-color:var(--accent)}
.help:hover::after,.help:focus-visible::after{opacity:1;transform:translate(-50%,0)}
.help:hover::before,.help:focus-visible::before{opacity:1}

[data-theme="dark"] .section-filters{background:#1e1e3f;border-color:#3d4465}
[data-theme="dark"] .campaign-progress{background:#1e1e3f;border-color:#3d4465}
[data-theme="dark"] .campaign-progress strong{color:#fbbf24}
[data-theme="dark"] .topbar .pill{background:#252547;border-color:#3d4465;color:var(--txt)}
[data-theme="dark"] .topbar .btn{color:var(--txt)}
[data-theme="dark"] .help{background:#1e1e3f;border-color:#3d4465;color:#cbd5e1}
[data-theme="dark"] .help::after{background:#1e1e3f;color:var(--txt);border-color:#3d4465}
[data-theme="dark"] .help::before{border-top-color:#1e1e3f}
.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:14px}
.section .card{background:var(--card-2)}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.flex{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.muted{color:var(--muted);font-size:13px}
.approval-list{display:flex;flex-direction:column;gap:10px}
.approval-card{border:1px solid var(--border);border-radius:12px;background:var(--card-2);padding:14px;display:flex;flex-direction:column;gap:8px}
.approval-card h4{margin:0;font-size:15px;color:var(--txt)}
.approval-meta{display:flex;flex-wrap:wrap;gap:10px;font-size:12px;color:var(--muted)}
.approval-locales{font-size:12px;color:var(--muted)}
.approval-actions{display:flex;gap:8px;margin-top:4px}
[data-theme="dark"] .approval-card{background:#1e1e3f;border-color:#3d4465}

/* Reviews layout */
.reviews{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.review.card{display:flex;flex-direction:column;gap:8px}
.review .review-head{display:flex;gap:10px;align-items:center}
.review .avatar-dot{width:10px;height:10px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 3px rgba(255,108,108,.12)}
.review .user{font-weight:600;color:var(--txt)}
.review .stars{color:#f59e0b;letter-spacing:1px}
.review .desc{color:var(--muted);font-size:13px;display:-webkit-box;-webkit-line-clamp:3;line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.review .actions{margin-top:2px}
.review .actions a{color:var(--accent);text-decoration:none;font-weight:500}
.review .actions a:hover{text-decoration:underline}

/* Badges */
.badge{display:inline-block;padding:3px 8px;border-radius:999px;border:1px solid var(--border);background:#f6f8fe;font-size:11px;line-height:1}
.badge.status-draft{background:#eef2ff;border-color:#c7d2fe;color:#334155}
.badge.status-pending{background:#fff7ed;border-color:#fed7aa;color:#7c2d12}
.badge.status-approved{background:#ecfdf5;border-color:#a7f3d0;color:#065f46}
.badge.status-published{background:#e6f4ff;border-color:#b6e0fe;color:#0b5394}

[data-theme="dark"] .badge{background:#1e1e3f;border-color:#3d4465;color:var(--txt)}
[data-theme="dark"] .badge.status-draft{background:#1e293b;border-color:#334155;color:#cbd5e1}
[data-theme="dark"] .badge.status-pending{background:#3b2f21;border-color:#8b5e34;color:#fcd9bd}
[data-theme="dark"] .badge.status-approved{background:#103d34;border-color:#2dd4bf;color:#a7f3d0}
[data-theme="dark"] .badge.status-published{background:#0f2a47;border-color:#1e40af;color:#bfdbfe}

/* Tables & forms */
.table{width:100%;border-collapse:collapse}
.table th,.table td{border-bottom:1px solid var(--border);padding:10px 8px;text-align:left;font-size:13px}
.table th{color:#3c4356;font-weight:600}
.input,select,textarea{width:100%;padding:8px 10px;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--txt);font-size:13px}
[data-theme="dark"] .input,[data-theme="dark"] select,[data-theme="dark"] textarea{background:#252547;border-color:#3d4465;color:var(--txt)}
.label{display:block;font-size:12px;color:#3c4356;margin-bottom:6px}
[data-theme="dark"] .label{color:var(--txt)}
.approval-gate{border:1px dashed var(--border);border-radius:var(--r);background:var(--card-2);padding:24px;margin:16px 0;text-align:center;display:flex;flex-direction:column;gap:12px;align-items:center}
.approval-gate h2{margin:0;font-size:20px;color:var(--txt)}
.approval-gate p{margin:0;color:var(--muted);font-size:13px;line-height:1.5}
.approval-gate .btn{width:auto}
[data-theme="dark"] .approval-gate{background:#1e1e3f;border-color:#3d4465}
.status-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;border:1px solid var(--border);background:var(--card-2);font-size:12px;color:var(--muted)}
[data-theme="dark"] .status-chip{background:#1e1e3f;border-color:#3d4465;color:var(--txt)}

/* Auth forms */
.auth-form{display:flex;flex-direction:column;gap:16px}
.auth-row{display:flex;flex-direction:column;gap:6px}
.auth-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:6px}
.auth-actions .btn{flex:1 1 150px;text-align:center}
.phone-line{display:flex;gap:8px;flex-wrap:wrap}
.phone-line .input{flex:1 1 220px}
.phone-line .btn{flex:0 0 auto}
.phone-verify{display:flex;gap:8px;margin-top:8px;flex-wrap:wrap}
.phone-verify .input{flex:1 1 180px}
.phone-verify .btn{flex:0 0 auto}
.hint{font-size:12px;color:var(--muted)}
.badge.badge-neutral{background:#eef2ff;border-color:#c7d2fe;color:#1e3a8a}
[data-theme="dark"] .badge.badge-neutral{background:#1e293b;border-color:#1e40af;color:#bfdbfe}

@media (max-width:960px){
  .product-form-shell{grid-template-columns:1fr;gap:22px}
  .product-form-aside{position:relative;top:auto}
}

@media (max-width:600px){
  .product-form-shell{gap:18px}
  .product-form{padding:20px}
  .auth-actions{flex-direction:column}
  .auth-actions .btn{width:100%;flex:0 0 auto}
  .phone-line{flex-direction:column}
  .phone-line .input{flex:0 0 auto;width:100%}
  .phone-line .btn{width:100%;flex:0 0 auto}
  .phone-verify{flex-direction:column}
  .phone-verify .input{flex:0 0 auto;width:100%}
  .phone-verify .btn{width:100%;flex:0 0 auto}
  .auth-body{padding:20px}
  .auth-card{padding:24px}
  .product-form-row{grid-template-columns:1fr}
  .locale-row{grid-template-columns:1fr}
  .locale-row .locale-remove{justify-self:flex-start}
  /* Header responsive: clamp brand title to 2 lines and use dropdown for nav */
  .brand .brand-title{
    font-size:16px;
    display:-webkit-box;
    -webkit-line-clamp:2; line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
    max-width:56vw;
  }
  .nav{display:none}
  .mobile-nav{display:inline-block}
  /* Actions to icon-only */
  .actions{gap:8px}
  #themeText{display:none}
  #themeToggleButton{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;padding:0}
  .actions a[href="my-info.html"],
  .actions [data-logout-btn]{
    width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;padding:0;
    font-size:0; /* hide label text visually */
  }
  .actions a[href="my-info.html"]::before{content:'�';font-size:18px;line-height:1}
  .actions [data-logout-btn]::before{content:'➜]';font-size:18px;line-height:1}

  /* Dashboard mobile optimizations */
  .topbar{gap:8px;align-items:stretch}
  .topbar .group,.topbar .pill,.topbar .btn{width:100%}
  .kpi .value{font-size:20px}
  .section .card canvas{height:140px !important}
}

/* INCI token input */
.token-input{display:flex;flex-wrap:wrap;gap:6px;border:1px solid var(--border);border-radius:10px;background:#fff;padding:6px}
[data-theme="dark"] .token-input{background:#252547;border-color:#3d4465}
.token-input .token-search{flex:1;min-width:180px;border:none;outline:none;background:transparent;color:var(--txt);font-size:13px;padding:6px}
.tokens{display:flex;flex-wrap:wrap;gap:6px}
.token{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;background:#eef2ff;border:1px solid #c7d2fe;color:#334155;font-size:12px}
[data-theme="dark"] .token{background:#1e293b;border-color:#334155;color:#cbd5e1}
.token.unknown{background:#fff1f2;border-color:#fecdd3;color:#7f1d1d}
[data-theme="dark"] .token.unknown{background:#3b1f23;border-color:#7f1d1d;color:#fecdd3}
.token .remove{cursor:pointer;opacity:.7}
.token .remove:hover{opacity:1}
.suggestions{margin-top:6px}
.suggestions .item{display:block;padding:6px 8px;border:1px solid var(--border);border-radius:8px;background:var(--card);margin-bottom:6px;cursor:pointer}
.suggestions .item:hover{border-color:var(--accent)}

/* Footer */
.site-footer{margin-top:48px;background:var(--card);border-top:1px solid var(--border);box-shadow:var(--shadow)}
.site-footer .footer-inner{max-width:1200px;margin:0 auto;padding:28px 16px 48px;display:grid;gap:18px}
.site-footer .footer-brand strong{font-size:16px;color:var(--txt)}
.site-footer .footer-brand p{margin:6px 0 0;font-size:13px;color:var(--muted)}
.site-footer .footer-contact{display:flex;flex-wrap:wrap;gap:14px;align-items:center;font-size:13px;color:var(--txt)}
.site-footer .footer-contact a{color:var(--accent);text-decoration:none;font-weight:500}
.site-footer .footer-contact a:hover{text-decoration:underline}
.site-footer .footer-links{display:flex;flex-wrap:wrap;gap:8px}
.site-footer .footer-business{font-size:13px;color:var(--muted);margin-top:6px}
.site-footer .footer-copy{font-size:12px;color:var(--muted);margin-top:6px}

@media (max-width:980px){
  .app-header-inner{padding:10px 12px}
  .brand .brand-title{font-size:16px}
  .grid-2{grid-template-columns:1fr}
  .grid-3{grid-template-columns:1fr}
  .grid-4{grid-template-columns:1fr}
  .reviews{grid-template-columns:1fr}
  .product-form-row{grid-template-columns:1fr}
}

/* Tabs */
.tabs{display:flex;gap:6px;border:1px solid var(--border);border-radius:999px;background:var(--card);padding:4px;align-self:flex-start}
.tab{border:none;background:transparent;padding:6px 12px;border-radius:999px;cursor:pointer;color:var(--txt);font-size:13px}
.tab.active{background:var(--card-2);box-shadow:var(--shadow)}
[data-theme="dark"] .tabs{background:#1a1a2e;border-color:#3d4465}
[data-theme="dark"] .tab.active{background:#222247}

/* Progress panel */
.progress-panel{display:flex;flex-direction:column;gap:10px}
.progress-meta{font-size:12px;color:var(--muted)}
.progress-bar{width:100%;height:12px;border-radius:999px;background:#eef2ff;border:1px solid #c7d2fe;overflow:hidden}
.progress-bar .fill{height:100%;background:linear-gradient(90deg,#60a5fa,#fbbf24);width:0%}
[data-theme="dark"] .progress-bar{background:#1e293b;border-color:#334155}

/* KPI cards */
.kpi{display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.kpi .label{font-size:12px;color:var(--muted);margin:0}
.kpi .value{font-size:22px;font-weight:700}

/* Modal */
.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center}
.modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.4)}
.modal-dialog{position:relative;background:var(--card);border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow);width:min(640px,92vw);max-height:88vh;display:flex;flex-direction:column}
.modal-header,.modal-footer{padding:12px 14px;border-bottom:1px solid var(--border)}
.modal-header{display:flex;align-items:center;justify-content:space-between;gap:8px}
.modal-footer{border-top:1px solid var(--border);border-bottom:none;display:flex;justify-content:flex-end;gap:8px}
.modal-body{padding:14px;overflow:auto}

/* Apply rows */
.apply-rows{display:flex;flex-direction:column;gap:8px;margin-top:10px}
.apply-row{display:grid;grid-template-columns:1fr 120px 36px;gap:8px;align-items:center}
.apply-row select,.apply-row input{width:100%}
.apply-row .remove{width:36px;height:36px;border-radius:8px;border:1px solid var(--border);background:transparent;cursor:pointer}
[data-theme="dark"] .modal-dialog{background:#1a1a2e;border-color:#3d4465}

/* Segmented filter */
.seg{display:inline-flex;gap:6px;border:1px solid var(--border);border-radius:999px;background:var(--card);padding:4px}
.seg-btn{border:none;background:transparent;padding:6px 12px;border-radius:999px;cursor:pointer;color:var(--txt);font-size:13px}
.seg-btn.active{background:var(--card-2);box-shadow:var(--shadow)}
[data-theme="dark"] .seg{background:#1a1a2e;border-color:#3d4465}
[data-theme="dark"] .seg-btn.active{background:#222247}
