:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #1f242c;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #7d8590;
  --accent: #f78166;
  --accent-hover: #ff9477;
  --accent-dim: rgba(247,129,102,.12);
  --green: #3fb950;
  --red: #f85149;
  --orange: #d29922;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'IBM Plex Sans', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
.mono { font-family: 'IBM Plex Mono', monospace; }

/* Brand */
.brand-mark { font-family: 'IBM Plex Mono', monospace; font-weight: 700; font-size: 15px; letter-spacing: -.02em; }
.brand-mark span { color: var(--accent); margin-left: 2px; }

/* Login */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background:
  radial-gradient(ellipse at top, rgba(247,129,102,.05) 0%, transparent 50%),
  radial-gradient(ellipse at bottom, rgba(63,185,80,.03) 0%, transparent 50%), var(--bg); }
.login-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 40px 36px; width: 100%; max-width: 380px; box-shadow: 0 24px 80px rgba(0,0,0,.4); }
.login-box .brand-mark { font-size: 18px; margin-bottom: 6px; }
.login-title { color: var(--text-dim); font-size: 13px; margin-bottom: 28px; letter-spacing: .04em; text-transform: uppercase; }
.lbl { display: block; margin-bottom: 18px; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.lbl input { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 14px; font-family: inherit; transition: all .15s; }
.lbl input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.login-box button { width: 100%; padding: 12px; background: var(--accent); color: #1a0e07; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; font-family: inherit; }
.login-box button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.login-box .error { background: rgba(248,81,73,.1); color: var(--red); padding: 11px 14px; border-radius: 8px; margin-bottom: 18px; font-size: 13px; border: 1px solid rgba(248,81,73,.2); }

/* App layout */
.app { display: grid; grid-template-columns: 260px 1fr; height: 100vh; }
.sidebar { background: var(--bg2); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.sidebar .brand-mark { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.me { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; }
.avatar-mini { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent) 0%, #c45f47 100%); display: flex; align-items: center; justify-content: center; font-weight: 600; color: #1a0e07; flex-shrink: 0; font-size: 13px; }
.me-name { font-size: 13px; font-weight: 500; }
.me-role { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; margin-top: 1px; }

.channels { flex: 1; overflow-y: auto; padding: 14px 0; }
.section-title { padding: 4px 18px 8px; font-size: 10px; color: var(--text-dim); letter-spacing: .12em; font-weight: 600; }
.channel { padding: 7px 18px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 6px; color: var(--text-dim); transition: all .1s; border-left: 2px solid transparent; }
.channel:hover { background: var(--bg3); color: var(--text); }
.channel.active { background: var(--accent-dim); color: var(--text); border-left-color: var(--accent); }
.ch-hash { color: var(--text-dim); font-weight: 400; }
.channel.active .ch-hash { color: var(--accent); }
.ch-name { font-weight: 500; }
.ch-badge { margin-left: auto; font-size: 9px; background: var(--orange); padding: 2px 6px; border-radius: 3px; color: #1a0e07; font-weight: 700; letter-spacing: .04em; }

.bottom { padding: 14px 18px; border-top: 1px solid var(--border); }
.logout { color: var(--text-dim); text-decoration: none; font-size: 12px; transition: color .15s; }
.logout:hover { color: var(--red); }

/* Main */
.main { display: flex; flex-direction: column; overflow: hidden; }
.topbar { padding: 14px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: var(--bg2); }
.ch-title { font-weight: 600; font-size: 15px; font-family: 'IBM Plex Mono', monospace; }
.online-count { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.online-count .dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 8px var(--green); }

.messages { flex: 1; overflow-y: auto; padding: 20px 24px; }
.msg { display: flex; gap: 12px; padding: 6px 0; animation: fadein .2s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.msg .avatar { width: 36px; height: 36px; border-radius: 8px; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; font-size: 13px; color: var(--accent); }
.msg .meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg .author { font-weight: 600; font-size: 13px; }
.msg .time { font-size: 10px; color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; letter-spacing: .02em; }
.msg .body { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.msg.system .body { color: var(--text-dim); font-style: italic; }
.msg.sms_log .body { background: rgba(63,185,80,.08); padding: 6px 10px; border-radius: 6px; border-left: 3px solid var(--green); font-family: 'IBM Plex Mono', monospace; font-size: 12px; }

.composer { display: flex; padding: 14px 24px 16px; border-top: 1px solid var(--border); gap: 10px; background: var(--bg2); }
.composer textarea { flex: 1; resize: none; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 11px 14px; color: var(--text); font-family: inherit; font-size: 14px; max-height: 140px; line-height: 1.5; transition: all .15s; }
.composer textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.composer button { padding: 0 20px; background: var(--accent); color: #1a0e07; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; }
.composer button:hover { background: var(--accent-hover); }

.loading { color: var(--text-dim); padding: 12px; text-align: center; font-size: 13px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; border: 2px solid var(--bg2); }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Awaiting */
.awaiting-box { text-align: center; }
.awaiting-icon { font-size: 48px; margin: 20px 0 10px; }
.awaiting-title { color: var(--text); margin-bottom: 6px; font-weight: 600; }
.awaiting-sub { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }
.awaiting-text { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; line-height: 1.6; }
.awaiting-spin { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.awaiting-spin .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.awaiting-spin .dot:nth-child(2) { animation-delay: .2s; }
.awaiting-spin .dot:nth-child(3) { animation-delay: .4s; }
@keyframes pulse { 0%, 80%, 100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.awaiting-status { color: var(--text-dim); font-size: 12px; font-family: 'IBM Plex Mono', monospace; margin-bottom: 18px; }
.awaiting-cancel { color: var(--text-dim); font-size: 12px; text-decoration: none; }
.awaiting-cancel:hover { color: var(--red); }

/* Admin */
.admin-wrap { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.admin-top { display: flex; justify-content: space-between; align-items: center; padding: 16px 28px; border-bottom: 1px solid var(--border); background: var(--bg2); }
.admin-tag { background: var(--accent); color: #1a0e07; padding: 2px 8px; border-radius: 4px; font-size: 10px; margin-left: 10px; font-weight: 700; letter-spacing: .06em; }
.admin-nav { display: flex; gap: 20px; }
.admin-nav a { color: var(--text-dim); text-decoration: none; font-size: 13px; transition: color .15s; }
.admin-nav a:hover { color: var(--text); }
.admin-main { max-width: 1100px; margin: 0 auto; padding: 28px; width: 100%; }
.admin-section { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; margin-bottom: 22px; }
.admin-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.badge-num { background: var(--bg3); color: var(--text-dim); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-family: 'IBM Plex Mono', monospace; }
.pending-list .empty { color: var(--text-dim); font-size: 13px; padding: 12px 0; font-style: italic; }
.pending-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: var(--bg); }
.pr-info { flex: 1; }
.pr-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.pr-mono { color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; font-size: 12px; font-weight: 400; margin-left: 6px; }
.pr-meta { color: var(--text-dim); font-size: 11px; font-family: 'IBM Plex Mono', monospace; }
.pr-actions { display: flex; gap: 8px; }
.btn-approve, .btn-reject { padding: 7px 14px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: inherit; transition: all .15s; }
.btn-approve { background: var(--green); color: #07210e; }
.btn-approve:hover { background: #4ec264; transform: translateY(-1px); }
.btn-reject { background: var(--bg3); color: var(--red); border: 1px solid var(--border); }
.btn-reject:hover { background: rgba(248,81,73,.1); }

.user-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.user-table th, .user-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.user-table th { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.role-tag { padding: 2px 8px; border-radius: 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.role-admin { background: var(--accent); color: #1a0e07; }
.role-user { background: var(--bg3); color: var(--text-dim); }
.ok { color: var(--green); font-weight: 500; }
.dim { color: var(--text-dim); }
.mono { font-family: 'IBM Plex Mono', monospace; font-size: 12px; }
.hint { color: var(--text-dim); font-size: 12px; margin-top: 14px; font-style: italic; }

.admin-link { display: block; color: var(--accent); text-decoration: none; font-size: 13px; margin-bottom: 8px; font-weight: 500; }
.admin-link:hover { color: var(--accent-hover); }
.pending-pill { background: var(--red); color: #fff; padding: 1px 7px; border-radius: 8px; font-size: 10px; margin-left: 4px; font-family: 'IBM Plex Mono', monospace; }

.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-head h2 { margin: 0; }

.btn-primary { padding: 9px 16px; background: var(--accent); color: #1a0e07; border: none; border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit; transition: all .15s; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { padding: 9px 16px; background: var(--bg3); color: var(--text); border: 1px solid var(--border); border-radius: 6px; font-weight: 500; font-size: 13px; cursor: pointer; font-family: inherit; }
.btn-secondary:hover { background: var(--bg); }
.btn-mini { padding: 4px 9px; background: var(--bg3); color: var(--text); border: 1px solid var(--border); border-radius: 4px; font-size: 11px; cursor: pointer; font-family: inherit; margin-right: 4px; transition: all .15s; }
.btn-mini:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }

.user-table { font-size: 13px; }
.actions-col { width: 220px; }
.actions-cell { white-space: nowrap; }
.small { font-size: 11px; }
.row-inactive { opacity: .5; }
.row-self { background: rgba(247,129,102,.04); }
.self-tag { background: var(--accent); color: #1a0e07; padding: 1px 5px; border-radius: 3px; font-size: 9px; font-weight: 700; margin-left: 4px; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); }
.offline-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bg3); border: 1px solid var(--border); }
.table-wrap { overflow-x: auto; }
.me-tag { color: var(--text-dim); font-size: 12px; margin-right: 20px; }

.modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.5); animation: modalin .2s ease; }
@keyframes modalin { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; }
.modal-body label { display: block; margin-bottom: 14px; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.modal-body input, .modal-body select { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 14px; font-family: inherit; }
.modal-body input:focus, .modal-body select:focus { outline: none; border-color: var(--accent); }
.lbl-hint { font-weight: 400; color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal-status { margin-top: 12px; font-size: 12px; }

.pwd-show-text { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.pwd-display { background: var(--bg); border: 1px solid var(--accent); padding: 14px; border-radius: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 16px; text-align: center; margin-bottom: 12px; letter-spacing: .02em; user-select: all; }

.pwd-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pwd-form input { padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 14px; font-family: inherit; flex: 1; min-width: 200px; }
.pwd-form input:focus { outline: none; border-color: var(--accent); }
.pwd-form button { padding: 10px 16px; background: var(--accent); color: #1a0e07; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; font-family: inherit; }
.pwd-status { width: 100%; font-size: 12px; min-height: 16px; }

/* Vardiya bitir bar */
.shift-bar { background: linear-gradient(135deg, rgba(248,81,73,.08) 0%, rgba(210,153,34,.08) 100%); border: 1px solid rgba(248,81,73,.3); border-radius: 12px; padding: 18px 22px; margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.shift-bar-info { flex: 1; }
.shift-bar-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.shift-bar-text { color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.btn-danger-big { padding: 12px 22px; background: var(--red); color: #fff; border: none; border-radius: 8px; font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; }
.btn-danger-big:hover { background: #ff6259; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(248,81,73,.3); }

/* Danger mini button */
.btn-mini.btn-danger { color: var(--red); border-color: rgba(248,81,73,.3); }
.btn-mini.btn-danger:hover { background: rgba(248,81,73,.1); border-color: var(--red); color: var(--red); }

/* Brand mark fix: span'lara ayri ayri renk ata, generic 'span' kuralini override et */
.brand-mark .brand-accent { color: var(--accent) !important; margin-left: 2px; }
.brand-link { color: inherit; text-decoration: none; display: inline-flex; align-items: center; transition: opacity .15s; }
.brand-link:hover { opacity: .75; }
.brand-mark .role-tag-header { padding: 3px 9px; border-radius: 4px; font-size: 10px; margin-left: 12px; font-weight: 700; letter-spacing: .08em; font-family: 'IBM Plex Mono', monospace; }
.brand-mark .role-tag-header.admin { background: var(--accent); color: #1a0e07 !important; }
.brand-mark .role-tag-header.manager { background: var(--green); color: #07210e !important; }
.brand-mark .role-tag-header.call_center { background: var(--bg3); color: var(--text) !important; }
.brand-mark .role-tag-header.livechat { background: #d29922; color: #1a0e07 !important; }

/* Role tags renkleri (tablo+pending icin) */
.role-tag.role-admin { background: var(--accent); color: #1a0e07; }
.role-tag.role-manager { background: var(--green); color: #07210e; }
.role-tag.role-call_center { background: var(--bg3); color: var(--text-dim); }
.role-tag.role-livechat { background: rgba(210,153,34,.2); color: var(--orange); }
.role-tag.role-user { background: var(--bg3); color: var(--text-dim); }

/* Channel section */
.channel-list { display: flex; flex-direction: column; gap: 8px; }
.channel-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; }
.ch-info { flex: 1; }
.ch-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ch-name-bold { font-weight: 600; font-family: 'IBM Plex Mono', monospace; }
.ch-desc { font-size: 12px; color: var(--text-dim); }
.ch-meta { font-size: 10px; }

/* Checkbox label */
.modal-body .check-label { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; color: var(--text); font-size: 13px; cursor: pointer; padding: 8px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 14px; }
.modal-body .check-label input { width: auto; margin: 0; }
.modal-body .check-label span { font-size: 13px; }

.modal-warn { background: rgba(210,153,34,.1); color: var(--orange); padding: 10px 12px; border-radius: 6px; font-size: 12px; margin-bottom: 14px; border-left: 3px solid var(--orange); }
.rm-info { color: var(--text-dim); font-size: 13px; margin-bottom: 14px; }
.rm-info strong { color: var(--text); }
