﻿/** Templates page styles */

/* Phase 5E â€” Microsoft Fluent / Google Material dark */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }
body { font-family: 'Segoe UI', -apple-system, 'Roboto', 'Noto Sans Bengali', system-ui, sans-serif; background: var(--bg); color: var(--text-1); font-size: 13px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
.mono { font-family: 'Roboto Mono', monospace; font-feature-settings: "tnum"; }



.sb-header { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 11px; }
.sb-logo { width: 32px; height: 32px; border-radius: 8px; background: var(--bg-subtle); border: 1px solid var(--border); overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sb-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sb-wordmark .name { font-size: 14.5px; font-weight: 700; color: var(--text-1); line-height: 1.1; }
.sb-wordmark .sub { font-size: 9px; color: var(--text-4); letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.sb-section { padding: 12px 10px 2px; }
.sb-label { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-4); font-weight: 700; padding: 0 10px 6px; }
.sb-nav { display: flex; flex-direction: column; gap: 1px; padding: 0 6px; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 500; transition: all .12s; text-decoration: none; }
.sb-item:hover { background: var(--bg-hover); color: var(--text-1); }
.sb-item.active { background: var(--bg-hover); color: var(--text-1); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border); }
.sb-item.active .sb-icon { color: var(--brand); }
.sb-icon { width: 16px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); }
.sb-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sb-badge { margin-left: auto; background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-2); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; font-family: 'Roboto Mono', monospace; }
.sb-item.active .sb-badge { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.sb-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.sb-user:hover { background: var(--bg-hover); }
.sb-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dim) 100%); color: #18181b; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.sb-user-name { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.sb-user-role { font-size: 10.5px; color: var(--text-3); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(10,10,11,.82);  border-bottom: 1px solid var(--border); padding: 11px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.back-to-dash { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 12.5px; font-weight: 500; transition: all .15s; font-family: inherit; cursor: pointer; }
.back-to-dash:hover { color: var(--text-1); border-color: var(--brand); background: var(--bg-hover); }
.back-to-dash svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }

.status-pill { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 8px; background: var(--green-soft); border: 1px solid rgba(74,222,128,.25); border-radius: 999px; font-size: 10.5px; font-weight: 600; color: var(--green); font-family: 'Roboto Mono', monospace; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.content { padding: 22px 24px 36px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 16px; }
.page-eyebrow { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 700; font-family: 'Roboto Mono', monospace; }
.page-title { font-size: 22px; letter-spacing: -.015em; color: var(--text-1); font-weight: 700; margin-top: 3px; }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 7px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all .15s; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-2); }
.btn:hover { color: var(--text-1); border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.brand { background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dim) 100%); color: #1a1408; border-color: var(--brand-dim); font-weight: 700; }
.btn.brand:hover { filter: brightness(1.05); }
.btn.danger { color: var(--red); border-color: rgba(239,68,68,.3); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 11px; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { padding: 9px 14px; font-size: 12px; font-weight: 600; color: var(--text-3); background: transparent; border: none; cursor: pointer; font-family: inherit; border-bottom: 2px solid transparent; transition: all .15s; margin-bottom: -1px; }
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--text-1); border-bottom-color: var(--brand); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.metric { padding: 12px 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.metric:last-child { border-right: none; }
.metric-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.metric-value { font-family: 'Roboto Mono', monospace; font-size: 19px; font-weight: 700; color: var(--text-1); letter-spacing: -.02em; display: flex; align-items: baseline; gap: 6px; }
.metric-value .unit { font-size: 11px; color: var(--text-3); font-weight: 500; }
.metric-value.green { color: var(--green); }
.metric-value.amber { color: var(--amber); }

.templates-grid { display: grid; grid-template-columns: 320px 1fr; gap: 14px; }

.channels-list { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 8px; max-height: 80vh; overflow-y: auto; }
.chan-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; cursor: pointer; transition: background .12s; }
.chan-row:hover { background: var(--bg-hover); }
.chan-row.active { background: var(--brand-bg); box-shadow: inset 0 0 0 1px var(--brand-dim); }
.chan-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); flex-shrink: 0; }
.chan-dot.has-template { background: var(--brand); box-shadow: 0 0 4px var(--brand); }
.chan-info { flex: 1; min-width: 0; }
.chan-name { font-size: 12.5px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-pc { font-size: 10px; color: var(--text-3); font-family: 'Roboto Mono', monospace; margin-top: 1px; }
.chan-badge { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; }
.chan-badge.tmpl { background: var(--brand-soft); color: var(--brand); }

.editor-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.editor-head .name { font-size: 16px; font-weight: 700; color: var(--text-1); }
.editor-head .sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.editor-head .actions { margin-left: auto; display: flex; gap: 6px; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.form-row .help { font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.form-input, .form-select, .form-textarea { width: 100%; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 7px; padding: 8px 11px; font-size: 12.5px; color: var(--text-1); font-family: inherit; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--brand-dim); box-shadow: 0 0 0 3px rgba(228,181,61,.08); }
.form-textarea { min-height: 80px; resize: vertical; }
.form-row.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.preview-card { background: var(--brand-bg); border: 1px solid var(--brand-soft); border-radius: 8px; padding: 12px 14px; margin-top: 14px; }
.preview-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.preview-title { font-size: 14px; font-weight: 700; color: var(--text-1); margin-bottom: 6px; }
.preview-desc { font-size: 11.5px; color: var(--text-2); white-space: pre-wrap; max-height: 120px; overflow-y: auto; }

.empty-editor { text-align: center; padding: 80px 30px; color: var(--text-3); }
.empty-editor svg { width: 40px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.5; opacity: .4; margin-bottom: 14px; }
.empty-editor h3 { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.empty-editor p { font-size: 12px; max-width: 400px; margin: 0 auto; }

/* NOTIFICATIONS TAB */
.notify-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { width: 0; height: 0; opacity: 0; }
.toggle-slot { width: 32px; height: 18px; background: var(--bg-subtle); border-radius: 9px; position: relative; border: 1px solid var(--border); transition: background .2s; }
.toggle-slot::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; background: var(--text-3); border-radius: 50%; transition: all .2s; }
.toggle input:checked + .toggle-slot { background: var(--brand-soft); border-color: var(--brand-dim); }
.toggle input:checked + .toggle-slot::after { background: var(--brand); transform: translateX(14px); }

.toast-stack { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: 10px; padding: 12px 16px; font-size: 12.5px; min-width: 280px; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: slidein .25s ease-out; }
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
@keyframes slidein { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; gap: 16px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--text-1); letter-spacing: -.01em; }
.section-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

@media (max-width: 1000px) { .templates-grid { grid-template-columns: 1fr; } .channels-list { max-height: 360px; } }
@media (max-width: 760px) {   .content { padding: 16px; } .form-row.two-col { grid-template-columns: 1fr; } }
