:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#e5e7eb;background:#0b1020;font-synthesis:none;text-rendering:optimizeLegibility}
*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(ellipse at 70% -20%,#1b2a4b 0,transparent 45%),#0b1020;font-size:14px}button,input{font:inherit}button{cursor:pointer;transition:background .18s,border-color .18s,transform .18s}button:disabled{opacity:.55;cursor:wait}.layout{min-height:100vh}.sidebar{width:248px;position:fixed;inset:0 auto 0 0;background:#0d1424;border-right:1px solid #202a3d;padding:27px 17px;display:flex;flex-direction:column;z-index:2}.brand{display:flex;align-items:center;gap:11px;font-weight:750;font-size:17px;letter-spacing:-.4px}.brand-icon{width:34px;height:34px;display:grid;place-items:center;background:linear-gradient(145deg,#51a7ff,#7866ff);border-radius:11px;color:white;font-size:20px;font-weight:800}.side-label{font-size:10px;font-weight:750;letter-spacing:1.2px;color:#68758c;margin:42px 10px 13px}.nav-item{border:1px solid transparent;background:transparent;color:#9eabc0;padding:12px;border-radius:9px;display:flex;gap:12px;text-align:left;align-items:center}.nav-item.active{background:#192641;color:#e5efff;border-color:#273a5b}.sidebar-bottom{margin-top:auto}.user-mini{display:flex;gap:11px;align-items:center;padding:15px 4px;border-top:1px solid #202a3d}.avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#253553;color:#a9c8ff;font-weight:700}.user-mini strong,.user-mini small{display:block;max-width:155px;overflow:hidden;text-overflow:ellipsis}.user-mini strong{font-size:12px}.user-mini small{color:#8190a7;font-size:11px;margin-top:4px}.main{margin-left:248px;max-width:1600px;padding:0 42px;min-height:100vh}.topbar{height:72px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #202a3d;color:#8d9ab0;font-size:12px}.crumb strong{color:#e5e7eb;font-weight:600}.status{display:flex;align-items:center;gap:8px}.status i{display:block;width:7px;height:7px;background:#38d996;border-radius:50%;box-shadow:0 0 12px #38d99666}.welcome-row{display:flex;justify-content:space-between;align-items:center;gap:20px;margin:38px 0 27px}.eyebrow{font-size:10px;letter-spacing:1.6px;font-weight:800;color:#8295b7;margin-bottom:9px}h1{font-size:30px;letter-spacing:-1px;margin:0 0 9px;font-weight:730}h2{font-size:16px;letter-spacing:-.2px;margin:0 0 7px}.muted{color:#8997ad;margin:0;line-height:1.6;font-size:13px}.primary,.secondary,.icon-button{border-radius:8px;padding:11px 15px;font-weight:650;border:1px solid transparent}.primary{background:#527df4;color:white;box-shadow:0 5px 18px #4268e52a}.primary:hover{background:#648cff}.secondary,.icon-button{background:#151e30;border-color:#2b374c;color:#c4cee0}.secondary:hover,.icon-button:hover{background:#202c42}.full{width:100%}.hidden{display:none!important}.stats-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:27px}.stat-card,.panel,.bot-card{background:linear-gradient(145deg,#141d30,#111827);border:1px solid #263249;border-radius:12px}.stat-card{padding:21px 22px}.stat-label,.stat-note{display:block;color:#92a0b5;font-size:12px}.stat-card strong{display:block;font-size:29px;letter-spacing:-1px;margin:12px 0 8px}.stat-note{font-size:11px;color:#71819a}.panel{padding:22px;margin-bottom:30px}.panel-heading,.section-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.icon-button{font-size:22px;line-height:18px;padding:7px 11px}.add-form{display:grid;grid-template-columns:1fr 1.3fr auto;gap:13px;align-items:end;margin-top:22px}label{display:block;font-size:12px;color:#aab6c9;margin:0 0 8px}input{width:100%;min-width:0;border:1px solid #303c52;background:#0b1220;border-radius:8px;color:#f0f4fb;padding:12px 13px;outline:none}input:focus{border-color:#6288ff;box-shadow:0 0 0 3px #527df422}input::placeholder{color:#56647a}.hint{font-size:11px;color:#73839b;margin:14px 0 0}.bots-section{margin-top:32px}.section-heading{align-items:center;margin-bottom:17px}.bots-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.bot-card{padding:19px;min-width:0}.bot-top{display:flex;align-items:center;gap:12px}.bot-avatar{width:43px;height:43px;flex-shrink:0;border-radius:12px;background:#202e4b;color:#9fc0ff;display:grid;place-items:center;font-size:19px;font-weight:800}.bot-info{min-width:0;flex:1}.bot-info h3{margin:0 0 5px;font-size:14px;overflow-wrap:anywhere}.bot-username{color:#8594ab;font-size:12px}.pill{font-size:10px;padding:5px 8px;border-radius:20px;white-space:nowrap;background:#163c33;color:#6be0b0}.pill.off{background:#3a2d20;color:#f3c17e}.bot-id{margin-top:18px;padding:11px;background:#0b1220;border-radius:8px;color:#7f8ea5;font-size:11px;overflow-wrap:anywhere}.bot-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.bot-actions button{padding:8px 10px;font-size:11px}.danger{color:#ff9eaa;border-color:#57303d}.empty-state{grid-column:1/-1;border:1px dashed #303d53;border-radius:12px;text-align:center;padding:38px 20px;color:#8290a6;line-height:1.7}.empty-state strong{display:block;color:#d7dfed;font-size:14px;margin-bottom:6px}.notice{padding:12px 14px;border-radius:8px;margin:16px 0;font-size:12px;line-height:1.5;background:#14283a;border:1px solid #27445d;color:#b6dcff}.notice.error{background:#351c28;border-color:#673042;color:#ffb9c4}.notice.success{background:#153027;border-color:#275b46;color:#a5f0cd}.auth-wrap{min-height:calc(100vh - 73px);display:grid;place-items:center;padding:30px 0}.auth-card{width:min(100%,420px);padding:34px;background:#111a2b;border:1px solid #29364d;border-radius:16px;box-shadow:0 25px 70px #0003}.auth-brand{margin-bottom:34px}.auth-card h1{font-size:26px;margin-bottom:10px}.auth-card form{margin-top:27px}.auth-card label:not(:first-child){margin-top:18px}.auth-card input{padding:13px}.auth-card form .primary{margin-top:23px;padding:13px}.switch-auth{text-align:center;font-size:12px;color:#8796ac;margin:22px 0 0}.link-button{border:0;background:none;color:#86a7ff;padding:3px;font-weight:650}.link-button:hover{text-decoration:underline}footer{display:flex;justify-content:space-between;gap:12px;color:#67758b;font-size:11px;border-top:1px solid #202a3d;margin-top:45px;padding:22px 0}footer span{color:#53617a}
@media(max-width:1050px){.main{padding:0 25px}.sidebar{width:215px}.main{margin-left:215px}.add-form{grid-template-columns:1fr 1fr}.add-form .primary{grid-column:1/-1}.bots-list{grid-template-columns:1fr}}@media(max-width:700px){.sidebar{position:static;width:auto;height:auto;padding:14px 18px;border-right:0;border-bottom:1px solid #202a3d}.side-label,.nav-item,.sidebar-bottom{display:none}.main{margin:0;padding:0 17px}.topbar{height:53px}.welcome-row{align-items:flex-start;flex-direction:column;margin:28px 0 20px}.welcome-row>.primary{width:100%}.stats-grid{gap:9px}.stat-card{padding:14px 12px}.stat-label{font-size:10px}.stat-card strong{font-size:24px}.stat-note{font-size:10px}.panel{padding:16px}.add-form{grid-template-columns:1fr}.add-form .primary{grid-column:auto}.auth-card{padding:25px 20px}.auth-wrap{min-height:calc(100vh - 54px)}footer{margin-top:30px}.section-heading{align-items:flex-start}}

/* Управление командами бота */
.commands-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #263249;
}

.commands-panel h3 {
    margin: 0 0 12px;
}

.commands-form {
    display: grid;
    gap: 10px;
    margin: 12px 0 18px;
}

.commands-form label {
    display: grid;
    gap: 6px;
}

.commands-form input,
.commands-form textarea {
    width: 100%;
    box-sizing: border-box;
}

.commands-form textarea {
    min-height: 100px;
    resize: vertical;
}

.commands-list {
    display: grid;
    gap: 10px;
}

.command-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid #263249;
    border-radius: 10px;
}

.command-details {
    min-width: 0;
    overflow-wrap: anywhere;
}

.command-details p {
    margin: 6px 0 0;
    white-space: pre-wrap;
}

.command-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: start;
}

.commands-notice {
    margin: 10px 0;
}

.commands-notice.hidden {
    display: none;
}

@media (max-width: 600px) {
    .command-item {
        flex-direction: column;
    }
}


/* Telegram Mini App styles */
.telegram-auth {
    margin-top: 22px;
    text-align: center;
}

.telegram-button {
    border: 0;
    border-radius: 9px;
    padding: 13px 16px;
    background: #229ed9;
    color: #fff;
    font-weight: 700;
}

.telegram-button:hover {
    background: #168ac2;
}

.telegram-hint {
    margin: 9px 0 16px;
    color: #8290a6;
    font-size: 11px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #71819a;
    font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #29364d;
}

.telegram-account-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 18px 0;
    padding: 17px 19px;
    background: #141f32;
    border: 1px solid #293b55;
    border-radius: 12px;
}

.telegram-account-panel strong {
    display: block;
    margin-bottom: 5px;
}

.telegram-account-panel p {
    margin: 0;
    color: #8997ad;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .telegram-account-panel {
        align-items: stretch;
        flex-direction: column;
    }
}
