/* ═══════════════════════════════════════════════════════════════
   EZEE PORTAL — TOOL PAGES STYLESHEET
   Applies to: note-generator.html embedded page, email-templates.html embedded page
   ═══════════════════════════════════════════════════════════════ */

:root {
    --brand: #FB612F;
    --brand-dark: #e05020;
    --brand-light: rgba(251, 97, 47, 0.08);
    --brand-border: rgba(251, 97, 47, 0.22);
    --r: 16px;
    --rs: 8px;
}

/* ── BASE RESET ── */
.tool-page-wrap *,
.tool-page-wrap *::before,
.tool-page-wrap *::after { box-sizing: border-box; }

.tool-page-wrap {
    background: transparent;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: clip;
    font-family: Arial, sans-serif;
    color: inherit;
    line-height: 1.6;
}

.tool-page-title {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

/* ── LEFT-SIDE TAB LAYOUT ── */
.note-layout-wrap {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
}
.note-content-col {
    flex: 1;
    min-width: 0;
}
.email-layout-wrap {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    width: 100%;
}

/* ── NOTE / EMAIL SIDEBAR NAV (matches KB aside exactly) ── */
.note-sub-nav, .email-mini-nav {
    background: #fff;
    border-right: 1px solid var(--brand-border);
    display: flex;
    flex-direction: column;
    padding: 11px 0 40px;
    gap: 0;
    width: 260px;
    flex-shrink: 0;
    margin: 0;
    align-self: flex-start;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 21;
}
body.dark .note-sub-nav, body.dark .email-mini-nav {
    background: #1e2530;
    border-right-color: rgba(251,97,47,0.22);
}

/* Items match KB .si exactly */
.note-sub-nav .note-sub-btn,
.email-mini-nav .email-mini-btn,
.note-sub-btn, .email-mini-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border: none;
    border-left: 3px solid transparent;
    background: transparent;
    color: #555;
    font-family: Arial, sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.3;
    cursor: pointer;
    transition: all 0.12s;
    white-space: normal;
    text-align: left;
    width: 100%;
    margin: 0;
    border-radius: 0;
}
body.dark .note-sub-nav .note-sub-btn,
body.dark .email-mini-nav .email-mini-btn { color: #94a3b8 !important; }
.note-sub-btn:hover, .email-mini-btn:hover { color: var(--brand); background: var(--brand-light); }
/* Active state — must outrank the dark-mode rule above */
.note-sub-nav .note-sub-btn.active,
.email-mini-nav .email-mini-btn.active,
.email-mini-nav .email-mini-btn-active,
.note-sub-btn.active, .email-mini-btn.active, .email-mini-btn-active {
    background: rgba(251,97,47,0.1) !important;
    border-left-color: var(--brand) !important;
    color: var(--brand) !important;
    font-weight: 700 !important;
}
body.dark .note-sub-nav .note-sub-btn.active,
body.dark .email-mini-nav .email-mini-btn.active,
body.dark .email-mini-nav .email-mini-btn-active {
    background: rgba(251,97,47,0.15) !important;
    color: #FB612F !important;
}

.email-mini-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #aaa;
    padding: 14px 14px 4px;
    margin: 0;
    pointer-events: none;
    user-select: none;
}
body.dark .email-mini-label { color: #4a5568; }

.note-sub-page { display: none; }
.note-sub-page.active { display: block; }
.noc-sub-page { display: none; }
.noc-sub-page.active { display: block; }

/* ── NOC TAB GROUP (matches KB .snl / .sdiv) ── */
.sub-nav-divider {
    display: block; height: 1px;
    background: var(--brand-border); margin: 7px 14px;
    flex-shrink: 0;
}
body.dark .sub-nav-divider { background: rgba(251,97,47,0.18); }
.sub-nav-noc-group { display: flex; flex-direction: column; }
.sub-nav-noc-label {
    font-size: 0.61rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .1em;
    color: #9ca3af; padding: 7px 14px 2px;
    font-family: Arial, sans-serif;
}
body.dark .sub-nav-noc-label { color: #475569; }
.sub-nav-noc-tabs { display: flex; flex-direction: column; gap: 0; }
.note-sub-nav .noc-sub-btn.active,
.noc-sub-btn.active {
    background: rgba(251,97,47,0.1) !important;
    border-left-color: var(--brand) !important;
    color: var(--brand) !important;
    font-weight: 700 !important;
}
body.dark .note-sub-nav .noc-sub-btn.active {
    background: rgba(251,97,47,0.15) !important;
    color: #FB612F !important;
}

/* ── SIDEBAR LAYOUT ── */
.note-with-sidebar {
    display: block; padding: 1.5rem 2.5rem; background: transparent; position: relative;
}
.sidebar-col {
    position: fixed;
    right: -420px;
    left: auto;
    top: 150px;
    width: 400px;
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--r) 0 0 var(--r);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    border: 1px solid var(--brand-border);
}
body.dark .sidebar-col { background: #232b35; border-color: rgba(251,97,47,0.22); }
.sidebar-col.open { right: 0; }

.sidebar-col .note-info-panel { position: static; width: 100%; }
.sidebar-col .tab-info-bar { padding: 0; justify-content: flex-start; }
.tab-info-bar { display: flex; justify-content: flex-end; padding: 0 0 1rem 0; gap: 0.5rem; }

/* Info button */
.info-btn {
    width: 30px; height: 30px; border-radius: 50%;
    background: transparent; border: 2px solid var(--brand); color: var(--brand);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.15s; flex-shrink: 0;
}
.info-btn:hover { background: var(--brand); color: white; transform: scale(1.1); }
.noc-sub-page .info-btn { border-color: #0077C8; color: #0077C8; }
.noc-sub-page .info-btn:hover { background: #0077C8; color: white; }

/* Info panel */
.note-info-panel {
    background: var(--brand-light);
    border: 1px solid var(--brand-border);
    border-radius: var(--r); overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    cursor: default; user-select: none;
}
body.dark .note-info-panel { background: rgba(251,97,47,0.05); border-color: rgba(251,97,47,0.22); }

.note-info-panel.truckroll-panel { border-color: #22c55e; box-shadow: 0 4px 16px rgba(34,197,94,0.15); }
.note-info-panel.truckroll-panel .info-panel-header { background: #16a34a; }
.note-info-panel.truckroll-panel .info-panel-section-title { color: #16a34a; }
.note-info-panel.harddown-panel { border-color: #f59e0b; box-shadow: 0 4px 16px rgba(245,158,11,0.15); }
.note-info-panel.harddown-panel .info-panel-header { background: #d97706; }
.note-info-panel.harddown-panel .info-panel-section-title { color: #d97706; }
.note-info-panel.cecr-panel { border-color: #0077C8; box-shadow: 0 4px 16px rgba(0,119,200,0.15); }
.note-info-panel.cecr-panel .info-panel-header { background: #0077C8; }
.note-info-panel.cecr-panel .info-panel-section-title { color: #0077C8; }
.note-info-panel.noc-panel { border-color: #0077C8; box-shadow: 0 4px 16px rgba(0,119,200,0.15); }
.note-info-panel.noc-panel .info-panel-header { background: #0077C8; }
.note-info-panel.noc-panel .info-panel-section-title { color: #0077C8; }
.note-info-panel.cgnat-panel { border-color: #0891b2; box-shadow: 0 4px 16px rgba(8,145,178,0.15); }
.note-info-panel.cgnat-panel .info-panel-header { background: #0891b2; }
.note-info-panel.cgnat-panel .info-panel-section-title { color: #0891b2; }
.note-info-panel.outage-panel { border-color: #d97706; box-shadow: 0 4px 16px rgba(217,119,6,0.15); }
.note-info-panel.outage-panel .info-panel-header { background: #d97706; }
.note-info-panel.outage-panel .info-panel-section-title { color: #d97706; }
.note-info-panel.general-panel { border-color: #7c3aed; box-shadow: 0 4px 16px rgba(124,58,237,0.15); }
.note-info-panel.general-panel .info-panel-header { background: #6d28d9; }
.note-info-panel.general-panel .info-panel-section-title { color: #6d28d9; }

.info-panel-header { background: var(--brand); padding: 0.75rem 1rem; display: flex; align-items: center; gap: 0.5rem; }
.info-panel-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.info-panel-title { font-size: 0.85rem; font-weight: 800; color: white; font-family: Arial, sans-serif; text-transform: uppercase; letter-spacing: 1.5px; }
.info-panel-section { padding: 1rem 1.25rem; border-bottom: 1px solid var(--brand-border); }
.info-panel-section:last-child { border-bottom: none; }
.info-panel-section-title { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); margin-bottom: 0.5rem; font-family: Arial, sans-serif; }
.info-panel-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.info-panel-list li { font-size: 0.84rem; color: inherit; opacity: 0.85; line-height: 1.6; padding-left: 0.85rem; position: relative; }
.info-panel-list li::before { content: '•'; position: absolute; left: 0; color: #9ca3af; font-size: 0.7rem; top: 0.1rem; }

/* Tool container */
.note-with-sidebar > .container { flex: 1; min-width: 0; }
.tool-container {
    background: transparent;
    border: 1px solid var(--brand-border);
    border-radius: var(--r);
    padding: 2rem;
}
body.dark .tool-container { background: rgba(251,97,47,0.03); border-color: rgba(251,97,47,0.22); }

/* ── FORM GRID ── */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.form-group { margin-bottom: 1rem; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
    display: block; font-weight: 700; color: #555;
    font-family: Arial, sans-serif;
    margin-bottom: 0.4rem; font-size: 0.7rem;
    text-transform: uppercase; letter-spacing: .04em;
}

.tool-page-wrap input[type="text"],
.tool-page-wrap input[type="date"],
.tool-page-wrap input[type="datetime-local"],
.tool-page-wrap textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid #ddd; border-radius: var(--rs);
    font-size: 0.92rem; font-family: Arial, sans-serif;
    transition: border-color 0.15s;
    background-color: #fff; color: #000;
}
body.dark .tool-page-wrap input[type="text"],
body.dark .tool-page-wrap input[type="date"],
body.dark .tool-page-wrap input[type="datetime-local"],
body.dark .tool-page-wrap textarea {
    background-color: #1e2530; border-color: rgba(251,97,47,0.3); color: #e2e8f0;
}
.tool-page-wrap input[type="text"]:focus,
.tool-page-wrap input[type="date"]:focus,
.tool-page-wrap input[type="datetime-local"]:focus,
.tool-page-wrap textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(251,97,47,0.15);
}
.tool-page-wrap input::placeholder,
.tool-page-wrap textarea::placeholder { color: #9ca3af; }
.tool-page-wrap textarea { resize: vertical; min-height: 100px; }

/* Selects */
.tech-region-select, .wo-type-select, #cg-servicePackage, #dbe-reason-select, #dp-preferredTime {
    width: 100%; padding: 6px 9px;
    border: 1px solid #ddd; border-radius: var(--rs);
    font-size: 0.84rem; background-color: #fff; color: #000;
    cursor: pointer; transition: border-color 0.15s;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem;
    font-family: Arial, sans-serif;
}
body.dark .tech-region-select,
body.dark .wo-type-select,
body.dark #cg-servicePackage,
body.dark #dbe-reason-select,
body.dark #dp-preferredTime { background-color: #1e2530; color: #e2e8f0; border-color: rgba(251,97,47,0.3); }
.tech-region-select:focus, .wo-type-select:focus, #cg-servicePackage:focus, #dbe-reason-select:focus, #dp-preferredTime:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(251,97,47,0.15); }
.tech-region-select option, .wo-type-select option, #cg-servicePackage option, #dbe-reason-select option, #dp-preferredTime option { background-color: #fff; color: #000; }

/* ── SECTION LABELS / DIVIDERS ── */
.section-label {
    grid-column: 1 / -1;
    font-size: 0.66rem; font-weight: 700; font-family: Arial, sans-serif;
    text-transform: uppercase; letter-spacing: .08em; color: var(--brand);
    padding-bottom: 6px; border-bottom: 2px solid rgba(251,97,47,0.2);
    margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between;
}
.section-divider { grid-column: 1 / -1; border: none; border-top: 1px solid var(--brand-border); margin: 0.25rem 0; }
.provider-theme-tachus .section-label { color: #61bb46; border-bottom-color: rgba(97,187,70,0.25); }
.provider-theme-daynet .section-label { color: #0077C8; border-bottom-color: rgba(0,119,200,0.25); }

/* ── PROVIDER BUTTONS ── */
.provider-btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.provider-btn {
    padding: 0 13px; height: 30px; border: 1px solid var(--brand-border);
    border-radius: var(--rs); background: #fff; color: #555;
    font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all 0.15s; font-family: Arial, sans-serif;
}
.provider-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
.provider-btn.active-tachus { background: #61bb46 !important; border-color: #61bb46 !important; color: white !important; }
.provider-btn.active-ezee { background: var(--brand) !important; border-color: var(--brand) !important; color: white !important; }
.provider-btn.active-daynet { background: #0077C8 !important; border-color: #0077C8 !important; color: white !important; }

body.dark .provider-btn { background: #232b35; border-color: rgba(251,97,47,0.22); color: #94a3b8; }
body.dark .provider-btn:hover { background: rgba(251,97,47,0.1); color: var(--brand); border-color: var(--brand); }

/* ── EQUIPMENT BUTTONS ── */
.equip-btn-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.equip-btn {
    padding: 0 9px; height: 26px; border: 1px solid var(--brand-border);
    border-radius: var(--rs); background: #fff; color: #555;
    font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; font-family: Arial, sans-serif;
}
.equip-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
.equip-btn.active { background: var(--brand) !important; border-color: var(--brand) !important; color: white !important; }

body.dark .equip-btn { background: #232b35; border-color: rgba(251,97,47,0.22); color: #94a3b8; }
body.dark .equip-btn:hover { background: rgba(251,97,47,0.1); color: var(--brand); border-color: var(--brand); }

/* ── YES / NO BUTTONS ── */
.yes-no-buttons { display: flex; gap: 0.5rem; }
.yes-no-buttons button {
    flex: 1; padding: 0 13px; height: 30px;
    border: 1px solid var(--brand-border); border-radius: var(--rs);
    font-weight: 700; cursor: pointer; transition: all 0.15s;
    background-color: #fff; color: #555; font-family: Arial, sans-serif; font-size: 0.78rem;
}
.yes-no-buttons button:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
.yes-no-buttons button.active-yes { background: var(--brand) !important; border-color: var(--brand) !important; color: white !important; }
.yes-no-buttons button.active-no { background: #f0f2f5 !important; color: #555 !important; border-color: #ddd !important; }

body.dark .yes-no-buttons button { background: #232b35; border-color: rgba(251,97,47,0.22); color: #94a3b8; }
body.dark .yes-no-buttons button:hover { background: rgba(251,97,47,0.1); color: var(--brand); border-color: var(--brand); }

/* ── TROUBLESHOOTING GRID ── */
.troubleshooting-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.5rem; margin-top: 0.5rem; }
.troubleshooting-item {
    padding: 0.6rem 0.75rem; border: 1px solid var(--brand-border);
    border-radius: var(--rs); cursor: pointer; transition: all 0.15s;
    background-color: #fff; font-size: 0.84rem; text-align: left;
    user-select: none; color: #555; font-family: Arial, sans-serif;
}
.troubleshooting-item:hover { background: var(--brand-light); border-color: var(--brand); color: var(--brand); }
.troubleshooting-item.selected { background: var(--brand) !important; border-color: var(--brand) !important; color: white !important; }

body.dark .troubleshooting-item { background: #232b35; border-color: rgba(251,97,47,0.22); color: #94a3b8; }
body.dark .troubleshooting-item:hover { background: rgba(251,97,47,0.1); border-color: var(--brand); color: var(--brand); }

/* ── CUSTOM STEPS ── */
.custom-step-wrapper { margin-top: 0.5rem; display: flex; gap: 0.5rem; align-items: stretch; }
.custom-step-prefix {
    background: #fff; border: 1px solid var(--brand-border);
    border-radius: var(--rs) 0 0 var(--rs); padding: 0 0.75rem;
    display: flex; align-items: center; font-size: 0.875rem;
    color: var(--brand); font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
.custom-step-input {
    flex: 1; padding: 6px 9px; border: 1px solid #ddd; border-left: none;
    border-radius: 0 var(--rs) var(--rs) 0; font-size: 0.84rem;
    background-color: #fff; color: #000; transition: border-color 0.15s; font-family: Arial, sans-serif;
}
.custom-step-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(251,97,47,0.15); }
.custom-step-input::placeholder { color: #9ca3af; }
.custom-step-add-btn {
    padding: 0 13px; height: 30px; background: var(--brand); color: white;
    border: none; border-radius: var(--rs); font-weight: 700; font-size: 0.78rem;
    cursor: pointer; transition: all 0.15s; white-space: nowrap; flex-shrink: 0; font-family: Arial, sans-serif;
}
.custom-step-add-btn:hover { background: var(--brand-dark); }
.custom-steps-list { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.35rem; }
.custom-step-tag {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: var(--brand); color: white; padding: 0.35rem 0.75rem;
    border-radius: var(--rs); font-size: 0.82rem; font-weight: 600; width: fit-content;
}
.custom-step-remove { background: none; border: none; color: rgba(255,255,255,0.7); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; transition: color 0.15s; }
.custom-step-remove:hover { color: white; }

body.dark .custom-step-prefix { background: #232b35; border-color: rgba(251,97,47,0.3); }
body.dark .custom-step-input { background: #1e2530; border-color: rgba(251,97,47,0.3); color: #e2e8f0; }

/* ── BUTTONS ── */
.action-buttons { margin-top: 2rem; padding-top: 2rem; border-top: 2px solid var(--brand-border); display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn {
    height: 30px; padding: 0 13px; border-radius: var(--rs);
    font-family: Arial, sans-serif; font-size: 0.78rem; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
    text-decoration: none; transition: all 0.15s;
    border: 1px solid var(--brand-border); background: transparent; color: var(--brand);
}
.btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.btn-primary { background: var(--brand); color: white; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-1px); }

.btn-secondary { background: transparent; color: #555; border-color: var(--brand-border); }
.btn-secondary:hover { background: var(--brand); color: white; border-color: var(--brand); }

.btn-success { background: #16a34a; color: white; border-color: #16a34a; display: flex; align-items: center; gap: 0.5rem; }
.btn-success:hover { background: #15803d; border-color: #15803d; transform: translateY(-1px); }

body.dark .btn { border-color: rgba(251,97,47,0.35); color: var(--brand); }
body.dark .btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
body.dark .btn-secondary { border-color: rgba(251,97,47,0.22); color: #94a3b8; }
body.dark .btn-secondary:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── OUTPUT SECTION ── */
.output-section { margin-top: 2rem; padding-top: 2rem; border-top: 2px solid var(--brand-border); display: none; }
.output-section.show { display: block; }
.output-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 1rem; }
.output-header h3 { font-size: 1rem; color: var(--brand); font-family: Arial, sans-serif; font-weight: 700; margin: 0; }
.output-box {
    background-color: #fff; padding: 1.5rem;
    border-radius: var(--rs); border: 1px solid var(--brand-border);
}
.output-box textarea {
    font-family: 'Courier New', monospace; font-size: 0.875rem; color: #000;
    white-space: pre-wrap; word-wrap: break-word; width: 100%;
    background: transparent; border: none; outline: none; resize: vertical; min-height: 300px; line-height: 1.6;
}
body.dark .output-box { background: #1e2530; border-color: rgba(251,97,47,0.3); }
body.dark .output-box textarea { color: #e2e8f0; }

/* ── DISPATCH ── */
.dispatch-brand-row { display: flex; align-items: center; gap: 0.75rem; padding: 1.25rem 0 1.5rem 0; flex-wrap: wrap; }
.dispatch-brand-label { font-weight: 700; color: #555; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .04em; font-family: Arial, sans-serif; }
.dispatch-brand-btn {
    padding: 0 13px; height: 30px; border: 1px solid var(--brand-border);
    border-radius: var(--rs); background: #fff; color: #555;
    font-weight: 700; font-size: 0.78rem; cursor: pointer; transition: all 0.15s; font-family: Arial, sans-serif;
}
.dispatch-brand-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
.dispatch-brand-btn.active-tachus { background: #61bb46 !important; border-color: #61bb46 !important; color: white !important; }
.dispatch-brand-btn.active-ezee { background: var(--brand) !important; border-color: var(--brand) !important; color: white !important; }
.dispatch-brand-btn.active-daynet { background: #0077C8 !important; border-color: #0077C8 !important; color: white !important; }
.dispatch-brand-display { font-size: 1.3rem; font-weight: 800; letter-spacing: 1px; margin-left: 0.5rem; }
.dispatch-brand-display.brand-tachus { color: #22c55e; }
.dispatch-brand-display.brand-ezee { color: var(--brand); }

body.dark .dispatch-brand-btn { background: #232b35; border-color: rgba(251,97,47,0.22); color: #94a3b8; }
body.dark .dispatch-brand-btn:hover { background: rgba(251,97,47,0.1); color: var(--brand); border-color: var(--brand); }

/* ── PRIORITY BUTTONS ── */
.priority-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.25rem; }
.priority-btn {
    width: 2.5rem; height: 2.5rem; border: 1px solid var(--brand-border);
    border-radius: var(--rs); background: #fff; color: #555;
    font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.15s; font-family: Arial, sans-serif;
}
.priority-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
.priority-btn.active { background: var(--brand) !important; border-color: var(--brand) !important; color: white !important; }
.cecr-priority-display { font-size: 1.1rem; font-weight: 800; color: var(--brand); margin-left: 0.5rem; }

body.dark .priority-btn { background: #232b35; border-color: rgba(251,97,47,0.22); color: #94a3b8; }
body.dark .priority-btn:hover { background: rgba(251,97,47,0.1); color: var(--brand); border-color: var(--brand); }

/* ── CECR NUMBERED STEP BUBBLES ── */
.cecr-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: stretch; }
.cecr-col { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.cecr-step {
    border: 1px solid var(--brand-border); border-radius: 14px;
    background: #fff; padding: 0.85rem 1rem 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
body.dark .cecr-step { background: #1b222c; border-color: rgba(251,97,47,0.22); box-shadow: none; }
.cecr-step-grow { flex: 1; display: flex; flex-direction: column; }

.cecr-step-head { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.7rem; }
.cecr-step-num {
    flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 0.95rem; font-family: Arial, sans-serif;
    box-shadow: 0 2px 6px rgba(251,97,47,0.35);
}
.cecr-step-title {
    font-size: 0.72rem; font-weight: 800; font-family: Arial, sans-serif;
    text-transform: uppercase; letter-spacing: .06em; color: #555;
}
body.dark .cecr-step-title { color: #cbd5e1; }

.cecr-step-body { min-width: 0; }
.cecr-step-body-grow { flex: 1; display: flex; }
.cecr-step-body-grow textarea { flex: 1; min-height: 150px; }

/* Provider-themed step numbers follow the selected provider color */
.provider-theme-tachus .cecr-step-num { background: #61bb46; box-shadow: 0 2px 6px rgba(97,187,70,0.35); }
.provider-theme-daynet .cecr-step-num { background: #0077C8; box-shadow: 0 2px 6px rgba(0,119,200,0.35); }

.cecr-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem 0.85rem; }
.cecr-field-wide { grid-column: 1 / -1; }
.cecr-field label {
    display: block; font-weight: 700; color: #555; font-family: Arial, sans-serif;
    margin-bottom: 0.3rem; font-size: 0.66rem; text-transform: uppercase; letter-spacing: .04em;
}
body.dark .cecr-field label { color: #9ca3af; }
.cecr-field input[type="text"] { padding: 8px 10px; font-size: 0.86rem; }

@media (max-width: 720px) {
    .cecr-steps { grid-template-columns: 1fr; }
    .cecr-field-grid { grid-template-columns: 1fr; }
}

/* ── COMING SOON ── */
.coming-soon-placeholder { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #9ca3af; }
.coming-soon-placeholder .placeholder-mark { font-size: 2rem; font-weight: 800; color: var(--brand); letter-spacing: 2px; margin-bottom: 0.5rem; }
.coming-soon-placeholder .placeholder-sub { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 3px; color: #9ca3af; }

/* ── OUTAGE IMAGE UPLOAD ── */
.outage-upload-area {
    display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem;
    border: 2px dashed var(--brand-border); border-radius: var(--rs);
    background: var(--brand-light); transition: border-color 0.15s;
}
.outage-upload-area:hover { border-color: #0077C8; }
.outage-upload-btn {
    display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.9rem;
    background: #0077C8; color: white; border-radius: var(--rs);
    font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: background 0.15s;
    white-space: nowrap; font-family: Arial, sans-serif;
}
.outage-upload-btn:hover { background: #005fa3; }
.outage-upload-hint { font-size: 0.75rem; color: #9ca3af; }
.outage-image-previews { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.outage-img-wrap {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
    background: #fff; border: 1px solid var(--brand-border); border-radius: var(--rs);
    padding: 0.4rem; width: 110px;
}
.outage-img-thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 4px; }
.outage-img-name { font-size: 0.65rem; color: #9ca3af; text-align: center; word-break: break-all; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outage-img-remove { position: absolute; top: 2px; right: 2px; background: rgba(239,68,68,0.85); color: white; border: none; border-radius: 50%; width: 18px; height: 18px; font-size: 0.65rem; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; transition: background 0.15s; }
.outage-img-remove:hover { background: #dc2626; }
.outage-output-box { padding: 0; overflow: hidden; }
.outage-rich-output { width: 100%; min-height: 200px; background: transparent; color: #000; padding: 1rem; font-size: 0.875rem; line-height: 1.6; outline: none; cursor: text; }
.outage-rich-output:empty::before { content: 'Generated note with images will appear here...'; color: #9ca3af; font-style: italic; pointer-events: none; }
.outage-note-text { font-family: 'Courier New', monospace; font-size: 0.875rem; white-space: pre-wrap; word-wrap: break-word; color: #000; margin: 0 0 1rem 0; border: none; background: transparent; }
.outage-img-header { font-family: Arial, sans-serif; font-size: 0.7rem; font-weight: 700; color: var(--brand); margin: 0.5rem 0; text-transform: uppercase; letter-spacing: .08em; }
.outage-inline-imgs { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.25rem; }
.outage-inline-img { max-width: 280px; max-height: 200px; object-fit: contain; border-radius: var(--rs); border: 1px solid var(--brand-border); display: block; }

body.dark .outage-upload-area { background: rgba(251,97,47,0.05); border-color: rgba(251,97,47,0.22); }
body.dark .outage-img-wrap { background: #232b35; border-color: rgba(251,97,47,0.22); }
body.dark .outage-rich-output { color: #e2e8f0; }
body.dark .outage-note-text { color: #e2e8f0; }

/* ── CGNAT IP CHECKER ── */
.cgnat-checker { background: var(--brand-light); border: 1px solid var(--brand-border); border-radius: var(--rs); padding: 14px 16px 16px; margin-bottom: 1.25rem; }
.cgnat-checker-label { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #0077C8; margin-bottom: 10px; }
.cgnat-checker-row { display: flex; gap: 8px; }
.cgnat-ip-input {
    flex: 1; padding: 6px 9px; background: #fff; border: 1px solid #ddd;
    border-radius: var(--rs); color: #000; font-size: 0.95rem;
    font-family: 'Courier New', monospace; outline: none; transition: border-color 0.15s;
}
.cgnat-ip-input::placeholder { color: #9ca3af; }
.cgnat-ip-input:focus { border-color: #0077C8; box-shadow: 0 0 0 3px rgba(0,119,200,0.15); }
.cgnat-check-btn { padding: 0 13px; height: 30px; background: #0077C8; border: none; border-radius: var(--rs); color: white; font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: background 0.15s; white-space: nowrap; font-family: Arial, sans-serif; }
.cgnat-check-btn:hover { background: #005fa3; }
.cgnat-check-result { overflow: hidden; max-height: 0; transition: max-height 0.25s ease, padding 0.2s ease, margin 0.2s ease; border-radius: var(--rs); margin-top: 0; font-size: 0.83rem; }
.cgnat-check-result.visible { max-height: 260px; margin-top: 10px; padding: 10px 14px; }
.cgnat-check-result.cgnat-cgnat { background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.35); color: #dc2626; }
.cgnat-check-result.cgnat-private { background: rgba(249,115,22,0.08); border: 1px solid rgba(249,115,22,0.35); color: #ea580c; }
.cgnat-check-result.cgnat-warning { background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.32); color: #ca8a04; }
.cgnat-check-result.cgnat-special { background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.28); color: #4f46e5; }
.cgnat-check-result.cgnat-public { background: rgba(34,197,94,0.08); border: 1px solid rgba(34,197,94,0.28); color: #16a34a; }
.cgnat-check-result.cgnat-invalid { background: rgba(234,179,8,0.08); border: 1px solid rgba(234,179,8,0.28); color: #ca8a04; }
.cgnat-result-status { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.cgnat-result-detail { opacity: 0.85; }

body.dark .cgnat-checker { background: rgba(251,97,47,0.05); border-color: rgba(251,97,47,0.22); }
body.dark .cgnat-ip-input { background: #1e2530; border-color: rgba(251,97,47,0.3); color: #e2e8f0; }

/* ── INFO MODAL ── */
.info-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 9999; align-items: center; justify-content: center; }
.info-modal-overlay.open { display: flex; }
.info-modal-box {
    background: #fff; border: 1px solid var(--brand-border); border-radius: var(--r);
    padding: 28px 28px 24px; max-width: 500px; width: 90%; position: relative;
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}
.info-modal-tag { font-size: 0.64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: 10px; }
.info-modal-box.noc-style .info-modal-tag { color: #0077C8; }
.info-modal-title { font-size: 1rem; font-weight: 700; color: var(--brand); margin-bottom: 14px; font-family: Arial, sans-serif; }
.info-modal-body { color: #555; font-size: 0.88rem; line-height: 1.75; white-space: pre-wrap; }
.info-modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: #9ca3af; font-size: 22px; cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 4px; transition: color 0.15s, background 0.15s; }
.info-modal-close:hover { color: var(--brand); background: var(--brand-light); }

body.dark .info-modal-box { background: #232b35; border-color: rgba(251,97,47,0.22); }
body.dark .info-modal-title { color: var(--brand); }
body.dark .info-modal-body { color: #94a3b8; }
body.dark .info-modal-close { color: #475569; }
body.dark .info-modal-close:hover { color: var(--brand); background: rgba(251,97,47,0.15); }

/* ── STICKY NOTES PANEL ── */
.sticky-notes-tab { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 500; display: flex; flex-direction: row; align-items: stretch; }
.sticky-notes-toggle { writing-mode: vertical-rl; text-orientation: mixed; background: var(--brand); color: white; border: none; padding: 1rem 0.5rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; border-radius: 6px 0 0 6px; box-shadow: -2px 0 12px rgba(0,0,0,0.15); transition: background 0.15s; display: flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.sticky-notes-toggle:hover { background: var(--brand-dark); }
.sticky-notes-panel { width: 0; overflow: hidden; background: #fff; border-left: 3px solid var(--brand); box-shadow: -4px 0 20px rgba(0,0,0,0.1); display: flex; flex-direction: column; transition: width 0.3s ease; }
.sticky-notes-panel.open { width: 300px; }
.sticky-notes-inner { width: 300px; height: 100%; display: flex; flex-direction: column; padding: 0.75rem; gap: 0.5rem; min-height: 400px; max-height: 80vh; }
.sticky-notes-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--brand-border); padding-bottom: 0.5rem; flex-shrink: 0; }
.sticky-notes-title { font-size: 0.7rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .08em; }
.sticky-notes-actions { display: flex; gap: 0.4rem; }
.sticky-notes-clear, .sticky-notes-copy { background: transparent; border: 1px solid #ddd; color: #9ca3af; padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.7rem; cursor: pointer; transition: all 0.15s; }
.sticky-notes-clear:hover { border-color: #ef4444; color: #ef4444; }
.sticky-notes-copy:hover { border-color: #16a34a; color: #16a34a; }
.sticky-notes-textarea { flex: 1; width: 100%; background: #f8f9fa; border: 1px solid #ddd; border-radius: var(--rs); color: #000; font-size: 0.82rem; line-height: 1.55; padding: 0.65rem; resize: none; min-height: 320px; font-family: 'Courier New', monospace; transition: border-color 0.15s; }
.sticky-notes-textarea:focus { outline: none; border-color: var(--brand); }
.sticky-notes-textarea::placeholder { color: #9ca3af; }
.sticky-notes-footer { font-size: 0.65rem; color: #9ca3af; text-align: center; margin-top: auto; padding-top: 0.25rem; }

body.dark .sticky-notes-panel { background: #232b35; }
body.dark .sticky-notes-textarea { background: #1e2530; border-color: rgba(251,97,47,0.3); color: #e2e8f0; }

/* ── EMAIL TEMPLATES ── */
.email-page { flex: 1; min-height: 0; background: transparent; display: flex; flex-direction: column; gap: 0; padding-top: 0; }
.email-sub-page { display: none; }
.email-sub-page.active { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.email-mini-content { flex: 1; min-width: 0; }
.email-mini-page { display: none; }
.email-mini-page.active { display: flex; align-items: flex-start; justify-content: flex-start; min-height: 55vh; padding-top: 0.5rem; }
.email-template-placeholder { width: 100%; text-align: center; }
.email-template-form { display: flex; gap: 2rem; padding: 1.5rem; width: 100%; max-width: 1000px; margin: 0 auto; flex-wrap: wrap; }
.etf-fields { display: flex; flex-direction: column; gap: 1rem; min-width: 220px; flex: 0 0 260px; }
.etf-fields-wide { flex: 0 0 400px; min-width: 320px; }
.etf-generate-btn { margin-top: 0.5rem; }

/* ── EQUIP RETURN 2-COL LAYOUT ── */
.ter-e-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.equip-entry-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.equip-section-label { font-weight: 600; font-size: 0.8rem; color: var(--text-muted,#888); text-transform: uppercase; letter-spacing: 0.05em; margin: 0.5rem 0 0; }
.equip-model-select {
    width: 100%; padding: 10px 12px;
    border: 1px solid #ddd; border-radius: var(--rs);
    font-size: 0.92rem; font-family: Arial, sans-serif;
    background-color: #fff; color: #000;
    transition: border-color 0.15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
}
.equip-model-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(251,97,47,0.15); }
body.dark .equip-model-select { background-color: #1e2530; border-color: rgba(251,97,47,0.3); color: #e2e8f0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); }

/* ── TAB IDENTITY LABEL ── */
.etf-tab-label {
    display: inline-flex; align-items: center;
    font-size: 0.65rem; font-weight: 700;
    color: var(--brand); text-transform: uppercase;
    letter-spacing: 0.08em; padding: 0.2rem 0.55rem;
    background: var(--brand-light); border-radius: var(--rs);
    border-left: 3px solid var(--brand);
}
body.dark .etf-tab-label { background: rgba(251,97,47,0.1); }

/* ── BOOTSTRAP-STYLE FORM VALIDATION ── */
.invalid-feedback { display: none; width: 100%; margin-top: 0.25rem; font-size: 0.75rem; color: #dc3545; }
.was-validated input:required:invalid,
.was-validated select:required:invalid { border-color: #dc3545 !important; box-shadow: 0 0 0 3px rgba(220,53,69,0.12) !important; }
.was-validated input:required:valid,
.was-validated select:required:valid { border-color: #16a34a !important; }
.was-validated input:required:invalid ~ .invalid-feedback,
.was-validated select:required:invalid ~ .invalid-feedback { display: block; }
.etf-output-wrap { flex: 1; min-width: 280px; }
.etf-output-wrap .output-box textarea { min-height: 220px; }
.raf-form .etf-output-wrap { display: flex; flex-direction: column; }
.raf-img-preview { width: 100%; max-width: 600px; border-radius: var(--rs); display: block; opacity: 0.85; }

.ups-label-section { margin-top: 1rem; border: 1px solid var(--brand-border); border-radius: var(--rs); overflow: hidden; }
.ups-label-header { background: var(--brand-light); padding: 0.6rem 1rem; border-bottom: 2px solid var(--brand); }
.ups-label-title { font-weight: 700; font-size: 0.78rem; color: var(--brand); letter-spacing: .04em; text-transform: uppercase; }
.ups-label-fields { padding: 1rem; background: #f8f9fa; display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.ups-field-group { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 160px; }
.ups-field-group label { font-size: 0.7rem; font-weight: 700; color: #555; margin: 0; text-transform: uppercase; letter-spacing: .04em; }
.ups-field-group input { padding: 6px 9px; font-size: 0.84rem; }
.ups-download-btn { background: #0077C8; border-color: #0077C8; color: white; padding: 0 13px; height: 30px; font-size: 0.78rem; white-space: nowrap; flex-shrink: 0; }
.ups-download-btn:hover { background: #005fa3; border-color: #005fa3; transform: translateY(-1px); }

.router-type-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.25rem; }
.router-type-btn {
    padding: 0 9px; height: 26px; border: 1px solid var(--brand-border);
    border-radius: var(--rs); background: #fff; color: #555;
    font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.15s;
    white-space: nowrap; font-family: Arial, sans-serif;
}
.router-type-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
.router-type-btn.active { background: var(--brand) !important; border-color: var(--brand) !important; color: white !important; }

.router-entries { display: flex; flex-direction: column; gap: 0.75rem; }
.router-entry { background: #f8f9fa; border: 1px solid var(--brand-border); border-radius: var(--rs); padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.router-entry-header { display: flex; align-items: center; justify-content: space-between; }
.router-entry-label { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }
.router-remove-btn { background: transparent; border: 1px solid #ddd; border-radius: 4px; color: #9ca3af; font-size: 0.75rem; padding: 0.2rem 0.5rem; cursor: pointer; transition: border-color 0.15s, color 0.15s; }
.router-remove-btn:hover { border-color: #ef4444; color: #ef4444; }
.router-add-btn { background: transparent; border: 1px dashed var(--brand-border); border-radius: var(--rs); color: var(--brand); font-size: 0.82rem; font-weight: 600; padding: 0.45rem 1rem; cursor: pointer; width: 100%; margin-top: 0.25rem; transition: background 0.15s, border-color 0.15s; font-family: Arial, sans-serif; }
.router-add-btn:hover { background: var(--brand-light); border-color: var(--brand); }

body.dark .router-type-btn { background: #232b35; border-color: rgba(251,97,47,0.22); color: #94a3b8; }
body.dark .router-type-btn:hover { background: rgba(251,97,47,0.1); color: var(--brand); border-color: var(--brand); }
body.dark .router-entry { background: #1e2530; border-color: rgba(251,97,47,0.22); }
body.dark .ups-label-section { border-color: rgba(251,97,47,0.22); }
body.dark .ups-label-header { background: rgba(251,97,47,0.08); }
body.dark .ups-label-fields { background: #232b35; }
body.dark .ups-field-group label { color: #64748b; }

/* ── JIRA TICKET SECTION ── */
.jira-section-label {
    color: #0052CC !important;
    border-bottom-color: rgba(0,82,204,0.35) !important;
    display: flex; align-items: center;
}
.jira-section-note { font-size: 0.75rem; color: #9ca3af; margin: 0.25rem 0 0 0; font-style: italic; }
.jira-required { color: #dc3545; font-weight: 700; margin-left: 2px; }
.jira-field-label {
    display: block; font-weight: 700; color: #555;
    font-family: Arial, sans-serif; margin-bottom: 0.4rem;
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: .04em;
}
.jira-autofill-hint {
    display: inline-block; margin-left: 0.4rem;
    font-size: 0.68rem; font-weight: 600; text-transform: none; letter-spacing: 0;
    color: #0052cc; background: rgba(0,82,204,0.1);
    padding: 1px 7px; border-radius: 10px; vertical-align: middle;
}
body.dark .jira-autofill-hint { color: #4d94ff; background: rgba(0,122,255,0.18); }

.jira-field[type="text"],
.jira-field[type="date"],
.jira-field.jira-date-input {
    width: 100%; padding: 6px 9px;
    border: 1px solid rgba(0,82,204,0.3); border-radius: var(--rs);
    font-size: 0.84rem; font-family: Arial, sans-serif;
    transition: border-color 0.15s; background-color: #fff; color: #000;
}
body.dark .jira-field[type="text"],
body.dark .jira-field[type="date"],
body.dark .jira-field.jira-date-input { background-color: #1e2530; border-color: rgba(0,122,255,0.3); color: #e2e8f0; color-scheme: dark; }
.jira-field[type="text"]:focus,
.jira-field[type="date"]:focus { outline: none; border-color: #0052CC; box-shadow: 0 0 0 3px rgba(0,82,204,0.15); }

.jira-select {
    width: 100%; padding: 6px 9px;
    border: 1px solid rgba(0,82,204,0.3); border-radius: var(--rs);
    font-size: 0.84rem; background-color: #fff; color: #000;
    cursor: pointer; transition: border-color 0.15s;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230052CC' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem;
    font-family: Arial, sans-serif;
}
body.dark .jira-select { background-color: #1e2530; color: #e2e8f0; border-color: rgba(0,122,255,0.3); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a90d9' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); }
.jira-select:focus { outline: none; border-color: #0052CC; box-shadow: 0 0 0 3px rgba(0,82,204,0.15); }
.jira-select option { background-color: #fff; color: #000; }

.jira-field.is-valid { border-color: #198754 !important; box-shadow: 0 0 0 3px rgba(25,135,84,0.15) !important; }
.jira-field.is-invalid { border-color: #dc3545 !important; box-shadow: 0 0 0 3px rgba(220,53,69,0.15) !important; }
.invalid-feedback { display: none; width: 100%; margin-top: 0.3rem; font-size: 0.8rem; color: #dc3545; font-family: Arial, sans-serif; font-weight: 600; }
.valid-feedback { display: none; width: 100%; margin-top: 0.3rem; font-size: 0.8rem; color: #198754; font-family: Arial, sans-serif; font-weight: 600; }
.jira-field.is-invalid ~ .invalid-feedback { display: block; }
.jira-field.is-valid ~ .valid-feedback { display: block; }

.btn-jira { background-color: #0052CC; border-color: #0052CC; color: #fff; font-weight: 700; display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-jira:hover { background-color: #0747a6; border-color: #0747a6; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,82,204,0.4); color: #fff; }
.btn-jira:active { transform: translateY(0); }

/* ── Teams button ── */
.btn-teams { background-color: #5b5ea6; border-color: #5b5ea6; color: #fff; font-weight: 700; display: inline-flex; align-items: center; gap: 0.4rem; }
.btn-teams:hover { background-color: #4a4d8f; border-color: #4a4d8f; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(91,94,166,0.4); color: #fff; }
.btn-teams:active { transform: translateY(0); }

/* ════════════════════════════════════════════════
   TEAMS MODAL
   ════════════════════════════════════════════════ */
.teams-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 9999;
    align-items: center; justify-content: center;
}
.teams-modal-overlay.open { display: flex; }
.teams-modal-box {
    background: #fff; border-radius: 14px;
    padding: 1.75rem 2rem; width: 100%; max-width: 460px;
    position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
body.dark .teams-modal-box { background: #1e2530; color: #e2e8f0; }
.teams-modal-close {
    position: absolute; top: 1rem; right: 1rem;
    background: none; border: none; font-size: 1.4rem; line-height: 1;
    cursor: pointer; color: #9ca3af; padding: 0.15rem 0.4rem;
    border-radius: 4px; transition: color 0.15s;
}
.teams-modal-close:hover { color: #ef4444; }
.teams-modal-tag {
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: #5b5ea6; margin-bottom: 0.4rem;
}
.teams-modal-title {
    font-size: 1.05rem; font-weight: 800; color: #1e293b; margin-bottom: 1rem;
}
body.dark .teams-modal-title { color: #f1f5f9; }
.teams-modal-note {
    font-size: 0.82rem; color: #6b7280; margin-bottom: 1.1rem; line-height: 1.5;
}
body.dark .teams-modal-note { color: #94a3b8; }
.teams-field-wrap { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.85rem; }
.teams-field-wrap label {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: #374151;
}
body.dark .teams-field-wrap label { color: #94a3b8; }
.teams-field-wrap input {
    width: 100%; padding: 0.5rem 0.75rem; border: 1.5px solid #d1d5db;
    border-radius: 8px; font-size: 0.875rem; font-family: Arial, sans-serif;
    background: #fff; color: #1e293b; transition: border-color 0.15s;
}
body.dark .teams-field-wrap input { background: #1a2030; border-color: rgba(91,94,166,0.35); color: #e2e8f0; }
.teams-field-wrap input:focus { outline: none; border-color: #5b5ea6; box-shadow: 0 0 0 3px rgba(91,94,166,0.15); }
.teams-field-hint { font-size: 0.7rem; color: #9ca3af; }
.teams-remember-wrap {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 0.8rem; color: #6b7280; cursor: pointer; margin-bottom: 1.25rem;
}
body.dark .teams-remember-wrap { color: #94a3b8; }
.teams-remember-wrap input[type="checkbox"] { accent-color: #5b5ea6; width: 14px; height: 14px; cursor: pointer; }
.teams-saved-badge {
    display: none; font-size: 0.72rem; color: #5b5ea6; font-weight: 600;
    margin-bottom: 0.5rem;
}
.teams-saved-badge.show { display: block; }
.teams-modal-actions { display: flex; gap: 0.6rem; }

/* ── NOC Teams target picker ── */
.noc-teams-targets { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 1rem; }
.noc-teams-target-btn {
    width: 100%; padding: 0.8rem 1rem; border-radius: 10px; border: 2px solid;
    cursor: pointer; display: flex; align-items: center; gap: 0.75rem;
    background: none; font-family: Arial, sans-serif; transition: all 0.15s; text-align: left;
}
.noc-teams-target-btn.primary-target { border-color: #5b5ea6; }
.noc-teams-target-btn.primary-target:hover { background: rgba(91,94,166,0.08); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(91,94,166,0.18); }
.noc-teams-target-btn.fallback-target { border-color: #d1d5db; }
.noc-teams-target-btn.fallback-target:hover { background: rgba(107,114,128,0.07); transform: translateY(-1px); }
body.dark .noc-teams-target-btn.fallback-target { border-color: rgba(255,255,255,0.15); }
.noc-teams-target-icon { flex-shrink: 0; }
.noc-teams-target-info { flex: 1; min-width: 0; }
.noc-teams-target-badge {
    font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.09em; color: #9ca3af; margin-bottom: 0.15rem;
}
.noc-teams-target-name { font-size: 0.9rem; font-weight: 700; color: #1e293b; }
.noc-teams-target-btn.primary-target .noc-teams-target-name { color: #5b5ea6; }
body.dark .noc-teams-target-name { color: #f1f5f9; }
body.dark .noc-teams-target-btn.primary-target .noc-teams-target-name { color: #818cf8; }
.teams-edit-link {
    background: none; border: none; color: #9ca3af; font-size: 0.72rem;
    cursor: pointer; text-decoration: underline; padding: 0; display: block; margin: 0 auto;
    font-family: Arial, sans-serif; transition: color 0.15s;
}
.teams-edit-link:hover { color: #5b5ea6; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .note-layout-wrap, .email-layout-wrap { flex-direction: column; }
    .note-sub-nav, .email-mini-nav {
        width: 100%; flex-direction: row; flex-wrap: wrap;
        border-right: none; border-bottom: 1px solid var(--brand-border);
        padding: 0.5rem;
    }
    .note-sub-btn, .email-mini-btn { white-space: nowrap; width: auto; }
    .sub-nav-divider { width: 1px; height: auto; align-self: stretch; margin: 0 0.25rem; }
    .sub-nav-noc-tabs { flex-direction: row; flex-wrap: wrap; }
    .note-with-sidebar { padding: 1rem; }
    .sidebar-col { width: 85vw; }
}
@media (max-width: 600px) {
    .tool-container { padding: 1rem; }
    .email-template-form { flex-direction: column; padding: 1rem; }
    .etf-fields { flex: unset; }
    .etf-fields-wide { flex: unset; min-width: unset; }
    .ter-e-row { grid-template-columns: 1fr; }
    .equip-entry-row { grid-template-columns: 1fr; }
}

/* ── DROP BURY IMAGE ZONE ── */
.dbe-img-zone {
    border: 2px dashed var(--brand-border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--brand-light);
    outline: none;
}
.dbe-img-zone:hover, .dbe-img-zone:focus { border-color: var(--brand); background: rgba(251,97,47,0.12); }
.dbe-img-zone.dbe-drag-over { border-color: var(--brand); background: rgba(251,97,47,0.15); }
.dbe-img-hint { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; color: #888; font-size: 0.85rem; pointer-events: none; }
.dbe-img-hint svg { opacity: 0.5; }
body.dark .dbe-img-zone { border-color: rgba(251,97,47,0.22); background: rgba(251,97,47,0.05); }
body.dark .dbe-img-hint { color: #64748b; }

/* ════════════════════════════════════════════════
   CUSTOMER INFO BANNER
   ════════════════════════════════════════════════ */
.customer-info-banner {
    background: #fff;
    border-bottom: 2px solid var(--brand-border);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 20;
}
body.dark .customer-info-banner { background: #1e2530; border-bottom-color: rgba(251,97,47,0.22); }

.ci-banner-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 1.25rem; cursor: pointer; user-select: none; gap: 0.75rem;
}
.ci-banner-title {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.09em; color: var(--brand);
}
.ci-banner-hint { font-size: 0.68rem; color: #9ca3af; font-weight: 400; text-transform: none; letter-spacing: 0; }
body.dark .ci-banner-hint { color: #475569; }
.ci-banner-toggle {
    background: none; border: none; color: #9ca3af; cursor: pointer;
    padding: 2px 4px; border-radius: 4px; display: flex; align-items: center;
    flex-shrink: 0; transition: color 0.15s;
}
.ci-banner-toggle:hover { color: var(--brand); }
.ci-banner-toggle svg { transition: transform 0.2s ease; }
.customer-info-banner.collapsed .ci-banner-toggle svg { transform: rotate(-90deg); }
.ci-clear-wrap {
    display: flex; align-items: flex-end; flex-shrink: 0;
}
.ci-clear-btn {
    background: rgba(239,68,68,0.08); border: 1.5px solid #fca5a5; color: #ef4444;
    font-size: 0.72rem; font-weight: 700; padding: 0.35rem 1rem;
    border-radius: 6px; cursor: pointer; text-transform: uppercase;
    letter-spacing: 0.07em; white-space: nowrap;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    font-family: Arial, sans-serif;
}
.ci-clear-btn:hover { background: rgba(239,68,68,0.18); border-color: #ef4444; color: #dc2626; }
body.dark .ci-clear-btn { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.45); color: #f87171; }
body.dark .ci-clear-btn:hover { background: rgba(239,68,68,0.2); border-color: #ef4444; color: #ef4444; }

.ci-banner-fields {
    display: flex; flex-wrap: wrap; gap: 0.5rem 0.6rem;
    padding: 0 1.25rem 0.65rem; align-items: flex-end;
    max-height: 240px; overflow: hidden;
    transition: max-height 0.3s ease, padding 0.2s ease, opacity 0.2s;
    opacity: 1;
}
.customer-info-banner.collapsed .ci-banner-fields {
    max-height: 0; padding-bottom: 0; opacity: 0; pointer-events: none;
}
.ci-field { display: flex; flex-direction: column; gap: 0.2rem; flex: 1 1 108px; max-width: 150px; }
.ci-field.wide { flex: 1.5 1 140px; max-width: 190px; }
.ci-field label {
    font-size: 0.65rem; font-weight: 600; color: #6b7280;
    text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap;
}
body.dark .ci-field label { color: #64748b; }
.ci-field input, .ci-field select {
    height: 32px; font-size: 0.81rem; padding: 0 0.5rem;
    border: 1px solid var(--brand-border); border-radius: 6px;
    background: #fff; color: inherit; width: 100%;
    font-family: Arial, sans-serif; transition: border-color 0.15s;
}
.ci-field select {
    appearance: none; -webkit-appearance: none; padding-right: 1.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.55rem center;
}
.ci-field input:focus, .ci-field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(251,97,47,0.12); }
body.dark .ci-field input, body.dark .ci-field select { background: #1a2030; border-color: rgba(251,97,47,0.22); color: #e2e8f0; }
.ci-field input::placeholder { color: #9ca3af; }

/* ── Generate Dispatch Note button ── */
.btn-dispatch {
    background: #0369a1; color: white; border-color: #0369a1;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-dispatch:hover { background: #075985; border-color: #075985; color: white; transform: translateY(-1px); }
body.dark .btn-dispatch { background: #0369a1; border-color: #0369a1; color: white; }

/* ── Create Truck Roll Note / Create Commercial Customer Note buttons ── */
.btn-truckroll {
    background: #16a34a; color: white; border-color: #16a34a;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-truckroll:hover { background: #15803d; border-color: #15803d; color: white; transform: translateY(-1px); }
body.dark .btn-truckroll { background: #16a34a; border-color: #16a34a; color: white; }

.btn-commercial {
    background: #0077C8; color: white; border-color: #0077C8;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-commercial:hover { background: #005fa3; border-color: #005fa3; color: white; transform: translateY(-1px); }
body.dark .btn-commercial { background: #0077C8; border-color: #0077C8; color: white; }

/* ════════════════════════════════════════════════
   DISPATCH QUICK MODAL
   ════════════════════════════════════════════════ */
.dispatch-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: 9998;
    align-items: center; justify-content: center;
}
.dispatch-modal-overlay.open { display: flex; }
.dispatch-modal-box {
    background: #fff; border-radius: 10px;
    padding: 1.5rem 1.5rem 1.25rem;
    width: 560px; max-width: 96vw; max-height: 90vh;
    overflow-y: auto; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    font-family: Arial, sans-serif;
}
body.dark .dispatch-modal-box { background: #1e2530; border: 1px solid rgba(251,97,47,0.22); }
.dispatch-modal-close {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; color: #9ca3af;
    font-size: 22px; cursor: pointer; line-height: 1;
    padding: 2px 6px; border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.dispatch-modal-close:hover { color: var(--brand); background: var(--brand-light); }
body.dark .dispatch-modal-close { color: #475569; }
.dispatch-modal-tag { font-size: 0.62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: 0.25rem; }
.dispatch-modal-title { font-size: 1rem; font-weight: 700; color: #1e293b; margin-bottom: 0.9rem; padding-right: 2rem; }
body.dark .dispatch-modal-title { color: #e2e8f0; }

.dqm-customer-preview {
    background: var(--brand-light); border: 1px solid var(--brand-border);
    border-radius: 6px; padding: 0.5rem 0.85rem; margin-bottom: 1rem;
    font-size: 0.78rem; color: #374151; line-height: 1.8;
}
body.dark .dqm-customer-preview { background: rgba(251,97,47,0.07); border-color: rgba(251,97,47,0.22); color: #94a3b8; }
.dqm-customer-preview strong { font-size: 0.63rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); display: block; margin-bottom: 0.3rem; }
.dqm-customer-preview span { display: inline-block; margin-right: 1rem; margin-bottom: 0.1rem; word-break: break-word; }

.dqm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem 1rem; }
.dqm-grid .full { grid-column: 1 / -1; }
.dqm-grid label { font-size: 0.76rem; font-weight: 600; color: #374151; display: block; margin-bottom: 0.25rem; }
body.dark .dqm-grid label { color: #94a3b8; }
.dqm-grid input[type="text"], .dqm-grid select, .dqm-grid textarea {
    width: 100%; padding: 6px 9px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 0.84rem; background: #fff; color: #000;
    font-family: Arial, sans-serif; transition: border-color 0.15s;
}
.dqm-grid select {
    appearance: none; -webkit-appearance: none; padding-right: 2rem; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.75rem center;
}
.dqm-grid input:focus, .dqm-grid select:focus, .dqm-grid textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(251,97,47,0.12); }
body.dark .dqm-grid input, body.dark .dqm-grid select, body.dark .dqm-grid textarea { background: #1a2030; border-color: rgba(251,97,47,0.22); color: #e2e8f0; }
.dqm-grid input::placeholder, .dqm-grid textarea::placeholder { color: #9ca3af; }
.dqm-grid textarea { resize: vertical; }

.dqm-actions { display: flex; gap: 0.5rem; margin-top: 1.25rem; flex-wrap: wrap; }
.dqm-output { display: none; margin-top: 1.25rem; border-top: 1px solid var(--brand-border); padding-top: 1rem; }
body.dark .dqm-output { border-top-color: rgba(251,97,47,0.22); }
.dqm-output.show { display: block; }
.dqm-output-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.dqm-output-header h4 { font-size: 0.82rem; font-weight: 700; color: #374151; margin: 0; }
body.dark .dqm-output-header h4 { color: #e2e8f0; }
.dqm-output .output-box textarea { min-height: 140px; font-size: 0.84rem; }
