* {
  box-sizing:border-box
}

body {
  margin:0;
  background:#f4f7fb;
  color:#101827;
  font-family:Arial,'Malgun Gothic',sans-serif
}

header {
  background:#111827;
  color:white;
  font-weight:700;
  font-size:26px;
  padding:22px 28px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  flex-wrap:wrap
}

header nav {
  display:flex;
  gap:8px
}

header nav a {
  color:#dbeafe;
  text-decoration:none;
  font-size:15px;
  font-weight:700;
  padding:8px 12px;
  border-radius:999px;
  background:#374151
}

header nav a.active,header nav a:hover {
  background:#2563eb;
  color:white
}

main {
  max-width:1500px;
  margin:24px auto;
  padding:0 18px
}

.panel {
  background:white;
  border-radius:14px;
  box-shadow:0 10px 30px #0001;
  padding:18px
}

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

label {
  font-size:13px;
  color:#465368
}

input,select {
  width:100%;
  margin-top:6px;
  padding:12px;
  border:1px solid #cfd7e3;
  border-radius:8px;
  font-size:15px;
  background:white
}

button {
  width:100%;
  margin-top:12px;
  padding:14px;
  border:0;
  border-radius:8px;
  background:#2563eb;
  color:white;
  font-weight:700;
  font-size:16px;
  cursor:pointer
}

.hint {
  font-size:13px;
  color:#667085
}

.filters {
  display:grid;
  grid-template-columns:120px 130px 180px 1fr;
  gap:12px;
  align-items:end;
  margin-top:16px;
  padding:12px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:10px
}

.check {
  display:flex;
  gap:8px;
  align-items:center;
  height:44px
}

.check input {
  width:auto;
  margin:0
}

.summary {
  margin:14px 0;
  font-size:14px
}

.tableWrap {
  overflow:auto;
  border:1px solid #dfe5ef;
  border-radius:10px;
  max-height:70vh
}

table {
  width:100%;
  border-collapse:collapse;
  min-width:1100px
}

th,td {
  border-bottom:1px solid #e5e7eb;
  padding:12px;
  text-align:left;
  vertical-align:top;
  font-size:14px
}

th {
  position:sticky;
  top:0;
  background:#f8fafc;
  z-index:1;
  cursor:pointer;
  white-space:nowrap
}

th:hover {
  background:#eef2ff
}

.ticket {
  font-weight:700;
  color:#0645d9;
  text-decoration:none
}

.azd {
  font-weight:700;
  color:#0645d9;
  text-decoration:none
}

.muted {
  color:#98a2b3
}

.empty {
  text-align:center;
  color:#667085;
  padding:40px
}

.badge {
  display:inline-block;
  background:#eef2ff;
  color:#3730a3;
  border-radius:999px;
  padding:3px 8px;
  margin-left:6px;
  font-size:12px
}

.status {
  white-space:nowrap
}

.error {
  color:#b42318;
  font-weight:700
}

@media(max-width:900px) {
  .grid,.filters {
    grid-template-columns:1fr
  }

}

.admin-panel {
  margin-top:18px
}

.secondary {
  background:#475467
}

.small {
  font-size:13px;
  padding:10px;
  margin-top:0
}

.adminBox {
  margin-top:12px;
  border:1px dashed #cfd7e3;
  border-radius:10px;
  padding:14px;
  background:#fbfdff
}

.admin-grid {
  display:grid;
  grid-template-columns:1fr 180px;
  gap:12px;
  align-items:end
}

.quick-buttons {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:12px 0
}

textarea {
  width:100%;
  min-height:120px;
  margin-top:6px;
  padding:12px;
  border:1px solid #cfd7e3;
  border-radius:8px;
  font-family:Consolas,monospace;
  font-size:14px
}

.queryResult {
  max-height:520px;
  overflow:auto;
  background:#0b1020;
  color:#d1e7ff;
  border-radius:10px;
  padding:14px;
  font-size:13px;
  white-space:pre-wrap
}

.queryResult .error {
  color:#ffb4b4
}

@media(max-width:900px) {
  .admin-grid {
    grid-template-columns:1fr
  }

}

.project-grid {
  grid-template-columns:minmax(260px,1fr) 220px 220px 330px 140px;
}

.project-filters {
  grid-template-columns:1fr
}

.project-filters label {
  width:100%
}

@media(max-width:900px) {
  .project-grid {
    grid-template-columns:1fr
  }

}

/* Ticket attention highlights */
tr.attention-returned td {
  background:#fff7ed!important;
  border-bottom-color:#fed7aa
}

tr.attention-returned td:first-child {
  box-shadow:inset 5px 0 0 #f97316
}

tr.attention-returned:hover td {
  background:#ffedd5!important
}

tr.attention-resolved td {
  background:#f8fafc!important;
  border-bottom-color:#cbd5e1
}

tr.attention-resolved td:first-child {
  box-shadow:inset 5px 0 0 #64748b
}

tr.attention-resolved:hover td {
  background:#f1f5f9!important
}

tr.ticket-closed td {
  background:#f3f4f6!important;
  color:#64748b;
  border-bottom-color:#d1d5db
}

tr.ticket-closed td:first-child {
  box-shadow:inset 5px 0 0 #9ca3af
}

tr.ticket-closed:hover td {
  background:#e5e7eb!important
}

tr.ticket-closed .ticket,
tr.ticket-closed .azd {
  color:#64748b
}

.attention-badge {
  display:inline-block;
  margin-left:6px;
  padding:2px 7px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  vertical-align:middle
}

.attention-returned .attention-badge {
  background:#ffedd5;
  color:#c2410c
}

.attention-resolved .attention-badge {
  background:#e2e8f0;
  color:#334155
}

.legend {
  display:inline-block;
  margin-left:8px;
  padding:3px 8px;
  border-radius:999px;
  font-size:12px;
  font-weight:700
}

.legend.returned {
  background:#ffedd5;
  color:#c2410c
}

.legend.resolved {
  background:#e2e8f0;
  color:#334155
}

/* SPA shell */
body.spa {
  height: 100vh;
  overflow: hidden;
}

body.embedded {
  background: #f4f7fb;
}

body.embedded main {
  max-width: 1500px;
  margin: 24px auto;
  padding: 0 18px;
}

body.spa header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

body.spa header nav.top-tabs {
  grid-column: 2;
  justify-self: center;
  display: flex;
  gap: 8px;
}

body.spa header nav.top-tabs button {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: #374151;
  color: #dbeafe;
  font-size: 15px;
}

body.spa header nav.top-tabs button.active,
body.spa header nav.top-tabs button:hover {
  background: #2563eb;
  color: #fff;
}

.spa-main {
  max-width: none;
  margin: 0;
  padding: 0;
  height: calc(100vh - 78px);
}

.spa-frame {
  display: none;
  width: 100%;
  height: 100%;
  border: 0;
}

.spa-frame.active {
  display: block;
}

@media (max-width: 900px) {
  body.spa {
    overflow: auto;
  }

  .spa-main {
    height: calc(100vh - 120px);
  }

  body.spa header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  body.spa header nav.top-tabs {
    grid-column: 1;
  }

}

.ticket-table {
  table-layout: fixed;
  min-width: 1480px;
}

.ticket-table th,
.ticket-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.ticket-table .ticket-no-col {
  width: 170px;
}

.ticket-no-cell {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.ticket-no-cell .attention-badge {
  margin-left: 0;
  flex: 0 0 auto;
}

.ticket-table .customer-col {
  width: 150px;
}

.ticket-table .title-col {
  width: 380px;
}

.ticket-table .azure-col {
  width: 150px;
  text-align: center;
}

.azure-cell {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  white-space:nowrap;
}


.ticket-table .user-col {
  width: 82px;
  white-space: nowrap;
}

.ticket-table .status-col {
  width: 96px;
  white-space: nowrap;
}

.ticket-table .type-col {
  width: 118px;
  white-space: nowrap;
  text-align: center;
}

.type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid transparent;
}

