.layout { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: #0f172a; color: #dbeafe; display: flex; flex-direction: column; padding: 18px 14px; transition: width .2s ease; position: sticky; top: 0; height: 100vh; }
.sidebar.collapsed { width: 78px; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 46px; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; background: var(--blue); color: white; display: grid; place-items: center; font-weight: 800; }
.brand-text { font-weight: 700; line-height: 1.1; }
.brand-text span { color: #93c5fd; font-size: 12px; font-weight: 400; }
.sidebar.collapsed .brand-text, .sidebar.collapsed .menu-item b { display: none; }
.hamburger { background: #172554; border: 1px solid #1e3a8a; color: #bfdbfe; border-radius: 10px; padding: 8px; cursor: pointer; margin-bottom: 14px; }
.menu { display: flex; flex-direction: column; gap: 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; color: #cbd5e1; border-left: 3px solid transparent; }
.menu-item span { width: 22px; text-align: center; }
.menu-item:hover { background: #1e293b; }
.menu-item.active { background: #1e293b; color: white; border-left-color: #60a5fa; }
.logout-form { margin-top: auto; }
.logout { width: 100%; background: transparent; border: 0; cursor: pointer; text-align: left; }
.main { flex: 1; padding: 28px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 28px; }
.page-head p { margin: 0; color: var(--muted); }
.head-actions { display: flex; gap: 10px; align-items: center; }
.head-actions form { display: inline; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.metric { padding: 18px; }
.card.metric span { display: block; color: var(--muted); margin-bottom: 10px; }
.card.metric b { font-size: 30px; }
.card.metric.warn b { color: var(--orange); }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { padding: 16px; }
.panel-title { font-weight: 700; margin-bottom: 12px; }
.queue-mini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.queue-mini div { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.queue-mini span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.queue-mini b { font-size: 22px; }
.filters { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }
.filters input { min-width: 360px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 700; padding: 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
.table tr:hover td { background: #f8fafc; }
.main-cell { font-weight: 700; margin-bottom: 4px; }
.actions { display: flex; gap: 10px; white-space: nowrap; }
.actions form { display: inline; }
.status, .badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e2e8f0; color: #475569; }
.status.ok, .status.sent, .badge.info { background: #dcfce7; color: #166534; }
.status.pending { background: #dbeafe; color: #1d4ed8; }
.status.error, .badge.error { background: #fee2e2; color: #991b1b; }
.status.rejected { background: #ffedd5; color: #9a3412; }
.status.duplicate { background: #f1f5f9; color: #475569; }
.error-text { color: var(--red); font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px 0; color: var(--muted); font-size: 14px; }
.pages { display: flex; gap: 6px; }
.pages a, .pages span { min-width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); display: grid; place-items: center; background: white; }
.pages span { background: var(--dark); color: white; border-color: var(--dark); }
.log-list.compact { display: flex; flex-direction: column; gap: 10px; }
.log-row { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.log-row p { margin: 6px 0 0; }
.log-row em { color: var(--muted); font-size: 12px; font-style: normal; float: right; }
.settings-panel { max-width: 760px; }
.setting-row { display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 13px 0; }
.setting-row:last-child { border-bottom: 0; }
.setting-row span { color: var(--muted); }
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top, #dbeafe, #f8fafc 52%); }
.login-card { width: 390px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-logo { width: 54px; height: 54px; border-radius: 16px; background: var(--blue); color: white; display: grid; place-items: center; font-weight: 900; }
.login-card h1 { margin: 0; }
.login-card p { margin: 0 0 6px; color: var(--muted); }
.login-card label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.login-host { color: var(--muted); font-size: 13px; text-align: center; }
.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; padding: 12px 18px; border-radius: 12px; color: white; box-shadow: var(--shadow); background: var(--blue); }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
.toast.warning { background: var(--orange); }
.modal { position: fixed; inset: 0; display: none; z-index: 900; }
.modal.open { display: block; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.modal-card { position: relative; width: 560px; max-width: calc(100vw - 40px); margin: 8vh auto; background: white; border-radius: 18px; box-shadow: var(--shadow); padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; }
.modal-close { border: 0; background: #f1f5f9; border-radius: 10px; width: 34px; height: 34px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.form-grid label:nth-child(2) { grid-column: span 2; }
.form-actions { grid-column: span 2; display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
@media (max-width: 1100px) { .cards, .grid.two { grid-template-columns: 1fr; } .sidebar { width: 220px; } .main { padding: 18px; } }
.hint-box {
    border: 1px solid #dbe3f0;
    background: #f8fafc;
    color: #475569;
    border-radius: 12px;
    padding: 12px 14px;
    line-height: 1.45;
}
.hint-box code {
    background: #eef2ff;
    border: 1px solid #dbe3f0;
    border-radius: 6px;
    padding: 1px 6px;
    color: #0f172a;
}
.small-modal {
    max-width: 520px;
}
.tag-line {
    color: #64748b;
    font-size: 12px;
    margin-top: 4px;
    max-width: 620px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