.type-neutral { background:#f3f4f6; color:#6b7280; border-color:#e5e7eb; }
.type-color-0 { background:#fff1f2; color:#be123c; border-color:#fecdd3; }
.type-color-1 { background:#fff7ed; color:#c2410c; border-color:#fed7aa; }
.type-color-2 { background:#fefce8; color:#a16207; border-color:#fef08a; }
.type-color-3 { background:#f0fdf4; color:#15803d; border-color:#bbf7d0; }
.type-color-4 { background:#ecfeff; color:#0e7490; border-color:#a5f3fc; }
.type-color-5 { background:#eff6ff; color:#1d4ed8; border-color:#bfdbfe; }
.type-color-6 { background:#f5f3ff; color:#6d28d9; border-color:#ddd6fe; }
.type-color-7 { background:#fdf4ff; color:#a21caf; border-color:#f5d0fe; }
.type-color-8 { background:#f0f9ff; color:#0369a1; border-color:#bae6fd; }
.type-color-9 { background:#f7fee7; color:#4d7c0f; border-color:#d9f99d; }
.type-color-10 { background:#fff7ed; color:#9a3412; border-color:#fdba74; }
.type-color-11 { background:#f8fafc; color:#475569; border-color:#cbd5e1; }


.ticket-table .date-col {
  width: 138px;
  white-space: nowrap;
}

.customer-col .customer-badge {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.title-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  max-height: 2.7em;
}

.status-text {
  display: block;
  line-height: 1.25;
}

.attention-badge {
  display: block;
  width: fit-content;
  margin: 4px 0 0 0;
}

.muted{color:#94a3b8;font-size:12px}

/* Admin split login */
.logout-form {
  display:flex;
  justify-content:flex-end;
  align-items:center;
}
.logout-form button {
  width:auto;
  margin:0;
}
.login-page {
  min-height:100vh;
  background:#f5f7fb;
}
.login-wrap {
  max-width:420px;
  margin:0 auto;
  padding:72px 18px;
}
.login-panel h1 {
  margin:0 0 8px;
  font-size:24px;
}
.login-form {
  display:grid;
  gap:12px;
  margin-top:18px;
}
.login-form button {
  margin-top:6px;
}
@media(max-width:700px) {
  .logout-form {
    justify-content:center;
  }
}

/* v40 shell/sidebar UX */
.shell-v2{display:flex;height:100vh;overflow:hidden;background:#eef3f8}.shell-v2 header{background:transparent;color:#101827;padding:0}.side-nav{width:252px;background:#0f172a;color:#fff;display:flex;flex-direction:column;padding:22px 16px;gap:20px;box-shadow:12px 0 30px #0f172a18;z-index:5}.brand-box{display:flex;align-items:center;gap:12px;padding:4px 4px 14px;border-bottom:1px solid #334155}.brand-box strong{display:block;font-size:18px}.brand-box span{display:block;margin-top:3px;font-size:12px;color:#94a3b8}.brand-mark{width:44px;height:44px;border-radius:14px;background:#2563eb;display:flex;align-items:center;justify-content:center;font-weight:900;letter-spacing:-1px}.side-menu{display:grid;gap:8px}.side-menu button,.admin-link,.side-logout button{width:100%;margin:0;padding:13px 14px;border-radius:12px;border:1px solid transparent;background:transparent;color:#cbd5e1;text-align:left;font-size:15px;font-weight:800;text-decoration:none}.side-menu button:hover,.side-menu button.active{background:#1d4ed8;color:#fff}.admin-link{margin-top:auto;background:#1e293b;text-align:center}.side-logout{margin-top:auto}.side-logout button{background:#334155;text-align:center;color:#fff}.shell-content{flex:1;min-width:0;display:flex;flex-direction:column}.shell-header{height:82px;background:#fff!important;border-bottom:1px solid #e2e8f0;display:flex!important;align-items:center;justify-content:space-between;padding:0 26px!important;box-shadow:0 6px 18px #0f172a0b}.shell-header h1{margin:0;font-size:24px}.eyebrow{margin:0 0 5px;color:#2563eb;text-transform:uppercase;letter-spacing:.08em;font-size:12px;font-weight:900}.mode-badge{display:inline-flex;align-items:center;border-radius:999px;background:#eef2ff;color:#3730a3;font-weight:900;padding:7px 12px;font-size:13px}.mode-badge.admin{background:#ecfdf3;color:#067647}.shell-v2 .spa-main{height:calc(100vh - 82px);background:#f4f7fb}.shell-v2 .spa-frame{background:#f4f7fb}.embedded main{max-width:1500px}.embedded .admin-panel{display:none!important}.hero-panel{background:linear-gradient(135deg,#ffffff,#eef4ff);border:1px solid #e2e8f0;border-radius:18px;padding:22px;display:flex;justify-content:space-between;gap:16px;align-items:center;box-shadow:0 10px 30px #0f172a0f}.hero-panel h2,.panel h2,.panel h3{margin:0 0 8px}.stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:16px 0}.stat-card,.settings-grid article{background:#fff;border:1px solid #e2e8f0;border-radius:16px;padding:18px;box-shadow:0 8px 22px #0f172a0c}.stat-card span,.settings-grid span{display:block;color:#64748b;font-size:13px;font-weight:800;margin-bottom:8px}.stat-card strong,.settings-grid strong{display:block;font-size:20px}.quick-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.section-title{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:14px}.settings-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.admin-tools{margin-top:16px}.admin-tools .quick-buttons button{width:auto}@media(max-width:1000px){.shell-v2{display:block;overflow:auto}.side-nav{width:auto;position:sticky;top:0;flex-direction:row;align-items:center;overflow:auto}.brand-box{border-bottom:0;padding:0}.side-menu{display:flex;min-width:max-content}.admin-link,.side-logout{margin-top:0;min-width:110px}.shell-v2 .spa-main{height:calc(100vh - 150px)}.stat-grid,.settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-card-grid{grid-template-columns:1fr}}@media(max-width:640px){.stat-grid,.settings-grid{grid-template-columns:1fr}.hero-panel,.section-title{display:block}.side-nav{gap:10px;padding:12px}.brand-box span{display:none}}

/* v4.1 Weekly inherited shell */
.weekly-shell{background:#f4f6f8}
.weekly-shell .side-nav{width:222px;background:#0f172a;padding:10px 13px 16px;gap:14px;box-shadow:none}
.weekly-shell .brand-box{gap:10px;padding:0 8px 14px;border-bottom:1px solid #334155}
.weekly-shell .brand-mark{width:36px;height:36px;border-radius:12px;background:linear-gradient(135deg,#38bdf8,#34d399);font-size:20px;font-weight:500}
.weekly-shell .brand-box strong{font-size:18px;color:#fff}
.weekly-shell .brand-box span{margin-top:4px;font-size:11px;color:#cbd5e1;font-weight:800}
.weekly-shell .side-menu{gap:3px}
.weekly-shell .side-menu button,.weekly-shell .side-menu .weekly-nav{display:flex;align-items:center;gap:11px;width:100%;margin:0;padding:12px 14px;border:0;border-radius:11px;background:transparent;color:#e2e8f0;text-align:left;font-size:14px;font-weight:900;text-decoration:none;cursor:pointer}
.weekly-shell .side-menu button:hover,.weekly-shell .side-menu button.active,.weekly-shell .side-menu .weekly-nav:hover{background:#fff;color:#172033}
.weekly-shell .admin-link{margin-top:auto;padding:10px 12px;border-radius:10px;background:#1e293b;color:#cbd5e1;font-size:12px}
.weekly-shell .shell-header{height:45px;padding:0 22px!important;box-shadow:none;background:#fff!important;border-bottom:1px solid #e5e7eb}
.weekly-shell .shell-header h1{font-size:18px;font-weight:950}
.weekly-shell .mode-badge{padding:5px 9px;background:#eff6ff;color:#1d4ed8;font-size:11px}
.weekly-shell .crm-subnav{display:flex;gap:8px;align-items:center;padding:12px 20px 0;background:#f4f6f8}
.weekly-shell .crm-subnav button{width:auto;margin:0;padding:9px 13px;border-radius:10px;background:#fff;color:#475569;border:1px solid #d1d5db;font-size:13px}
.weekly-shell .crm-subnav button.active{background:#0f172a;color:#fff;border-color:#0f172a}
.weekly-shell .crm-subnav a{margin-left:auto;color:#475569;text-decoration:none;font-size:12px;font-weight:900}
.weekly-shell .spa-main{height:calc(100vh - 102px);background:#f4f6f8;padding:12px 20px 20px}
.weekly-shell .spa-frame{border:1px solid #e5e7eb;border-radius:18px;background:#fff;box-shadow:0 12px 30px rgba(15,23,42,.08)}
.embedded{background:#fff}
.embedded main{margin:0 auto;padding:16px;max-width:none}
.embedded .panel{border:0;box-shadow:none;padding:0;border-radius:0}
.embedded .grid,.embedded .filters{background:#f8fafc;border:1px solid #e2e8f0;border-radius:14px;padding:14px}
.embedded button{border-radius:9px;font-weight:900}
.embedded .tableWrap{border-radius:12px}
@media(max-width:1000px){.weekly-shell .side-nav{width:auto}.weekly-shell .spa-main{height:calc(100vh - 170px);padding:10px}.weekly-shell .crm-subnav{padding:10px 10px 0}.weekly-shell .admin-link{display:none}}

/* Weekly CRM admin integration v1.4.2 */
.weekly-shell .side-menu .admin-menu-link,.weekly-shell .side-menu .crm-menu-link{display:flex;align-items:center;gap:11px;width:100%;margin:0;padding:12px 14px;border:0;border-radius:11px;background:transparent;color:#e2e8f0;text-align:left;font-size:14px;font-weight:900;text-decoration:none;cursor:pointer;box-sizing:border-box}
.weekly-shell .side-menu .admin-menu-link:hover,.weekly-shell .side-menu .crm-menu-link:hover{background:#fff;color:#172033}
.weekly-admin-shell .side-logout{margin-top:auto}
.weekly-admin-shell .side-logout button{display:flex;align-items:center;justify-content:center;gap:8px;padding:11px 14px;border-radius:11px;background:#1e293b;color:#cbd5e1;font-size:13px}
.weekly-admin-shell .side-logout button:hover{background:#334155;color:#fff}
.weekly-admin-shell .spa-main{height:calc(100vh - 45px);background:#f4f6f8;padding:12px 20px 20px}
.weekly-admin-shell .spa-frame{border:1px solid #e5e7eb;border-radius:18px;background:#fff;box-shadow:0 12px 30px rgba(15,23,42,.08)}
.weekly-admin-login{background:#f4f6f8}
.weekly-admin-login .login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.weekly-admin-login .login-panel{width:min(420px,100%);padding:30px;border-radius:20px;box-shadow:0 18px 48px rgba(15,23,42,.12)}
.weekly-login-brand{display:flex;align-items:center;gap:11px;padding-bottom:18px;margin-bottom:22px;border-bottom:1px solid #e5e7eb}
.weekly-login-brand .brand-mark{width:40px;height:40px;border-radius:13px;background:linear-gradient(135deg,#38bdf8,#34d399);font-size:21px;font-weight:500;color:#fff}
.weekly-login-brand strong{display:block;font-size:18px;color:#172033}
.weekly-login-brand span{display:block;margin-top:3px;font-size:12px;color:#64748b;font-weight:800}
.weekly-admin-login .login-panel h1{margin:0 0 8px;font-size:25px;color:#172033}
.weekly-admin-login .login-form button{border-radius:11px}
.weekly-admin-login .login-back{text-align:center;margin-top:18px}
.weekly-admin-login .login-back a{color:#475569;font-weight:800;text-decoration:none}
@media(max-width:1000px){.weekly-shell .side-menu .admin-menu-link,.weekly-shell .side-menu .crm-menu-link{min-width:max-content}.weekly-admin-shell .spa-main{height:calc(100vh - 150px);padding:10px}.weekly-admin-shell .side-logout{margin-top:0;min-width:110px}}


/* v1.4.4 - exact Weekly shell inheritance */
.weekly-native-shell{--sidebar-w:248px;background:linear-gradient(180deg,#f8fafc 0%,#eef2f7 100%);min-height:100vh;color:#111827;font-family:Arial,'Noto Sans KR','Malgun Gothic',sans-serif}
.weekly-native-shell .app-shell{display:flex;min-height:100vh;width:100%}
.weekly-native-shell .sidebar{position:sticky;top:0;align-self:flex-start;width:var(--sidebar-w);height:100vh;background:linear-gradient(180deg,#0f172a 0%,#111827 58%,#1e293b 100%);color:#fff;padding:18px 14px;border-right:1px solid rgba(255,255,255,.08);box-shadow:12px 0 28px rgba(15,23,42,.10);z-index:60;display:flex;flex-direction:column}
.weekly-native-shell .brand{padding:8px 10px 18px;border-bottom:1px solid rgba(255,255,255,.12);margin-bottom:14px}
.weekly-native-shell .brand-mark{width:40px;height:40px;border-radius:14px;background:linear-gradient(135deg,#60a5fa,#22c55e);display:flex;align-items:center;justify-content:center;font-size:21px;font-weight:400;box-shadow:0 10px 20px rgba(37,99,235,.22);margin-bottom:10px;color:#fff}
.weekly-native-shell .brand-title{font-size:18px;font-weight:950;letter-spacing:-.02em;line-height:1.2;color:#fff}
.weekly-native-shell .brand-sub{font-size:12px;color:#cbd5e1;font-weight:800;margin-top:4px}
.weekly-native-shell .sidebar .tabs{display:grid;gap:7px;margin:0;padding:0;overflow:visible;flex-wrap:nowrap}
.weekly-native-shell .sidebar .tab{box-sizing:border-box;width:100%;display:flex;align-items:center;gap:10px;justify-content:flex-start;text-align:left;border:1px solid transparent;border-radius:12px;padding:12px 12px;background:transparent;color:#cbd5e1;font-size:14px;font-weight:900;box-shadow:none;transition:background .15s,border-color .15s,color .15s,transform .15s;text-decoration:none;margin:0;cursor:pointer;font-family:inherit}
.weekly-native-shell .sidebar .tab:hover{background:rgba(255,255,255,.08);color:#fff;transform:translateX(2px)}
.weekly-native-shell .sidebar .tab.active{background:#fff;color:#0f172a;border-color:#fff;box-shadow:0 10px 24px rgba(0,0,0,.18)}
.weekly-native-shell .sidebar .tab::before{width:24px;text-align:center;font-size:16px;line-height:1;display:inline-block;flex:0 0 24px}
.weekly-native-shell .sidebar .tab[data-native-tab=dashboard]::before{content:'🏠'}
.weekly-native-shell .sidebar .tab[data-native-tab=write]::before{content:'✍️'}
.weekly-native-shell .sidebar .tab[data-native-tab=reports]::before{content:'📋'}
.weekly-native-shell .sidebar .tab[data-native-tab=memos]::before{content:'📝'}
.weekly-native-shell .sidebar .tab[data-native-tab=notices]::before{content:'📢'}
.weekly-native-shell .sidebar .tab[data-native-tab=projects]::before{content:'🗂️'}
.weekly-native-shell .sidebar .tab[data-native-tab=crm]::before,.weekly-native-shell .sidebar .tab[data-tab=crm]::before{content:'🔎'}
.weekly-native-shell .sidebar .tab[data-native-tab=admin]::before{content:'🛠️'}
.weekly-native-shell .sidebar .tab[data-native-tab=settings]::before{content:'⚙️'}
.weekly-native-shell .sidebar .tab[data-native-tab=ticket]::before{content:'🎫'}
.weekly-native-shell .sidebar .tab[data-native-tab=project]::before{content:'🗂️'}
.weekly-native-shell .sidebar .tab[data-native-tab=admin-settings]::before{content:'⚙️'}
.weekly-native-shell .sidebar .tab[data-native-tab=weekly-back]::before{content:'↩️'}
.weekly-native-shell .sidebar-foot{margin-top:auto;padding:14px 10px 4px;color:#94a3b8;font-size:11px;font-weight:800;line-height:1.55}
.weekly-native-shell .main-area{flex:1;min-width:0;display:flex;flex-direction:column}
.weekly-native-shell .header{position:sticky;top:0;z-index:45;background:rgba(255,255,255,.88);backdrop-filter:blur(12px);border-bottom:1px solid rgba(226,232,240,.9);padding:13px 24px;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;box-sizing:border-box}
.weekly-native-shell .header h1{margin:0;font-size:18px;font-weight:950;color:#0f172a}
.weekly-native-shell .crm-subnav{display:flex;gap:8px;align-items:center;padding:12px 24px 0;background:transparent}
.weekly-native-shell .crm-subnav button{width:auto;margin:0;padding:9px 14px;border-radius:999px;background:#fff;color:#374151;border:1px solid #d1d5db;font-size:14px;font-weight:900}
.weekly-native-shell .crm-subnav button.active{background:#2563eb;color:#fff;border-color:#2563eb}
.weekly-native-shell .crm-subnav a{margin-left:auto;color:#475569;text-decoration:none;font-size:12px;font-weight:900}
.weekly-native-shell .crm-container{max-width:none;margin:0;padding:10px 24px 24px;height:calc(100vh - 108px);background:transparent}
.weekly-native-shell.weekly-native-admin .crm-container{padding-top:22px;height:calc(100vh - 52px)}
.weekly-native-shell .spa-frame{display:none;width:100%;height:100%;border:1px solid #e2e8f0;border-radius:18px;background:#fff;box-shadow:0 12px 28px rgba(15,23,42,.06)}
.weekly-native-shell .spa-frame.active{display:block}
.weekly-native-shell .native-logout{width:auto;margin:5px 0 0;padding:0;background:transparent;color:#94a3b8;border:0;border-radius:0;font-size:11px;font-weight:800;text-align:left}
.weekly-native-shell .native-logout:hover{color:#fff;background:transparent}

/* iframe contents inherit Weekly card/form spacing */
body.embedded{background:#fff;color:#111827;font-family:Arial,'Noto Sans KR','Malgun Gothic',sans-serif}
body.embedded main{width:100%;max-width:none;margin:0;padding:22px 24px 80px}
body.embedded .panel{background:#fff;border:1px solid #e2e8f0;border-radius:18px;box-shadow:0 12px 28px rgba(15,23,42,.06);padding:18px;margin-bottom:16px}
body.embedded .panel:first-child{border:0;box-shadow:none;padding:0;margin-bottom:0}
body.embedded .grid,body.embedded .filters{background:#f8fafc;border:1px solid #eef2f7;border-radius:14px;padding:10px}
body.embedded input,body.embedded select,body.embedded textarea{font-family:inherit;border:1px solid #cbd5e1;border-radius:9px;padding:9px 10px;background:#fff;color:#111827}
body.embedded input:focus,body.embedded select:focus,body.embedded textarea:focus{outline:2px solid rgba(37,99,235,.16);border-color:#60a5fa}
body.embedded button{border-radius:9px;background:#2563eb;color:#fff;padding:9px 12px;font-weight:900;font-family:inherit}
body.embedded button.secondary{background:#64748b}
body.embedded .tableWrap{border:1px solid #e5e7eb;border-radius:12px}
body.embedded th{background:#f8fafc;color:#374151;font-size:12px}
body.embedded th,body.embedded td{padding:9px 10px;font-size:13px}
body.embedded .hint,body.embedded .summary{font-size:13px;color:#475569;font-weight:800}

/* admin dashboard: remove legacy visual language and use Weekly cards */
body.dashboard-page .hero-panel{background:#fff;border:1px solid #e2e8f0;border-radius:18px;padding:18px;box-shadow:0 12px 28px rgba(15,23,42,.06)}
body.dashboard-page .eyebrow{display:none}
body.dashboard-page .hero-panel h2{margin:0 0 6px;font-size:20px;color:#0f172a;font-weight:950;letter-spacing:-.02em}
body.dashboard-page .stat-grid{grid-template-columns:repeat(3,minmax(160px,1fr));max-width:960px;gap:12px;margin:14px 0}
body.dashboard-page .stat-card,body.dashboard-page .settings-grid article{border:1px solid #e5e7eb;border-radius:14px;background:#fff;padding:15px;box-shadow:0 8px 20px rgba(15,23,42,.04)}
body.dashboard-page .stat-card strong,body.dashboard-page .settings-grid strong{font-size:20px;color:#0f172a}
body.dashboard-page .quick-card-grid{display:flex;gap:8px;flex-wrap:wrap}
body.dashboard-page .quick-card-grid button{width:auto;margin:0}

@media(max-width:960px){
  .weekly-native-shell .app-shell{display:block}
  .weekly-native-shell .sidebar{position:sticky;top:0;width:100%;height:auto;padding:10px 10px 8px;border-right:0;border-bottom:1px solid rgba(255,255,255,.12);box-shadow:0 8px 22px rgba(15,23,42,.14)}
  .weekly-native-shell .brand{display:flex;align-items:center;gap:10px;padding:0 4px 9px;margin-bottom:8px}
  .weekly-native-shell .brand-mark{width:34px;height:34px;border-radius:12px;margin:0}
  .weekly-native-shell .brand-title{font-size:16px}
  .weekly-native-shell .brand-sub{display:none}
  .weekly-native-shell .sidebar .tabs{display:flex;gap:7px;overflow-x:auto;padding-bottom:2px}
  .weekly-native-shell .sidebar .tab{width:auto;flex:0 0 auto;padding:9px 11px;border-radius:999px;font-size:13px}
  .weekly-native-shell .sidebar .tab:hover{transform:none}
  .weekly-native-shell .sidebar-foot{display:none}
  .weekly-native-shell .header{position:static;padding:10px 12px;min-height:45px}
  .weekly-native-shell .header h1{display:none}
  .weekly-native-shell .crm-subnav{padding:10px 10px 0}
  .weekly-native-shell .crm-container,.weekly-native-shell.weekly-native-admin .crm-container{height:calc(100vh - 145px);padding:10px}
  body.embedded main{padding:12px 10px 70px}
  body.dashboard-page .stat-grid{grid-template-columns:1fr;max-width:none}
}

/* v1.4.6: honor JS hidden state for standalone CRM entry mode */
.weekly-native-shell .weekly-integrated-only[hidden]{display:none !important;}

/* v1.4.8 admin login inside Weekly shell */
.weekly-admin-login-shell .admin-login-main{min-height:calc(100vh - 58px);display:grid;place-items:center;padding:32px;background:linear-gradient(180deg,#f8fafc 0%,#eef2f7 100%)}
.weekly-admin-login-shell .weekly-embedded-login-panel{width:min(420px,100%);margin:0;padding:28px;border-radius:18px;border:1px solid #e2e8f0;background:#fff;box-shadow:0 12px 34px rgba(15,23,42,.08)}
.weekly-admin-login-shell .weekly-embedded-login-panel h1{margin:0 0 10px;font-size:24px;color:#111827}
@media(max-width:760px){.weekly-admin-login-shell .admin-login-main{min-height:auto;padding:20px 14px}.weekly-admin-login-shell .weekly-embedded-login-panel{padding:22px}}

/* v1.4.9 role-aware Weekly menu visibility */
.weekly-admin-only[hidden]{display:none!important}

/* 관리자 설정 - 조회 기본값 */
.setting-form-grid{display:grid;grid-template-columns:repeat(2,minmax(220px,360px));gap:14px;align-items:end}
.setting-form-grid label{margin:0}
@media(max-width:700px){.setting-form-grid{grid-template-columns:1fr}}

/* 관리자 설정 레이아웃 보정 */
body.settings-page .section-title>button{
  width:auto;
  min-width:110px;
  margin:0;
  flex:0 0 auto;
}
body.settings-page .query-defaults-panel .section-title{
  margin-bottom:12px;
}
body.settings-page .setting-form-grid{
  display:grid;
  grid-template-columns:minmax(180px,1fr) minmax(180px,1fr) minmax(260px,1.35fr) 120px;
  gap:12px;
  align-items:end;
}
body.settings-page .setting-form-grid label{
  min-width:0;
  margin:0;
}
body.settings-page .setting-form-grid input,
body.settings-page .setting-form-grid select{
  margin-top:6px;
}
body.settings-page .settings-save-btn{
  width:120px;
  min-width:120px;
  height:43px;
  margin:0;
  padding:0 16px;
  align-self:end;
}
body.settings-page #uiSettingsMessage{
  margin-top:10px;
}
body.settings-page .admin-tools .section-title{
  align-items:center;
}
body.settings-page .admin-tools .section-title h2{
  margin-bottom:0;
}
body.settings-page .admin-tools #btnDebug{
  width:auto;
  min-width:110px;
  margin:0;
}
@media(max-width:1050px){
  body.settings-page .setting-form-grid{
    grid-template-columns:repeat(2,minmax(220px,1fr));
  }
  body.settings-page .settings-save-btn{
    width:100%;
  }
}
@media(max-width:700px){
  body.settings-page .setting-form-grid{
    grid-template-columns:1fr;
  }
  body.settings-page .section-title>button,
  body.settings-page .admin-tools #btnDebug,
  body.settings-page .settings-save-btn{
    width:100%;
    margin-top:10px;
  }
}

/* Dark mode - Weekly Report aligned */
.theme-toggle{width:auto!important;min-width:118px!important;height:38px;margin:0!important;padding:0 12px!important;border-radius:10px!important;border:1px solid #dbe2ea!important;background:#fff!important;color:#111827!important;font-size:17px!important;display:inline-flex;align-items:center;justify-content:center;box-shadow:none!important}
.theme-toggle:hover{background:#f8fafc!important}
html[data-theme="dark"] body,body.dark-mode{background:#0b1120;color:#e5e7eb}
html[data-theme="dark"] body.embedded,body.dark-mode.embedded{background:#0f172a}
html[data-theme="dark"] .weekly-native-shell{background:linear-gradient(180deg,#0b1120 0%,#111827 100%);color:#e5e7eb}
html[data-theme="dark"] .weekly-native-shell .header{background:rgba(15,23,42,.92);border-bottom-color:#263244}
html[data-theme="dark"] .weekly-native-shell .header h1{color:#f8fafc}
html[data-theme="dark"] .weekly-native-shell .crm-subnav button{background:#172033;color:#cbd5e1;border-color:#334155}
html[data-theme="dark"] .weekly-native-shell .crm-subnav button.active{background:#2563eb;color:#fff;border-color:#2563eb}
html[data-theme="dark"] .weekly-native-shell .crm-subnav a{color:#cbd5e1}
html[data-theme="dark"] .weekly-native-shell .spa-frame{background:#0f172a;border-color:#263244;box-shadow:0 12px 28px rgba(0,0,0,.24)}
html[data-theme="dark"] .theme-toggle{background:#172033!important;color:#f8fafc!important;border-color:#334155!important}
html[data-theme="dark"] .theme-toggle:hover{background:#1e293b!important}
html[data-theme="dark"] .panel,
html[data-theme="dark"] .hero-panel,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .settings-grid article{background:#111827;border-color:#263244;box-shadow:0 10px 30px rgba(0,0,0,.18);color:#e5e7eb}
html[data-theme="dark"] .hero-panel{background:linear-gradient(135deg,#111827,#172033)}
html[data-theme="dark"] label,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .summary,
html[data-theme="dark"] .settings-grid span,
html[data-theme="dark"] .stat-card span{color:#aab6c5}
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{background:#0f172a;color:#f8fafc;border-color:#334155}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#64748b}
html[data-theme="dark"] .filters,
html[data-theme="dark"] .adminBox{background:#0f172a;border-color:#263244}
html[data-theme="dark"] .tableWrap{border-color:#263244;background:#111827}
html[data-theme="dark"] table{color:#e5e7eb}
html[data-theme="dark"] th,
html[data-theme="dark"] td{border-bottom-color:#263244}
html[data-theme="dark"] th{background:#172033;color:#e5e7eb}
html[data-theme="dark"] th:hover{background:#1e293b}
html[data-theme="dark"] .ticket,
html[data-theme="dark"] .azd{color:#7db2ff}
html[data-theme="dark"] .badge,
html[data-theme="dark"] .customer-col .customer-badge{background:#1e293b;color:#c7d2fe}
html[data-theme="dark"] tr.attention-returned td{background:#2a1c12!important;border-bottom-color:#7c451a}
html[data-theme="dark"] tr.attention-returned:hover td{background:#352215!important}
html[data-theme="dark"] tr.attention-resolved td{background:#151e2d!important;border-bottom-color:#334155}
html[data-theme="dark"] tr.attention-resolved:hover td{background:#1b2638!important}
html[data-theme="dark"] tr.ticket-closed td{background:#18202d!important;color:#94a3b8;border-bottom-color:#334155}
html[data-theme="dark"] tr.ticket-closed:hover td{background:#202b3b!important}
html[data-theme="dark"] tr.ticket-closed .ticket,
html[data-theme="dark"] tr.ticket-closed .azd{color:#94a3b8}
html[data-theme="dark"] .attention-returned .attention-badge,
html[data-theme="dark"] .legend.returned{background:#4a2b15;color:#fdba74}
html[data-theme="dark"] .attention-resolved .attention-badge,
html[data-theme="dark"] .legend.resolved{background:#263244;color:#cbd5e1}
html[data-theme="dark"] .queryResult{background:#070b14;color:#d1e7ff;border:1px solid #263244}
html[data-theme="dark"] .secondary{background:#334155}
html[data-theme="dark"] .secondary:hover{background:#475569}
html[data-theme="dark"] .mode-badge{background:#1e293b;color:#c7d2fe}
html[data-theme="dark"] .mode-badge.admin{background:#123524;color:#86efac}
html[data-theme="dark"] .login-page{background:#0b1120}

/* 관리자 설정: 연동 상태 / 조회 기본값 카드 간격 보정 */
body.settings-page.embedded .panel:first-child{
  margin-bottom:16px;
}

/* Dark mode: ticket/project query form areas (admin/user common) */
html[data-theme="dark"] body.embedded .grid,
html[data-theme="dark"] body.embedded .filters,
body.dark-mode.embedded .grid,
body.dark-mode.embedded .filters{
  background:#111827;
  border-color:#263244;
}
html[data-theme="dark"] body.embedded .grid input,
html[data-theme="dark"] body.embedded .grid select,
html[data-theme="dark"] body.embedded .filters input,
html[data-theme="dark"] body.embedded .filters select,
body.dark-mode.embedded .grid input,
body.dark-mode.embedded .grid select,
body.dark-mode.embedded .filters input,
body.dark-mode.embedded .filters select{
  background:#0f172a;
  color:#f8fafc;
  border-color:#334155;
}
html[data-theme="dark"] body.embedded .grid label,
html[data-theme="dark"] body.embedded .filters label,
body.dark-mode.embedded .grid label,
body.dark-mode.embedded .filters label{
  color:#aab6c5;
}

/* CRM standalone navigation separation */
.weekly-native-shell .sidebar .crm-menu-divider{height:1px;background:rgba(255,255,255,.14);margin:7px 10px;}
.weekly-native-shell .sidebar .tab[data-native-tab=weekly-back]::before{content:'📋';}
@media(max-width:960px){.weekly-native-shell .sidebar .crm-menu-divider{width:1px;height:28px;margin:3px 2px;background:rgba(255,255,255,.18);flex:0 0 1px;}}


/* Ticket type badges - dark theme */
html[data-theme="dark"] .type-neutral{background:#273142;color:#cbd5e1;border-color:#475569}
html[data-theme="dark"] .type-color-0{background:#4c1d2b;color:#fda4af;border-color:#7f1d1d}
html[data-theme="dark"] .type-color-1{background:#4a2915;color:#fdba74;border-color:#7c2d12}
html[data-theme="dark"] .type-color-2{background:#3f3512;color:#fde047;border-color:#713f12}
html[data-theme="dark"] .type-color-3{background:#173b27;color:#86efac;border-color:#166534}
html[data-theme="dark"] .type-color-4{background:#153743;color:#67e8f9;border-color:#155e75}
html[data-theme="dark"] .type-color-5{background:#172b4d;color:#93c5fd;border-color:#1e40af}
html[data-theme="dark"] .type-color-6{background:#302451;color:#c4b5fd;border-color:#5b21b6}
html[data-theme="dark"] .type-color-7{background:#432040;color:#f0abfc;border-color:#86198f}


/* Ticket type mapping settings */
.ticket-type-map-head,.ticket-type-map-row{display:grid;grid-template-columns:minmax(220px,1.2fr) minmax(180px,1fr) 72px;gap:10px;align-items:center}
.ticket-type-map-head{padding:0 4px 7px;color:#64748b;font-size:12px;font-weight:800}
.ticket-type-map-list{display:grid;gap:8px}
.ticket-type-map-row input,.ticket-type-map-row select{width:100%;margin:0}
.ticket-type-map-row .type-delete{width:100%;margin:0}
.ticket-type-empty{padding:18px;border:1px dashed #cbd5e1;border-radius:12px;color:#64748b;background:#f8fafc;text-align:center}
.ticket-type-actions{display:flex;align-items:center;gap:12px;margin-top:12px}.ticket-type-actions .summary{margin:0;flex:1}
html[data-theme="dark"] .ticket-type-empty{background:#111827;border-color:#334155;color:#94a3b8}
html[data-theme="dark"] .ticket-type-map-head{color:#94a3b8}
@media(max-width:760px){.ticket-type-map-head{display:none}.ticket-type-map-row{grid-template-columns:1fr 1fr}.ticket-type-map-row .type-delete{width:auto}.ticket-type-actions{align-items:stretch;flex-direction:column}}

/* v8: 관리자 티켓 닫힘처리 */
.ticket-table .close-col {
  width:92px;
  min-width:92px;
  text-align:center;
  white-space:nowrap;
}
.close-ticket-btn {
  margin:0;
  padding:7px 9px;
  background:#475569;
}
.close-ticket-btn:hover { background:#334155; }
.closed-done {
  display:inline-flex;
  padding:3px 8px;
  border-radius:999px;
  background:#f1f5f9;
  color:#64748b;
  border:1px solid #cbd5e1;
  font-size:12px;
  font-weight:700;
}
body.modal-open { overflow:hidden; }
.modal-overlay[hidden] { display:none !important; }
.modal-overlay {
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(15,23,42,.58);
  backdrop-filter:blur(3px);
}
.modal-card {
  width:min(720px, 100%);
  max-height:calc(100vh - 48px);
  overflow:auto;
  background:#fff;
  border:1px solid #dbe2ea;
  border-radius:16px;
  box-shadow:0 24px 70px rgba(15,23,42,.28);
  padding:22px;
}
.modal-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.modal-head h2 { margin:2px 0 4px; }
.modal-kicker {
  font-size:11px;
  font-weight:800;
  letter-spacing:.12em;
  color:#2563eb;
}
.icon-btn {
  width:36px;
  height:36px;
  min-width:36px;
  padding:0;
  margin:0;
  border-radius:9px;
  background:#f1f5f9;
  color:#475569;
  font-size:24px;
  line-height:1;
}
.close-ticket-form { display:grid; gap:14px; }
.close-ticket-form textarea { min-height:110px; resize:vertical; }
.close-form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.required { color:#dc2626; }
.modal-actions {
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:18px;
}
.modal-actions button { width:auto; margin:0; }
.danger-action { background:#b42318; }
.danger-action:hover { background:#912018; }
.modal-error {
  margin-top:14px;
  padding:10px 12px;
  border-radius:9px;
  background:#fef2f2;
  border:1px solid #fecaca;
  color:#b91c1c;
  font-size:13px;
  font-weight:700;
}
.modal-note { margin:12px 0 0; }
html[data-theme="dark"] .modal-card {
  background:#111827;
  border-color:#334155;
  color:#e5e7eb;
}
html[data-theme="dark"] .icon-btn {
  background:#1f2937;
  color:#cbd5e1;
}
html[data-theme="dark"] .closed-done {
  background:#1e293b;
  color:#cbd5e1;
  border-color:#475569;
}
html[data-theme="dark"] .modal-error {
  background:#3f1717;
  border-color:#7f1d1d;
  color:#fecaca;
}
@media(max-width:700px) {
  .modal-overlay { padding:10px; align-items:flex-start; }
  .modal-card { margin-top:10px; max-height:calc(100vh - 20px); padding:16px; }
  .close-form-grid { grid-template-columns:1fr; }
}

/* Ticket detail view */
.detail-ticket-btn {
  width:auto;
  min-width:auto;
  margin:0 0 0 6px;
  padding:3px 7px;
  border-radius:6px;
  background:#eef2ff;
  color:#4338ca;
  border:1px solid #c7d2fe;
  font-size:11px;
  font-weight:800;
  line-height:1.2;
}
.detail-ticket-btn:hover { background:#e0e7ff; }
.ticket-detail-modal { width:min(980px, 100%); }
.ticket-detail-body {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
}
.detail-field {
  min-width:0;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#f8fafc;
  padding:10px 12px;
}
.detail-field.wide { grid-column:1 / -1; }
.detail-label {
  margin-bottom:5px;
  font-size:11px;
  font-weight:800;
  color:#64748b;
}
.detail-value {
  font-size:13px;
  font-weight:650;
  color:#0f172a;
  overflow-wrap:anywhere;
}
.detail-value.multiline {
  white-space:normal;
  line-height:1.55;
  font-weight:500;
}
.detail-loading {
  padding:28px 8px;
  text-align:center;
  color:#64748b;
}
.button-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  width:auto;
  min-height:36px;
  padding:8px 14px;
  border-radius:8px;
  border:1px solid #cbd5e1;
  background:#fff;
  color:#334155;
  font-size:13px;
  font-weight:700;
}
html[data-theme="dark"] .detail-ticket-btn {
  background:#312e81;
  color:#e0e7ff;
  border-color:#4f46e5;
}
html[data-theme="dark"] .detail-field {
  background:#0f172a;
  border-color:#334155;
}
html[data-theme="dark"] .detail-label { color:#94a3b8; }
html[data-theme="dark"] .detail-value { color:#e5e7eb; }
html[data-theme="dark"] .button-link {
  background:#1f2937;
  color:#e5e7eb;
  border-color:#475569;
}
@media(max-width:700px) {
  .ticket-detail-body { grid-template-columns:1fr; }
  .detail-field.wide { grid-column:auto; }
}

.ticket-detail-body .summary-field { grid-column:span 1; }
.detail-field.editable { display:block; cursor:text; }
.detail-input,
.detail-textarea {
  width:100%;
  box-sizing:border-box;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
  color:#0f172a;
  padding:9px 10px;
  font:inherit;
  font-size:13px;
  line-height:1.55;
  resize:vertical;
}
.detail-input { min-height:38px; font-weight:650; }
.detail-textarea { min-height:82px; }
.detail-input:focus,
.detail-textarea:focus {
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
html[data-theme="dark"] .detail-input,
html[data-theme="dark"] .detail-textarea {
  background:#111827;
  border-color:#475569;
  color:#e5e7eb;
}
@media(max-width:900px) {
  .ticket-detail-body { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ticket-detail-body .summary-field { grid-column:span 1; }
}

/* Ticket detail v12 layout / comments */
.detail-top-grid {
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;
}
.detail-top-grid .detail-field { padding:7px 10px; }
.detail-top-grid .detail-label { margin-bottom:3px; }
.detail-top-grid .detail-input { min-height:34px; padding:6px 9px; }
.detail-top-grid .detail-textarea { min-height:58px; padding:7px 9px; }
.detail-top-grid .span-2 { grid-column:span 2; }
.detail-top-grid .wide { grid-column:1 / -1; }

.ticket-comments-section {
  grid-column:1 / -1;
  border:1px solid #dbe2ea;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}
.ticket-comments-title {
  display:flex;
  align-items:center;
  gap:8px;
  padding:11px 13px;
  border-bottom:1px solid #e2e8f0;
  font-size:13px;
  font-weight:850;
  color:#0f172a;
}
.ticket-comments-count {
  display:inline-flex;
  min-width:22px;
  height:20px;
  align-items:center;
  justify-content:center;
  padding:0 6px;
  border-radius:999px;
  background:#eef2ff;
  color:#4338ca;
  font-size:11px;
}
.ticket-comments-list { display:grid; gap:8px; padding:10px 12px; }
.ticket-comment {
  border:1px solid #e2e8f0;
  border-radius:9px;
  background:#f8fafc;
  padding:10px 12px;
}
.ticket-comment-head {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  margin-bottom:6px;
  font-size:11px;
  color:#64748b;
}
.ticket-comment-head strong { color:#334155; font-size:12px; }
.comment-edited { color:#94a3b8; }
.ticket-comment-body {
  white-space:normal;
  overflow-wrap:anywhere;
  font-size:13px;
  line-height:1.55;
  color:#1e293b;
}
.ticket-comments-empty { padding:12px; text-align:center; color:#94a3b8; font-size:12px; }
.ticket-comment-editor {
  padding:10px 12px 12px;
  border-top:1px solid #e2e8f0;
  background:#f8fafc;
}
.ticket-comment-editor textarea {
  width:100%;
  box-sizing:border-box;
  resize:vertical;
  min-height:86px;
  border:1px solid #cbd5e1;
  border-radius:8px;
  background:#fff;
  color:#0f172a;
  padding:9px 10px;
  font:inherit;
  font-size:13px;
  line-height:1.5;
}
.ticket-comment-editor textarea:focus {
  outline:none;
  border-color:#2563eb;
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.ticket-comment-editor-actions { display:flex; justify-content:flex-end; margin-top:8px; }
.ticket-comment-editor-actions button { width:auto; min-width:92px; }

html[data-theme="dark"] .ticket-comments-section { background:#0f172a; border-color:#334155; }
html[data-theme="dark"] .ticket-comments-title { border-color:#334155; color:#e5e7eb; }
html[data-theme="dark"] .ticket-comments-count { background:#312e81; color:#e0e7ff; }
html[data-theme="dark"] .ticket-comment { background:#111827; border-color:#334155; }
html[data-theme="dark"] .ticket-comment-head { color:#94a3b8; }
html[data-theme="dark"] .ticket-comment-head strong { color:#e5e7eb; }
html[data-theme="dark"] .ticket-comment-body { color:#e5e7eb; }
html[data-theme="dark"] .ticket-comment-editor { background:#111827; border-color:#334155; }
html[data-theme="dark"] .ticket-comment-editor textarea { background:#0f172a; border-color:#475569; color:#e5e7eb; }

@media(max-width:900px) {
  .detail-top-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .detail-top-grid .span-2 { grid-column:span 2; }
}
@media(max-width:700px) {
  .detail-top-grid { grid-template-columns:1fr; }
  .detail-top-grid .span-2,
  .detail-top-grid .wide { grid-column:auto; }
}

/* v13: 상세 모달 내 닫힘처리 통합 */
.detail-pair-row {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.detail-pair-row .detail-field { width:100%; }
@media (max-width:700px) {
  .detail-pair-row { grid-template-columns:1fr; }
}

/* v13.1: Evaluation Grade / 완료일 영역을 상세 모달 전체 폭 5:5로 사용 */
.detail-pair-row.wide {
  grid-column:1 / -1;
  width:100%;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
}

/* v13.2 - ticket result filters: keep all controls on one row */
body.embedded .filters{
  grid-template-columns:105px 120px 160px 120px minmax(220px,1fr);
  gap:10px;
  align-items:end;
}
body.embedded .filters > label{min-width:0}
body.embedded .filters > label:not(.check) input,
body.embedded .filters > label:not(.check) select{width:100%;box-sizing:border-box}
@media(max-width:900px){
  body.embedded .filters{grid-template-columns:1fr}
}


/* v13.3 - 고객사 필터 추가: 결과 내 재검색 우측 배치 */
body.embedded .filters{
  grid-template-columns:105px 120px 150px 170px 170px minmax(190px,1fr);
}
@media(max-width:1100px){
  body.embedded .filters{
    grid-template-columns:105px 120px 140px 105px minmax(170px,1fr) minmax(170px,1fr);
  }
}
@media(max-width:900px){
  body.embedded .filters{grid-template-columns:1fr}
}

/* v13.6 - 프로젝트 결과 내 재검색은 티켓 필터 grid 설정에서 분리 */
body.embedded .filters.project-filters{
  grid-template-columns:minmax(0,1fr);
}
body.embedded .filters.project-filters > label{
  width:100%;
}

/* v13.9 - closed ticket readability improvement */
tr.ticket-closed td {
  background:#f8fafc!important;
  color:#334155;
  border-bottom-color:#dbe3ec;
}
tr.ticket-closed td:first-child {
  box-shadow:inset 4px 0 0 #94a3b8;
}
tr.ticket-closed:hover td {
  background:#eef2f6!important;
}
tr.ticket-closed .ticket {
  color:#2563eb;
  font-weight:700;
}
tr.ticket-closed .azd {
  color:#2563eb;
}
tr.ticket-closed .title-col {
  color:#334155;
}
tr.ticket-closed .status-text {
  color:#64748b;
  font-weight:700;
}
html[data-theme="dark"] tr.ticket-closed td {
  background:#1b2432!important;
  color:#d1d5db;
  border-bottom-color:#334155;
}
html[data-theme="dark"] tr.ticket-closed:hover td {
  background:#243044!important;
}
html[data-theme="dark"] tr.ticket-closed .ticket,
html[data-theme="dark"] tr.ticket-closed .azd {
  color:#93c5fd;
}
html[data-theme="dark"] tr.ticket-closed .title-col {
  color:#e5e7eb;
}
html[data-theme="dark"] tr.ticket-closed .status-text {
  color:#94a3b8;
}

/* v14.0 - 티켓 선택/Teams·메일용 서식 복사 */
.result-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 8px}
.result-toolbar .summary{margin:0;min-width:0;flex:1}
.copy-selected-btn{width:auto!important;min-width:112px;margin:0!important;padding:7px 14px!important;white-space:nowrap}
.copy-selected-btn:disabled{opacity:.55;cursor:not-allowed}
.ticket-table .select-col{width:42px;min-width:42px;text-align:center;padding-left:7px;padding-right:7px}
.ticket-table .select-col input{width:16px;height:16px;margin:0;vertical-align:middle;cursor:pointer;accent-color:#2563eb}
html[data-theme="dark"] .copy-selected-btn:disabled{opacity:.45}
@media(max-width:700px){.result-toolbar{align-items:stretch;flex-direction:column}.copy-selected-btn{align-self:flex-end}}


/* v13.10 - 티켓 조회 전용 검색 레이아웃 (프로젝트 조회와 분리) */
#ticketSearchGrid{
  grid-template-columns:minmax(320px,1fr) 220px 260px 120px;
}
@media(max-width:1000px){
  #ticketSearchGrid{grid-template-columns:1fr 1fr;}
}
@media(max-width:700px){
  #ticketSearchGrid{grid-template-columns:1fr;}
}


/* v14.1 - 관리자 티켓 조회: 미치환 담당자/작성자 자동 감지 */
.unmapped-owner-modal{max-width:560px}
.unmapped-owner-body{padding:2px 0 6px}
.unmapped-owner-message{font-size:18px;line-height:1.65;margin:4px 0 6px;color:#0f172a}
.unmapped-owner-message strong{font-size:20px;word-break:break-all}
.unmapped-owner-editor{margin-top:16px;padding:14px;border:1px solid #dbe3ec;border-radius:12px;background:#f8fafc;display:grid;gap:10px}
.unmapped-owner-editor[hidden]{display:none!important}
.unmapped-owner-editor label{display:grid;gap:6px;font-weight:800;color:#334155}
.unmapped-owner-editor input{width:100%;box-sizing:border-box}
.unmapped-owner-editor input[readonly]{background:#eef2f7;color:#64748b}
.unmapped-owner-actions{flex-wrap:wrap}
.unmapped-owner-actions .button-link,.unmapped-owner-actions button{width:auto}
.disabled-link{opacity:.45;pointer-events:none}
html[data-theme="dark"] .unmapped-owner-message{color:#f1f5f9}
html[data-theme="dark"] .unmapped-owner-editor{background:#111827;border-color:#334155}
html[data-theme="dark"] .unmapped-owner-editor label{color:#dbeafe}
html[data-theme="dark"] .unmapped-owner-editor input[readonly]{background:#1f2937;color:#94a3b8}


/* 2026-08-31 사용자별 CRM Access Key 로그인 */
.weekly-native-shell .sidebar .tab[data-native-tab=access-key-guide]::before{content:'🔑'}
.crm-user-foot strong{display:block;margin:4px 0 10px;color:#e2e8f0;font-size:13px;word-break:break-all}
.crm-user-logout{width:100%;margin:0;padding:8px 10px;border:1px solid rgba(255,255,255,.12);border-radius:9px;background:#334155;color:#fff;font-size:12px;font-weight:900;cursor:pointer}
.crm-user-logout:hover{background:#475569}
.crm-user-logout:disabled{opacity:.55;cursor:wait}
.crm-login-main{min-height:calc(100vh - 58px);display:grid;place-items:center;padding:32px;background:linear-gradient(180deg,#f8fafc 0%,#eef2f7 100%)}
.crm-user-login-panel{width:min(460px,100%);padding:30px;border-radius:20px;border:1px solid #e2e8f0;background:#fff;box-shadow:0 16px 44px rgba(15,23,42,.10)}
.crm-user-login-panel .login-heading{margin-bottom:20px}
.crm-user-login-panel .login-heading h1{margin:0 0 8px;font-size:25px;color:#111827}
.crm-user-login-panel .login-form{display:grid;gap:14px}
.crm-user-login-panel .login-form label:not(.check){display:grid;gap:7px;font-weight:800;color:#334155}
.crm-user-login-panel .login-form input[type=text],.crm-user-login-panel .login-form input[type=password],.crm-user-login-panel .login-form input:not([type]){width:100%;box-sizing:border-box}
.crm-user-login-panel .login-remember{display:flex;align-items:center;gap:8px;margin:0;color:#475569;font-size:13px;font-weight:800}
.crm-user-login-panel .login-remember input{width:16px;height:16px;margin:0}
.crm-user-login-panel .login-message{min-height:22px;margin-top:10px}
.access-key-guide-inline{width:100%;margin-top:8px}
.access-key-guide-modal{width:min(620px,100%)}
.access-key-guide-body{min-height:100px;padding:16px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc;color:#334155;line-height:1.75;white-space:normal;word-break:keep-all}
body.settings-page .access-key-guide-settings textarea{width:100%;box-sizing:border-box;min-height:180px;resize:vertical;line-height:1.65}
.telegram-group{margin-top:16px;padding:14px 16px;border:1px solid #e2e8f0;border-radius:12px;background:#f8fafc}
.telegram-group-title{margin-bottom:11px;color:#334155;font-size:13px;font-weight:900}
.telegram-policy-row{display:flex;align-items:center;flex-wrap:wrap;gap:12px 34px}
.telegram-connection-grid{display:grid;grid-template-columns:minmax(320px,1.6fr) minmax(180px,.7fr) minmax(180px,.7fr);gap:14px;align-items:end}
.telegram-connection-grid label{margin:0}
.telegram-connection-grid input[type=text],.telegram-connection-grid input[type=password]{width:100%;box-sizing:border-box}
.telegram-option-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px 30px;margin-top:10px;padding:0 4px}
.telegram-enabled,.telegram-clear,.telegram-insecure{display:flex!important;align-items:center;gap:8px;min-height:38px;font-weight:800}
.telegram-enabled input,.telegram-clear input,.telegram-insecure input{width:18px!important;height:18px;margin:0;flex:0 0 auto}
.telegram-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.telegram-actions button{width:auto!important;min-width:140px;margin:0!important;padding:10px 18px!important}
.telegram-actions .summary{flex:1 1 280px;margin:0}
html[data-theme="dark"] .telegram-settings{background:#111827;border-color:#334155}
html[data-theme="dark"] .telegram-group{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .telegram-group-title{color:#cbd5e1}
@media(max-width:900px){.telegram-connection-grid{grid-template-columns:1fr 1fr}.telegram-token-field{grid-column:1/-1}}
@media(max-width:700px){.telegram-connection-grid{grid-template-columns:1fr}.telegram-token-field{grid-column:auto}.telegram-policy-row,.telegram-option-row{display:grid;grid-template-columns:1fr}.telegram-actions button{width:100%!important}}
html[data-theme="dark"] .crm-login-main{background:linear-gradient(180deg,#0b1120 0%,#0f172a 100%)}
html[data-theme="dark"] .crm-user-login-panel{background:#111827;border-color:#263244;box-shadow:0 16px 44px rgba(0,0,0,.28)}
html[data-theme="dark"] .crm-user-login-panel .login-heading h1,html[data-theme="dark"] .crm-user-login-panel .login-form label:not(.check){color:#e5e7eb}
html[data-theme="dark"] .crm-user-login-panel .login-remember{color:#cbd5e1}
html[data-theme="dark"] .access-key-guide-body{background:#0f172a;border-color:#263244;color:#dbeafe}
@media(max-width:760px){.crm-login-main{min-height:auto;padding:20px 14px}.crm-user-login-panel{padding:22px}}

/* v13.7 - 티켓 상세 모달: 본문만 스크롤, 하단 액션 고정 */
.ticket-detail-modal {
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:0;
}
.ticket-detail-modal > .modal-head {
  flex:0 0 auto;
  margin:0;
  padding:22px 22px 14px;
}
.ticket-detail-scroll {
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  padding:0 22px 18px;
}
.ticket-detail-actions {
  flex:0 0 auto;
  margin:0;
  padding:14px 22px 18px;
  border-top:1px solid #e2e8f0;
  background:#fff;
}
html[data-theme="dark"] .ticket-detail-actions {
  border-top-color:#334155;
  background:#111827;
}
@media(max-width:700px) {
  .ticket-detail-modal > .modal-head {
    padding:16px 16px 12px;
  }
  .ticket-detail-scroll {
    padding:0 16px 14px;
  }
  .ticket-detail-actions {
    padding:12px 16px 14px;
    flex-wrap:wrap;
  }
}

/* 2026-09-02 CRM 저장 계정 로그인 UX */
.crm-login-stage{width:min(980px,100%);display:grid;grid-template-columns:minmax(280px,.9fr) minmax(380px,1.1fr);gap:26px;align-items:stretch}
.crm-login-intro{position:relative;overflow:hidden;border-radius:26px;padding:38px 34px;background:linear-gradient(145deg,#0f172a 0%,#1e293b 58%,#1d4ed8 140%);color:#fff;box-shadow:0 22px 60px rgba(15,23,42,.18)}
.crm-login-intro::after{content:'';position:absolute;right:-70px;bottom:-80px;width:220px;height:220px;border-radius:50%;background:rgba(96,165,250,.16)}
.crm-login-symbol{width:58px;height:58px;border-radius:18px;display:grid;place-items:center;margin-bottom:30px;background:linear-gradient(135deg,#60a5fa,#22c55e);font-size:28px;font-weight:900;box-shadow:0 12px 28px rgba(37,99,235,.28)}
.crm-login-intro .eyebrow{margin:0 0 10px;color:#93c5fd;font-weight:900;letter-spacing:.11em;font-size:11px}
.crm-login-intro h1{margin:0 0 14px;font-size:34px;letter-spacing:-.04em}
.crm-login-intro>p:not(.eyebrow){margin:0;color:#dbeafe;line-height:1.75;font-size:14px;font-weight:700}
.crm-login-points{display:grid;gap:10px;margin-top:30px;color:#e2e8f0;font-size:13px;font-weight:800}
.crm-login-stage .crm-user-login-panel{width:auto;margin:0;padding:32px;display:flex;flex-direction:column;justify-content:center}
.crm-user-login-panel .login-heading h2{margin:0 0 8px;font-size:25px;color:#111827;letter-spacing:-.025em}
.saved-account-view,.manual-login-view{display:grid;gap:14px}
.saved-account-view[hidden],.manual-login-view[hidden]{display:none!important}
.saved-account-card{display:flex;align-items:center;gap:14px;padding:16px;border:1px solid #dbe3ec;border-radius:16px;background:linear-gradient(180deg,#f8fafc,#f1f5f9)}
.saved-account-avatar{width:48px;height:48px;flex:0 0 48px;border-radius:15px;display:grid;place-items:center;background:#0f172a;color:#fff;font-size:17px;font-weight:950;letter-spacing:.02em}
.saved-account-copy{min-width:0;display:grid;gap:3px}
.saved-account-label{font-size:11px;color:#64748b;font-weight:900}
.saved-account-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:17px;color:#0f172a}
.saved-account-copy small{color:#94a3b8;font-size:11px;font-weight:700}
.saved-account-badge{margin-left:auto;flex:0 0 auto;padding:5px 8px;border-radius:999px;background:#dcfce7;color:#166534;font-size:10px;font-weight:950}
.saved-login-primary{width:100%;min-height:46px;border-radius:12px;font-weight:950}
.saved-login-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.saved-login-actions button{width:100%;margin:0}
.danger-ghost{background:#fff!important;color:#b91c1c!important;border:1px solid #fecaca!important}
.danger-ghost:hover{background:#fef2f2!important;border-color:#fca5a5!important}
.saved-login-note{margin:0;padding:11px 12px;border-radius:11px;background:#f8fafc;color:#64748b;font-size:11px;line-height:1.6;font-weight:700}
.back-saved-button{width:100%;margin:0}
.access-key-link-button{width:100%;margin:0;padding:11px 14px;border:1px dashed #bfdbfe;border-radius:12px;background:#eff6ff;color:#1d4ed8;font-weight:900;cursor:pointer}
.access-key-link-button:hover{background:#dbeafe;border-color:#93c5fd}
.access-key-link-button:disabled{opacity:.6;cursor:wait}
.crm-user-login-panel .login-message.success{color:#15803d;font-weight:800}
.crm-user-login-panel .login-message.error{color:#b91c1c;font-weight:800}

html[data-theme="dark"] .crm-login-intro{background:linear-gradient(145deg,#020617 0%,#0f172a 62%,#1e3a8a 145%);box-shadow:0 22px 60px rgba(0,0,0,.3)}
html[data-theme="dark"] .crm-user-login-panel .login-heading h2{color:#f8fafc}
html[data-theme="dark"] .saved-account-card{background:linear-gradient(180deg,#0f172a,#111827);border-color:#334155}
html[data-theme="dark"] .saved-account-copy strong{color:#f8fafc}
html[data-theme="dark"] .saved-account-label{color:#94a3b8}
html[data-theme="dark"] .saved-account-copy small{color:#64748b}
html[data-theme="dark"] .saved-account-badge{background:#14532d;color:#bbf7d0}
html[data-theme="dark"] .saved-login-note{background:#0f172a;color:#94a3b8}
html[data-theme="dark"] .danger-ghost{background:#111827!important;color:#fca5a5!important;border-color:#7f1d1d!important}
html[data-theme="dark"] .danger-ghost:hover{background:#1f1517!important}
html[data-theme="dark"] .access-key-link-button{background:#0f1b33;color:#93c5fd;border-color:#1e40af}
html[data-theme="dark"] .access-key-link-button:hover{background:#132447}

@media(max-width:900px){
  .crm-login-stage{grid-template-columns:1fr;max-width:560px}
  .crm-login-intro{display:none}
}
@media(max-width:520px){
  .saved-login-actions{grid-template-columns:1fr}
  .crm-login-stage .crm-user-login-panel{padding:24px 20px}
  .saved-account-badge{display:none}
}

/* 2026-09-02 프로젝트 → 티켓 생성 */
.ticket-create-btn {
  display:block;
  width:64px;
  min-width:64px;
  margin:0 auto;
  padding:5px 10px;
  background:#0f766e;
  border-color:#0f766e;
  color:#fff;
}
.ticket-create-col { width:84px; min-width:84px; text-align:center; }
.project-table th,
.project-table td { vertical-align:middle; }
.project-table td:last-child { text-align:center; }
.ticket-create-btn:hover { background:#115e59; }
.project-ticket-create-modal {
  width:min(1040px,100%);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  padding:0;
}
.project-ticket-create-modal > .modal-head {
  flex:0 0 auto;
  margin:0;
  padding:22px 24px 14px;
  border-bottom:1px solid #e2e8f0;
}
.ticket-create-subtitle {
  margin:6px 0 0;
  color:#64748b;
  font-size:13px;
  line-height:1.55;
  font-weight:700;
}
.project-ticket-create-scroll {
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:20px 24px 24px;
}
.project-ticket-create-actions {
  flex:0 0 auto;
  margin:0;
  padding:14px 24px 18px;
  border-top:1px solid #e2e8f0;
  background:#fff;
}
.ticket-create-form { display:grid; gap:18px; }
.ticket-create-form [hidden],
.project-ticket-create-scroll > [hidden] { display:none !important; }
.ticket-create-project-card {
  border:1px solid #bfdbfe;
  border-radius:14px;
  background:linear-gradient(135deg,#eff6ff 0%,#f8fafc 100%);
  padding:16px;
}
.ticket-create-project-head {
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:13px;
}
.ticket-create-project-head > span {
  flex:0 0 auto;
  padding:4px 7px;
  border-radius:6px;
  background:#dbeafe;
  color:#1d4ed8;
  font-size:10px;
  font-weight:900;
  letter-spacing:.09em;
}
.ticket-create-project-head strong {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#0f172a;
  font-size:15px;
}
.ticket-create-context-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.ticket-create-context-grid > div {
  min-width:0;
  padding:10px 12px;
  border:1px solid #dbeafe;
  border-radius:10px;
  background:rgba(255,255,255,.78);
}
.ticket-create-context-grid span {
  display:block;
  margin-bottom:4px;
  color:#64748b;
  font-size:11px;
  font-weight:800;
}
.ticket-create-context-grid strong {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#1e293b;
  font-size:13px;
}
.ticket-create-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:13px 14px;
}
.ticket-create-grid label,
.ticket-create-textareas label {
  display:flex;
  flex-direction:column;
  gap:6px;
  color:#334155;
  font-size:12px;
  font-weight:800;
}
.ticket-create-grid input,
.ticket-create-grid select,
.ticket-create-textareas textarea {
  width:100%;
  margin:0;
}
.ticket-native-select { display:none; }
.ticket-search-select {
  width:100%;
  min-height:38px;
  margin:0;
  padding-right:34px;
  background-image:linear-gradient(45deg,transparent 50%,#64748b 50%),linear-gradient(135deg,#64748b 50%,transparent 50%);
  background-position:calc(100% - 17px) 16px,calc(100% - 12px) 16px;
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
}
html[data-theme="dark"] .ticket-search-select {
  background-color:#111827;
  color:#e5e7eb;
}
.ticket-create-grid input[readonly] {
  background:#f8fafc;
  color:#475569;
}
.ticket-create-wide { grid-column:1/-1; }
.ticket-create-extra {
  padding-top:4px;
  border-top:1px dashed #cbd5e1;
}
.ticket-create-section-title {
  margin:0 0 10px;
  color:#475569;
  font-size:12px;
  font-weight:900;
}
.ticket-create-textareas {
  display:grid;
  gap:12px;
}
.ticket-create-textareas textarea {
  min-height:110px;
  resize:vertical;
}
.ticket-create-warning {
  padding:11px 13px;
  border:1px solid #fde68a;
  border-radius:10px;
  background:#fffbeb;
  color:#92400e;
  font-size:12px;
  line-height:1.6;
  font-weight:700;
}
.ticket-create-success {
  display:flex;
  align-items:flex-start;
  gap:15px;
  padding:24px;
  border:1px solid #bbf7d0;
  border-radius:16px;
  background:#f0fdf4;
}
.ticket-create-success-icon {
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:#16a34a;
  color:#fff;
  font-size:22px;
  font-weight:900;
}
.ticket-create-success-title {
  margin:2px 0 8px;
  color:#166534;
  font-size:16px;
  font-weight:900;
}
.ticket-create-success-text {
  display:grid;
  gap:4px;
  color:#334155;
  font-size:13px;
}
.ticket-create-success-text strong { color:#0f172a; font-size:18px; }
.ticket-create-success-text span { display:block; }
html[data-theme="dark"] .project-ticket-create-modal > .modal-head,
html[data-theme="dark"] .project-ticket-create-actions { border-color:#334155; }
html[data-theme="dark"] .project-ticket-create-actions { background:#111827; }
html[data-theme="dark"] .ticket-create-subtitle { color:#94a3b8; }
html[data-theme="dark"] .ticket-create-project-card {
  border-color:#1e3a5f;
  background:linear-gradient(135deg,#102033 0%,#111827 100%);
}
html[data-theme="dark"] .ticket-create-project-head > span { background:#172554; color:#93c5fd; }
html[data-theme="dark"] .ticket-create-project-head strong { color:#e5e7eb; }
html[data-theme="dark"] .ticket-create-context-grid > div { border-color:#25364d; background:rgba(15,23,42,.78); }
html[data-theme="dark"] .ticket-create-context-grid span { color:#94a3b8; }
html[data-theme="dark"] .ticket-create-context-grid strong { color:#e2e8f0; }
html[data-theme="dark"] .ticket-create-grid label,
html[data-theme="dark"] .ticket-create-textareas label { color:#cbd5e1; }
html[data-theme="dark"] .ticket-create-grid input[readonly] { background:#0f172a; color:#94a3b8; }
html[data-theme="dark"] .ticket-create-extra { border-color:#334155; }
html[data-theme="dark"] .ticket-create-section-title { color:#94a3b8; }
html[data-theme="dark"] .ticket-create-warning { background:#3b2f0b; border-color:#854d0e; color:#fde68a; }
html[data-theme="dark"] .ticket-create-success { background:#0f291c; border-color:#166534; }
html[data-theme="dark"] .ticket-create-success-title { color:#86efac; }
html[data-theme="dark"] .ticket-create-success-text { color:#cbd5e1; }
html[data-theme="dark"] .ticket-create-success-text strong { color:#f8fafc; }
@media(max-width:760px) {
  .project-ticket-create-modal > .modal-head { padding:16px 16px 12px; }
  .project-ticket-create-scroll { padding:16px; }
  .project-ticket-create-actions { padding:12px 16px 14px; flex-wrap:wrap; }
  .ticket-create-grid,
  .ticket-create-context-grid { grid-template-columns:1fr; }
  .ticket-create-wide { grid-column:span 1; }
}


/* Project ticket create: type-specific sections (v2) */
.ticket-create-special-section {
  border:1px solid #dbe5f1;
  border-radius:14px;
  background:#fbfdff;
  padding:16px;
  display:grid;
  gap:14px;
}
.ticket-create-special-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding-bottom:12px;
  border-bottom:1px solid #e7edf5;
}
.ticket-create-special-head > div { display:flex; align-items:center; gap:10px; }
.ticket-create-special-head strong { color:#172033; font-size:15px; }
.ticket-create-special-head small { color:#718096; font-size:12px; line-height:1.45; text-align:right; }
.ticket-create-special-badge {
  display:inline-flex;
  align-items:center;
  min-height:25px;
  padding:0 9px;
  border-radius:999px;
  font-size:11px;
  font-weight:800;
  letter-spacing:.02em;
  background:#eef2ff;
  color:#4338ca;
}
.issue-section .ticket-create-special-badge { background:#fff1f2; color:#be123c; }
.ticket-create-dev-textareas { gap:12px; }
.ticket-create-dev-textareas textarea { min-height:86px; }
.ticket-create-dev-grid { padding-top:2px; }
#tcStartDate { min-height:38px; }
html[data-theme="dark"] .ticket-create-special-section { background:#101827; border-color:#334155; }
html[data-theme="dark"] .ticket-create-special-head { border-color:#334155; }
html[data-theme="dark"] .ticket-create-special-head strong { color:#e5e7eb; }
html[data-theme="dark"] .ticket-create-special-head small { color:#94a3b8; }
html[data-theme="dark"] .ticket-create-special-badge { background:#252b53; color:#c7d2fe; }
html[data-theme="dark"] .issue-section .ticket-create-special-badge { background:#4c1d28; color:#fecdd3; }
@media (max-width: 760px) {
  .ticket-create-special-head { flex-direction:column; }
  .ticket-create-special-head small { text-align:left; }
}
