/* Telegram Platform - Modern Dark Theme */

:root {
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f26;
    --bg-tertiary: #242d38;
    --bg-card: #1e252e;
    --accent: #0088cc;
    --accent-hover: #0099dd;
    --accent-light: rgba(0, 136, 204, 0.1);
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --text-primary: #ffffff;
    --text-secondary: #8b98a5;
    --text-muted: #5c6b77;
    --border: #2f3943;
    --border-light: #384555;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-logo .icon {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo p {
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.alert-info {
    background: var(--accent-light);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    color: var(--warning);
}

/* Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.sidebar-logo h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: var(--accent-light);
    color: var(--accent);
    border-right: 3px solid var(--accent);
}

.sidebar-nav a svg {
    width: 20px;
    height: 20px;
}

.sidebar-section {
    padding: 15px 20px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 30px;
}

/* Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
}

.page-header p {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.blue { background: var(--accent-light); color: var(--accent); }
.stat-icon.green { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.stat-icon.orange { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-icon.red { background: rgba(239, 68, 68, 0.1); color: var(--error); }

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-content h4 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-content p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
}

.table tr:hover {
    background: var(--bg-tertiary);
}

.table td {
    font-size: 14px;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-info {
    background: var(--accent-light);
    color: var(--accent);
}

/* Pagination */
.pagination {
    margin-top: 20px;
}

.pagination ul {
    display: flex;
    gap: 8px;
    list-style: none;
    justify-content: center;
}

.pagination li a,
.pagination li span {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 14px;
}

.pagination li a:hover,
.pagination li.active a {
    background: var(--accent);
    color: white;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Checkbox & Radio */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input,
.radio-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 10px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.action-btn:hover {
    background: var(--accent);
    color: white;
}

.action-btn.delete:hover {
    background: var(--error);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Buttons Preview */
.buttons-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.button-row {
    display: flex;
    gap: 4px;
}

.btn-preview {
    padding: 6px 12px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
        padding: 15px 0;
    }
    
    .sidebar-logo h2 span,
    .sidebar-nav a span,
    .sidebar-section {
        display: none;
    }
    
    .sidebar-logo {
        padding: 0 15px 15px;
    }
    
    .sidebar-nav a {
        padding: 12px;
        justify-content: center;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .main-content {
        padding: 20px;
    }
}

/* Charts */
.chart-container {
    position: relative;
    height: 300px;
    margin-top: 20px;
}

/* User Avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 40px;
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: var(--transition);
}

.tab:hover,
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Grid System */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.flex { display: flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #cbd5e1;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .sidebar {
    background: #ffffff;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .login-container {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.theme-toggle:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* ============================================
   MOBILE RESPONSIVE ENHANCEMENTS
   ============================================ */

/* Mobile Navigation */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 0 15px;
    align-items: center;
    justify-content: space-between;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Table Cards */
.mobile-card-view {
    display: none;
}

.mobile-data-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 12px;
}

.mobile-data-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.mobile-data-row:last-child {
    border-bottom: none;
}

.mobile-data-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.mobile-data-value {
    font-weight: 500;
    text-align: right;
}

/* Touch-friendly buttons */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .btn-sm {
        min-height: 36px;
        padding: 8px 12px;
    }
    
    .form-control {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .action-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Mobile Breakpoints */
@media (max-width: 991px) {
    .mobile-header {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar-overlay {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        z-index: 999;
        transition: left 0.3s ease;
        padding-top: 20px;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-logo h2 span,
    .sidebar-nav a span,
    .sidebar-section {
        display: inline;
    }
    
    .sidebar-nav a {
        padding: 12px 20px;
        justify-content: flex-start;
    }
    
    .main-content {
        margin-left: 0;
        padding-top: 80px;
        padding-left: 15px;
        padding-right: 15px;
        /* Flex-child без min-width:0 не се собира под ширината на содржината,
           па админот на телефон добиваше хоризонтален скрол од 30-40 px. */
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-content h4 {
        font-size: 22px;
    }
    
    /* Hide table, show cards on mobile */
    .table-responsive {
        display: none;
    }
    
    .mobile-card-view {
        display: block;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
    
    .card {
        padding: 16px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .modal {
        margin: 10px;
        max-height: calc(100vh - 20px);
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-header,
    .modal-footer {
        padding: 12px 16px;
    }
}

@media (max-width: 479px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
}

/* ============================================
   PLATFORM DASHBOARD BLOCKS
   ============================================ */

.page-header .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h1 .header-icon {
    vertical-align: middle;
}

.stat-card .stat-value {
    display: block;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
}

.stat-card .stat-label {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 13px;
}

.stat-card .stat-icon {
    flex-shrink: 0;
}

.dashboard-tabs {
    margin-bottom: 24px;
}

.tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    padding: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.tabs-content {
    position: relative;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table th,
.table td {
    vertical-align: middle;
}

.table td {
    color: var(--text-primary);
}

.userrow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info strong {
    color: var(--text-primary);
}

.user-info small {
    color: var(--text-muted);
}

.code-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.status-chip.success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--success);
}

.status-chip.warning {
    background: rgba(245, 158, 11, 0.12);
    color: var(--warning);
}

.status-chip.tiny {
    padding: 2px 8px;
    font-size: 11px;
}

.action-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-group .btn-sm svg {
    vertical-align: middle;
}

.main-content {
    color: var(--text-primary);
}

.card {
    color: var(--text-primary);
}

.activity-feed {
    max-height: 340px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-content strong {
    color: var(--text-primary);
}

.activity-time {
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: 4px;
}

.modal-dialog {
    width: 100%;
    max-width: 480px;
}

.modal-content {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}

.modal-header .modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 22px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.form-check-label {
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 22px;
    border-top: 1px solid var(--border);
}

.close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.top-bar-bot-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Горна лента: breadcrumb + наслов лево, алатки десно */
.top-bar-left {
    flex: 1 1 auto;
    min-width: 0;
}

.top-bar-right {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.breadcrumb .bc-sep {
    color: var(--text-muted);
    opacity: .55;
}

.breadcrumb .bc-section,
.breadcrumb .bc-current {
    color: var(--text-secondary);
}

.breadcrumb .bc-current {
    font-weight: 500;
    color: var(--text-primary);
}

.top-bar-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .top-bar-left {
        flex: 1 1 100%;
    }

    .top-bar-right {
        width: 100%;
        justify-content: flex-end;
    }

    .top-bar-title {
        font-size: 19px;
        white-space: normal;
    }
}

[data-theme="light"] .table td {
    color: var(--text-primary);
}

[data-theme="light"] .code-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

[data-theme="light"] .status-chip.success {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

[data-theme="light"] .status-chip.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

/* ============================================
   REAL-TIME NOTIFICATIONS
   ============================================ */

.notifications-dropdown {
    position: relative;
}

.notifications-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.notifications-btn:hover {
    background: var(--accent);
    color: white;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--error);
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.notifications-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    overflow: hidden;
}

.notifications-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.notifications-header {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h4 {
    font-size: 15px;
    font-weight: 600;
}

.mark-all-read {
    font-size: 13px;
    color: var(--accent);
    cursor: pointer;
}

.notifications-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    gap: 12px;
}

.notification-item:hover {
    background: var(--bg-tertiary);
}

.notification-item.unread {
    background: var(--accent-light);
}

.notification-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon.info { background: var(--accent-light); color: var(--accent); }
.notification-icon.success { background: rgba(34, 197, 94, 0.1); color: var(--success); }
.notification-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.notification-icon.error { background: rgba(239, 68, 68, 0.1); color: var(--error); }

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notification-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--accent);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.warning { border-left-color: var(--warning); }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* ============================================
   DRAG & DROP
   ============================================ */

.sortable-item {
    cursor: grab;
    transition: var(--transition);
}

.sortable-item:active {
    cursor: grabbing;
}

.sortable-item.dragging {
    opacity: 0.5;
    transform: scale(1.02);
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--accent-light) !important;
}

.sortable-chosen {
    background: var(--bg-tertiary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.drag-handle {
    cursor: grab;
    padding: 8px;
    color: var(--text-muted);
    transition: var(--transition);
}

.drag-handle:hover {
    color: var(--text-primary);
}

.drag-handle:active {
    cursor: grabbing;
}

/* ============================================
   ADDITIONAL UI COMPONENTS
   ============================================ */

/* Progress Bar */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--success));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 26px;
    transition: var(--transition);
    border: 1px solid var(--border);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
    border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    white-space: nowrap;
    border-radius: var(--radius);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 100;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}

[data-tooltip]:hover:before {
    opacity: 1;
    visibility: visible;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 5px 0;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Print Styles */
@media print {
    .sidebar,
    .mobile-header,
    .btn,
    .action-buttons {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* =========================================================
   Гостински портал — index.php за непријавени посетители
   Модерен информативен изглед врз базната тема на апликацијата
   ========================================================= */

.lp-body {
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(1200px 600px at 80% -10%, rgba(0, 136, 204, 0.14), transparent 60%),
        radial-gradient(900px 500px at 0% 10%, rgba(34, 197, 94, 0.08), transparent 55%),
        var(--bg-primary);
}

.lp-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.lp-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
}

.lp-orb-1 {
    width: 420px;
    height: 420px;
    top: -140px;
    right: -80px;
    background: rgba(0, 136, 204, 0.35);
    animation: lp-float 14s ease-in-out infinite;
}

.lp-orb-2 {
    width: 340px;
    height: 340px;
    bottom: -120px;
    left: -100px;
    background: rgba(34, 197, 94, 0.22);
    animation: lp-float 18s ease-in-out infinite reverse;
}

.lp-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 75%);
}

@keyframes lp-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, 32px, 0); }
}

.lp-nav,
.lp-main,
.lp-footer {
    position: relative;
    z-index: 1;
}

/* ---------------- Навигација ---------------- */
.lp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1160px;
    margin: 0 auto;
    padding: 20px 24px;
}

.lp-brand,
.lp-footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.lp-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, #22c55e 140%);
    box-shadow: 0 6px 18px -6px rgba(0, 136, 204, 0.7);
}

.lp-links {
    display: flex;
    gap: 26px;
}

.lp-links a {
    color: var(--text-secondary);
    font-size: 14.5px;
    font-weight: 500;
}

.lp-links a:hover {
    color: var(--text-primary);
}

.lp-nav-actions {
    display: flex;
    gap: 10px;
}

/* ---------------- Hero ---------------- */
.lp-main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

.lp-hero {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
    padding: 72px 0 56px;
    animation: lp-rise 0.6s ease both;
}

@keyframes lp-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.lp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
}

.lp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: lp-pulse 2s infinite;
}

@keyframes lp-pulse {
    70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.lp-hero h1 {
    margin: 20px 0 16px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
}

.lp-grad {
    background: linear-gradient(90deg, var(--accent) 0%, #22c55e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lp-lead {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 540px;
}

.lp-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.lp-hero-points {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 28px;
    list-style: none;
}

.lp-hero-points li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.lp-hero-points svg {
    color: var(--success);
}

/* Мок разговор */
.lp-hero-visual {
    display: flex;
    justify-content: center;
}

.lp-chat {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(180deg, rgba(30, 37, 46, 0.95), rgba(26, 31, 38, 0.95));
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    transform: rotate(1.2deg);
}

.lp-chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.lp-chat-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
}

.lp-chat-head strong {
    display: block;
    font-size: 14px;
}

.lp-chat-head small {
    color: var(--text-muted);
    font-size: 11.5px;
}

.lp-chat-status {
    margin-left: auto;
    font-size: 11px;
    color: var(--success);
    background: rgba(34, 197, 94, 0.12);
    padding: 3px 9px;
    border-radius: 999px;
}

.lp-chat-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 16px 22px;
}

.lp-bubble {
    max-width: 85%;
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    animation: lp-rise 0.5s ease both;
}

.lp-in {
    align-self: flex-start;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.lp-out {
    align-self: flex-end;
    background: rgba(0, 136, 204, 0.18);
    border: 1px solid rgba(0, 136, 204, 0.45);
    color: var(--text-primary);
    border-bottom-right-radius: 4px;
    animation-delay: 0.15s;
}

.lp-chips {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.lp-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.lp-chip-ok {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.lp-typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    align-self: flex-start;
    padding: 10px 13px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.lp-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: lp-blink 1.2s infinite;
}

.lp-typing span:nth-child(2) { animation-delay: 0.2s; }
.lp-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes lp-blink {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* ---------------- Бројки ---------------- */
.lp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 26px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border);
}

.lp-stat {
    text-align: center;
    padding: 6px 4px;
}

.lp-stat strong {
    display: block;
    font-size: clamp(26px, 3.4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #fff 0%, #9fd8f5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lp-stat span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---------------- Секции ---------------- */
.lp-section {
    padding: 72px 0 8px;
}

.lp-section-head {
    max-width: 640px;
    margin-bottom: 34px;
}

.lp-kicker {
    display: inline-block;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.lp-section-head h2 {
    font-size: clamp(26px, 3.4vw, 36px);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 800;
    margin-bottom: 10px;
}

.lp-section-head p {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Карактеристики */
.lp-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.lp-card {
    position: relative;
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.lp-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: 0 22px 40px -26px rgba(0, 0, 0, 0.95);
}

.lp-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.lp-ic-blue   { background: rgba(0, 136, 204, 0.16);  color: #38bdf8; }
.lp-ic-green  { background: rgba(34, 197, 94, 0.16);  color: #4ade80; }
.lp-ic-amber  { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.lp-ic-violet { background: rgba(139, 92, 246, 0.16); color: #a78bfa; }
.lp-ic-cyan   { background: rgba(6, 182, 212, 0.16);  color: #22d3ee; }
.lp-ic-rose   { background: rgba(244, 63, 94, 0.16);  color: #fb7185; }

.lp-card h3 {
    font-size: 16.5px;
    margin-bottom: 8px;
}

.lp-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* Ботови */
.lp-bots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.lp-bot {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.lp-bot:hover {
    border-color: rgba(0, 136, 204, 0.5);
}

.lp-bot-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--accent);
    background: var(--accent-light);
}

.lp-bot-info h3 {
    font-size: 15.5px;
    margin-bottom: 2px;
}

.lp-bot-handle {
    font-size: 13px;
    color: var(--accent);
    word-break: break-all;
}

.lp-bot-info p {
    margin-top: 8px;
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.lp-bot-live {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 11px;
    color: var(--success);
    background: rgba(34, 197, 94, 0.12);
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.lp-empty {
    padding: 26px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}

/* Чекори */
.lp-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    list-style: none;
    counter-reset: lp;
}

.lp-step {
    position: relative;
    padding: 26px 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
    border: 1px solid var(--border);
}

.lp-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #22c55e);
    margin-bottom: 16px;
}

.lp-step h3 {
    font-size: 16.5px;
    margin-bottom: 8px;
}

.lp-step p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* CTA */
.lp-cta {
    margin-top: 72px;
}

.lp-cta-inner {
    position: relative;
    overflow: hidden;
    text-align: center;
    padding: 54px 28px;
    border-radius: 20px;
    background:
        radial-gradient(600px 200px at 50% 0%, rgba(0, 136, 204, 0.35), transparent 70%),
        var(--bg-card);
    border: 1px solid var(--border-light);
}

.lp-cta-inner h2 {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.lp-cta-inner p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ---------------- Подножje ---------------- */
.lp-footer {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding: 28px 24px 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1160px;
    margin-left: auto;
    margin-right: auto;
}

.lp-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.lp-footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
}

.lp-footer-links a:hover {
    color: var(--text-primary);
}

.lp-footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}

/* ---------------- Прилагодување ---------------- */
@media (max-width: 960px) {
    .lp-hero {
        grid-template-columns: 1fr;
        gap: 36px;
        padding-top: 44px;
    }

    .lp-hero-visual { order: 2; }
    .lp-features,
    .lp-bots,
    .lp-steps { grid-template-columns: repeat(2, 1fr); }
    .lp-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .lp-links { display: none; }
    .lp-nav-actions .btn-secondary { display: none; }

    .lp-features,
    .lp-bots,
    .lp-steps { grid-template-columns: 1fr; }

    .lp-chat { transform: none; }

    .lp-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

.lp-bot-off {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

/* =========================================================
   Известување за реновирање — се прикажува врз гостинскиот
   портал додека страницата е во сервисирање/реновирање
   ========================================================= */

.lp-notice {
    position: relative;
    z-index: 5;
    width: 100%;
    background: rgba(59, 130, 246, 0.14);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(6px);
}

.lp-notice-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 11px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    text-align: center;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.lp-notice-icon {
    font-size: 16px;
    line-height: 1;
}

.lp-notice-text {
    margin: 0;
}

.lp-notice-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.lp-notice-when {
    color: var(--accent);
    font-weight: 500;
}

.lp-notice-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-primary);
    white-space: nowrap;
}

@media (max-width: 720px) {
    .lp-notice-inner {
        font-size: 13px;
        padding: 10px 18px;
    }

    .lp-notice-url {
        white-space: normal;
        word-break: break-all;
    }
}

/* =========================================================
   Футер на админ панелот — го затвора централниот дел
   ========================================================= */

.admin-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 40px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-muted);
}

.admin-footer-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-footer-sep {
    opacity: .55;
}

.admin-footer-url {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.admin-footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.admin-footer-links a:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .admin-footer {
        justify-content: center;
        text-align: center;
    }

    .admin-footer-links {
        justify-content: center;
    }
}

/* =========================================================
   Известување „во изградба“ — фази и затворање
   ========================================================= */

.lp-notice-build {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.14), rgba(34, 211, 238, 0.12));
    border-bottom: 1px solid var(--accent);
}

.lp-notice-build .lp-notice-inner {
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
    gap: 14px;
    padding: 14px 24px;
}

.lp-notice-body {
    flex: 1 1 320px;
    min-width: 0;
}

.lp-notice-title {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.lp-notice-build .lp-notice-text {
    margin: 0;
    max-width: 62ch;
}

.lp-notice-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.lp-phase {
    font-size: 11.5px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.lp-phase.is-done {
    color: var(--success);
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(52, 211, 153, 0.10);
}

.lp-phase.is-active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-light);
}

.lp-notice-close {
    margin-left: auto;
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    transition: var(--transition);
}

.lp-notice-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
}

@media (max-width: 720px) {
    .lp-notice-build .lp-notice-inner {
        padding: 12px 16px;
    }

    .lp-notice-build .lp-notice-url {
        display: none;
    }
}

/* =========================================================
   Табови и под-табови — чиста, читлива организација
   ========================================================= */

.tabs-nav::-webkit-scrollbar {
    height: 6px;
}

.tabs-nav::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 6px;
}

.tab-btn.active {
    box-shadow: inset 0 -2px 0 var(--accent);
}

.tab-btn .badge {
    margin-left: 2px;
}

@media (max-width: 720px) {
    .tabs-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .tab-btn {
        white-space: nowrap;
    }
}
/* =========================================================
   Портални блокови на почетната (гости): панел во херојот,
   табови и филтри за радио ресурси, квиз и команди
   ========================================================= */

/* --- Панел во херојот --- */
.lp-panel {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, rgba(30, 37, 46, 0.96), rgba(26, 31, 38, 0.96));
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
}

[data-theme="paper"] .lp-panel {
    background: #fff;
}

.lp-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.lp-panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--accent);
    background: var(--accent-light);
}

.lp-panel-head strong {
    display: block;
    font-size: 14px;
}

.lp-panel-head small {
    color: var(--text-muted);
    font-size: 11.5px;
}

.lp-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
}

.lp-panel-tile {
    padding: 14px 10px;
    text-align: center;
    background: var(--bg-card);
}

.lp-panel-tile strong {
    display: block;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.lp-panel-tile span {
    font-size: 11.5px;
    color: var(--text-muted);
}

.lp-panel-list {
    list-style: none;
    padding: 8px 16px;
}

.lp-panel-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 13px;
}

.lp-panel-list li:last-child {
    border-bottom: none;
}

.lp-panel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    flex-shrink: 0;
}

.lp-panel-name {
    font-weight: 600;
}

.lp-panel-freq {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
    font-size: 12.5px;
}

.lp-panel-foot {
    padding: 10px 16px 14px;
    font-size: 11.5px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

.lp-panel-foot code {
    color: var(--text-secondary);
}

/* --- Бројки во секција (радио) --- */
.lp-statrow {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.lp-statrow .lp-stat {
    padding: 16px 10px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-align: center;
}

.lp-statrow .lp-stat strong {
    display: block;
    font-size: 24px;
    font-weight: 800;
}

.lp-statrow .lp-stat span {
    font-size: 12.5px;
    color: var(--text-muted);
}

/* --- Портал: табови, пребарување, табели --- */
.lp-portal {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    overflow: hidden;
}

.lp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.lp-tabs {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 10px;
}

.lp-tab {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.lp-tab span {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
}

.lp-tab:hover {
    color: var(--text-primary);
}

.lp-tab.is-on {
    background: var(--accent);
    color: #fff;
}

.lp-tab.is-on span {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.lp-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 220px;
    max-width: 360px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.lp-search input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

.lp-chips {
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.lp-chips .lp-chip {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    padding: 5px 11px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.lp-chips .lp-chip span {
    color: var(--text-muted);
    font-size: 11px;
}

.lp-chips .lp-chip:hover {
    color: var(--text-primary);
    border-color: var(--border-light);
}

.lp-chips .lp-chip.is-on {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.lp-table-wrap {
    padding: 4px 4px 0;
    overflow-x: auto;
}

.lp-pane {
    display: none;
}

.lp-pane.is-on {
    display: block;
}

.lp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.lp-table th {
    text-align: left;
    padding: 11px 14px;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.lp-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.lp-table tbody tr:last-child td {
    border-bottom: none;
}

.lp-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.lp-mono {
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
}

.lp-badge-band {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--accent);
    background: var(--accent-light);
}

.lp-note {
    padding: 12px 16px 16px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.lp-note code {
    color: var(--text-secondary);
}

.lp-table-empty {
    margin: 12px;
}

/* --- Ботови: копче до Telegram --- */
.lp-bot-open {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
}

.lp-bot-open:hover {
    text-decoration: underline;
}

/* --- Квиз --- */
.lp-quiz-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
    align-items: start;
}

.lp-quiz-side {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.lp-quiz-num strong {
    display: block;
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    background: linear-gradient(90deg, var(--accent), #22c55e);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lp-quiz-num span {
    font-size: 12.5px;
    color: var(--text-muted);
}

.lp-quiz-meta {
    list-style: none;
    margin: 18px 0;
    border-top: 1px solid var(--border);
}

.lp-quiz-meta li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
}

.lp-quiz-meta strong {
    color: var(--text-primary);
}

.lp-quiz-side .btn {
    width: 100%;
    justify-content: center;
}

.lp-quiz-card {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.lp-quiz-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.lp-quiz-q {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 18px;
}

.lp-quiz-options {
    display: grid;
    gap: 9px;
}

.lp-quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.lp-quiz-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-light);
}

.lp-quiz-option:disabled {
    cursor: default;
}

.lp-quiz-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.lp-quiz-option.is-correct {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.12);
}

.lp-quiz-option.is-correct .lp-quiz-letter {
    background: var(--success);
    color: #fff;
}

.lp-quiz-option.is-wrong {
    border-color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
}

.lp-quiz-result {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.lp-quiz-verdict {
    font-size: 14px;
}

.lp-quiz-verdict.is-ok { color: var(--success); }
.lp-quiz-verdict.is-bad { color: #f43f5e; }

.lp-quiz-result p {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Команди --- */
.lp-commands {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.lp-command {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 13.5px;
}

.lp-command code {
    flex-shrink: 0;
    min-width: 96px;
    color: var(--accent);
    font-weight: 600;
}

.lp-command span {
    color: var(--text-secondary);
}

/* --- Одзивност на порталните блокови --- */
@media (max-width: 992px) {
    .lp-hero-visual { order: 2; }
    .lp-statrow { grid-template-columns: repeat(2, 1fr); }
    .lp-quiz-grid { grid-template-columns: 1fr; }
    .lp-commands { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .lp-stats,
    .lp-statrow { grid-template-columns: repeat(2, 1fr); }
    .lp-toolbar { flex-direction: column; align-items: stretch; }
    .lp-search { max-width: none; }
    .lp-tabs { width: 100%; }
    .lp-tab { flex: 1; justify-content: center; padding: 8px 6px; }
    .lp-panel-grid { grid-template-columns: 1fr; }
    .lp-panel-list li { font-size: 12.5px; }
}
/* =========================================================
   Z3 TERMINAL THEME — портална почетна
   Хедер · херој со спектар · три колони · табели · футер
   ========================================================= */

.tp-body {
    background:
        radial-gradient(1100px 520px at 12% -10%, rgba(0, 136, 204, 0.16), transparent 60%),
        radial-gradient(900px 480px at 92% 4%, rgba(34, 197, 94, 0.10), transparent 62%),
        var(--bg-primary);
}

.tp-scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px);
    opacity: 0.5;
    z-index: 0;
}

.tp-wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 22px;
}

.tp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
    animation: tp-pulse 2.4s infinite;
    display: inline-block;
}

@keyframes tp-pulse {
    70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* ---------------- BUTTONS ---------------- */
.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tp-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    box-shadow: 0 12px 30px -16px rgba(0, 136, 204, 1);
}

.tp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px -18px rgba(0, 136, 204, 1);
}

.tp-btn-ghost {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border);
}

[data-theme="paper"] .tp-btn-ghost { background: #fff; }

.tp-btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tp-btn-sm { padding: 8px 14px; font-size: 13px; }
.tp-btn-block { width: 100%; margin-top: 14px; }

/* ---------------- HERO ---------------- */
.tp-main { position: relative; z-index: 1; }

.tp-hero {
    position: relative;
    padding: 56px 0 8px;
    overflow: hidden;
}

.tp-hero::before,
.tp-hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
}

.tp-hero::before {
    width: 460px;
    height: 460px;
    left: -160px;
    top: -120px;
    background: rgba(0, 136, 204, 0.22);
}

.tp-hero::after {
    width: 380px;
    height: 380px;
    right: -120px;
    top: 40px;
    background: rgba(34, 197, 94, 0.16);
}

.tp-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 42px;
    align-items: center;
    padding-bottom: 34px;
}

.tp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.035);
}

.tp-hero h1 {
    margin: 20px 0 16px;
    font-size: clamp(36px, 4.6vw, 58px);
    line-height: 1.06;
    letter-spacing: -0.03em;
    font-weight: 800;
}

.tp-grad {
    background: linear-gradient(92deg, var(--accent) 0%, #22d3ee 48%, #22c55e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tp-lead {
    font-size: 16.5px;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 560px;
}

.tp-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.tp-hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin-top: 30px;
}

.tp-hero-facts li {
    min-width: 104px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.tp-hero-facts strong {
    display: block;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.tp-hero-facts span {
    font-size: 11.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Хероj карта */
.tp-hero-card {
    position: relative;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(24, 32, 41, 0.94), rgba(15, 21, 28, 0.98));
    box-shadow: 0 34px 70px -40px rgba(0, 0, 0, 0.95);
    overflow: hidden;
}

[data-theme="paper"] .tp-hero-card {
    background: #fff;
}

.tp-hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 18px;
    padding: 1px;
    background: linear-gradient(140deg, rgba(0, 136, 204, 0.55), transparent 42%, rgba(34, 197, 94, 0.4));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.tp-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.tp-card-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.tp-card-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.1);
    padding: 3px 8px;
    border-radius: 999px;
}

.tp-spectrum {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 74px;
    padding: 14px 18px 10px;
}

.tp-spectrum span {
    flex: 1;
    border-radius: 3px 3px 1px 1px;
    background: linear-gradient(180deg, #22d3ee, rgba(0, 136, 204, 0.25));
    transform-origin: bottom;
    animation: tp-eq 1.9s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * -0.13s);
    opacity: 0.85;
}

.tp-spectrum span:nth-child(3n) { height: 62%; background: linear-gradient(180deg, #22c55e, rgba(34, 197, 94, 0.2)); }
.tp-spectrum span:nth-child(3n+1) { height: 38%; }
.tp-spectrum span:nth-child(4n) { height: 86%; }
.tp-spectrum span:nth-child(5n+2) { height: 22%; }

@keyframes tp-eq {
    from { transform: scaleY(0.35); }
    to { transform: scaleY(1); }
}

.tp-card-tiles {
    display: flex;
    gap: 1px;
    background: var(--border);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.tp-card-tile {
    flex: 1;
    min-width: 0;
    padding: 14px 12px;
    text-align: center;
    background: rgba(20, 27, 35, 0.9);
}

[data-theme="paper"] .tp-card-tile { background: #f8fafc; }

.tp-card-tile strong {
    display: block;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.tp-card-tile span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tp-card-list {
    list-style: none;
    padding: 8px 18px;
}

.tp-card-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 12.5px;
}

.tp-card-list li:last-child { border-bottom: none; }

.tp-card-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
    flex-shrink: 0;
}

.tp-card-name { font-weight: 600; }

.tp-card-freq {
    margin-left: auto;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

.tp-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 18px 14px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-muted);
}

.tp-card-foot code { color: var(--text-secondary); }

/* ---------------- TICKER ---------------- */
.tp-ticker {
    position: relative;
    overflow: hidden;
    margin-top: 6px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.025);
}

.tp-ticker::before,
.tp-ticker::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 90px;
    z-index: 2;
    pointer-events: none;
}

.tp-ticker::before { left: 0; background: linear-gradient(90deg, var(--bg-primary), transparent); }
.tp-ticker::after { right: 0; background: linear-gradient(270deg, var(--bg-primary), transparent); }

.tp-ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 34px;
    padding: 11px 0;
    white-space: nowrap;
    animation: tp-marquee 40s linear infinite;
    will-change: transform;
}

.tp-ticker:hover .tp-ticker-track { animation-play-state: paused; }

@keyframes tp-marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

.tp-tick {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.tp-tick-k {
    color: var(--accent);
    font-weight: 700;
    margin-right: 6px;
    font-variant-numeric: tabular-nums;
}

/* ---------------- STATS ---------------- */
.tp-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 26px;
}

.tp-stat {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: var(--transition);
}

.tp-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 136, 204, 0.45);
}

.tp-stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    flex-shrink: 0;
}

.tp-ic-blue   { background: rgba(0, 136, 204, 0.16);  color: #38bdf8; }
.tp-ic-green  { background: rgba(34, 197, 94, 0.16);  color: #4ade80; }
.tp-ic-amber  { background: rgba(245, 158, 11, 0.16); color: #fbbf24; }
.tp-ic-violet { background: rgba(139, 92, 246, 0.16); color: #a78bfa; }

.tp-stat strong {
    display: block;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.tp-stat span {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ---------------- SECTION BAR (втора навигација) ---------------- */
.tp-sectionbar {
    border-top: 1px solid var(--border);
    background: rgba(10, 15, 30, 0.6);
}
.tp-sectionbar-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-top: 9px;
    padding-bottom: 9px;
}
.tp-sectionbar-inner::-webkit-scrollbar { display: none; }
.tp-sectionbar-label {
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-right: 4px;
    white-space: nowrap;
}
.tp-sectionbar a {
    font-size: 12.5px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
    transition: var(--transition);
}
.tp-sectionbar a:hover { color: var(--text); border-color: var(--border); }
.tp-sectionbar a.is-on {
    color: var(--text);
    border-color: rgba(0, 136, 204, 0.42);
    background: rgba(0, 136, 204, 0.14);
}
.tp-sectionbar-cta {
    margin-left: auto;
    color: var(--primary) !important;
    font-weight: 600;
}

/* ---------------- THREE COLUMN LAYOUT ---------------- */
.tp-layout {
    display: grid;
    grid-template-columns: 246px minmax(0, 1fr) 344px;
    gap: 18px;
    align-items: start;
    margin-top: 26px;
}

/* Колоните што ги нема (сите панели исклучени или преместени) не држат место. */
.tp-layout.is-no-left { grid-template-columns: minmax(0, 1fr) 344px; }
.tp-layout.is-no-right { grid-template-columns: 246px minmax(0, 1fr); }
.tp-layout.is-no-left.is-no-right { grid-template-columns: minmax(0, 1fr); }

.tp-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-main-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.tp-panel {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 16px;
    transition: var(--transition);
}

.tp-panel:hover { border-color: rgba(0, 136, 204, 0.32); }

.tp-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.tp-panel-title span {
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--accent), #22c55e);
}

.tp-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tp-menu a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 9px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
}

.tp-menu a svg { color: var(--text-muted); flex-shrink: 0; }

.tp-menu a b {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    padding: 2px 7px;
}

.tp-menu a:hover {
    background: rgba(0, 136, 204, 0.1);
    color: var(--text-primary);
}

.tp-menu a:hover svg { color: var(--accent); }

.tp-bands {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.tp-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.tp-band b { color: var(--text-muted); font-size: 11px; }

.tp-band:hover { border-color: var(--border-light); color: var(--text-primary); }

.tp-band.is-on {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.tp-band.is-on b { color: var(--accent); }

.tp-panel-accent {
    background: linear-gradient(180deg, rgba(0, 136, 204, 0.1), rgba(34, 197, 94, 0.05));
    border-color: rgba(0, 136, 204, 0.24);
}

.tp-cmds {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tp-cmds code {
    font-size: 11.5px;
    padding: 4px 8px;
    border-radius: 7px;
    color: var(--accent);
    background: rgba(0, 136, 204, 0.1);
    border: 1px solid rgba(0, 136, 204, 0.22);
}

/* ---------------- TABLE BLOCK ---------------- */
.tp-panel-table {
    padding: 0;
    overflow: hidden;
}

.tp-table-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 14px;
    border-bottom: 1px solid var(--border);
}

.tp-kicker {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 5px;
}

.tp-table-head h2,
.tp-block-head h2,
.tp-section-head h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.tp-search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 240px;
    flex: 1;
    max-width: 320px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
}

.tp-search input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
}

.tp-tabs {
    display: flex;
    gap: 2px;
    padding: 0 18px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.tp-tab {
    position: relative;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 12px 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: var(--transition);
}

.tp-tab span {
    font-size: 10.5px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.tp-tab:hover { color: var(--text-primary); }

.tp-tab.is-on { color: var(--accent); }

.tp-tab.is-on::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), #22c55e);
}

.tp-tab.is-on span {
    background: var(--accent-light);
    color: var(--accent);
}

.tp-table-wrap { overflow-x: auto; }

.tp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tp-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.tp-table td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.tp-table tbody tr:last-child td { border-bottom: none; }

.tp-table tbody tr { transition: background 0.15s ease; }

.tp-table tbody tr:hover { background: rgba(0, 136, 204, 0.07); }

.tp-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid rgba(0, 136, 204, 0.25);
}

.tp-table-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-muted);
}

.tp-table-foot code {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 6px;
    border-radius: 5px;
}

.tp-empty {
    padding: 26px 18px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.tp-panel-empty { padding: 26px; }

.tp-panel-empty h2 { font-size: 22px; margin-bottom: 8px; }

.tp-panel-empty p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.65;
    max-width: 520px;
}

.tp-empty-actions { margin-top: 16px; }

/* ---------------- BLOCK HEAD / BOTS ---------------- */
.tp-block-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.tp-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-light);
    border: 1px solid rgba(0, 136, 204, 0.25);
    border-radius: 999px;
    padding: 3px 9px;
    font-variant-numeric: tabular-nums;
}

.tp-bots {
    display: grid;
    grid-template-columns: 1fr;
    gap: 9px;
}

.tp-bot {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: start;
    gap: 11px;
    padding: 13px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
}

.tp-bot:hover {
    border-color: rgba(0, 136, 204, 0.45);
    transform: translateY(-2px);
}

.tp-bot-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: var(--accent);
    background: var(--accent-light);
}

.tp-bot-info h3 {
    font-size: 13.5px;
    line-height: 1.3;
    margin-bottom: 1px;
}

.tp-bot-handle {
    font-size: 11.5px;
    color: var(--accent);
    word-break: break-all;
}

.tp-bot-info p {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

.tp-bot-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.tp-bot-link:hover {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.tp-bot-state {
    position: absolute;
    right: 48px;
    top: 12px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--success);
}

.tp-bot-state.is-off { color: var(--text-muted); }

/* ---------------- QUIZ PANEL ---------------- */
.tp-quiz-panel { padding: 16px; }

.tp-quiz-stats {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 14px;
}

.tp-quiz-stats li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 10px;
    background: var(--bg-card);
    font-size: 11.5px;
    color: var(--text-muted);
}

.tp-quiz-stats strong {
    color: var(--text-primary);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.tp-quiz-card {
    padding: 13px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.tp-quiz-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.tp-quiz-head .tp-kicker { margin: 0; }

.tp-quiz-q {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 12px;
}

.tp-quiz-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tp-quiz-option {
    gap: 9px;
    padding: 9px 10px;
    font-size: 12px;
    border-radius: 8px;
}

.tp-quiz-option .lp-quiz-letter {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 10.5px;
}

.tp-quiz-panel .lp-quiz-result { margin-top: 11px; padding-top: 10px; }
.tp-quiz-panel .lp-quiz-verdict { font-size: 12px; }
.tp-quiz-panel .lp-quiz-result p { font-size: 11.5px; }

.tp-quick-bots {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.tp-quick-bots li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--text-muted);
}

.tp-quick-bots a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
}

.tp-quick-bots a:hover { color: var(--accent); }

.tp-quick-bots li > span:last-child {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    word-break: break-all;
}

/* ---------------- SECTIONS / COMMANDS ---------------- */
.tp-section { margin-top: 44px; }

.tp-section-head {
    max-width: 620px;
    margin-bottom: 20px;
}

.tp-section-head p {
    margin-top: 7px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.tp-command-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
}

.tp-command {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 13px;
    transition: var(--transition);
}

.tp-command:hover {
    border-color: rgba(0, 136, 204, 0.4);
    transform: translateX(2px);
}

.tp-command code {
    flex-shrink: 0;
    min-width: 92px;
    color: var(--accent);
    font-weight: 700;
    font-size: 12.5px;
}

.tp-command span { color: var(--text-secondary); }

.tp-command-grid > .tp-command:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Анкори да не се кријат под лепливиот хедер */
#radio, #bots, #quiz, #commands { scroll-margin-top: 96px; }

/* ---------------- CTA ---------------- */
.tp-cta { margin-top: 44px; }

.tp-cta-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 30px 32px;
    border-radius: 18px;
    border: 1px solid rgba(0, 136, 204, 0.28);
    background:
        radial-gradient(600px 200px at 10% 0%, rgba(0, 136, 204, 0.18), transparent 70%),
        linear-gradient(120deg, rgba(34, 197, 94, 0.08), transparent 60%),
        var(--bg-card);
}

.tp-cta-inner h2 {
    font-size: clamp(21px, 2.6vw, 28px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.tp-cta-inner p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1140px) {
    .tp-layout,
    .tp-layout.is-no-left,
    .tp-layout.is-no-right,
    .tp-layout.is-no-left.is-no-right {
        grid-template-columns: 222px minmax(0, 1fr);
        grid-template-areas:
            "left main"
            "right right";
    }
    .tp-layout.is-no-left { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "right"; }
    .tp-side-left { grid-area: left; }
    .tp-main-col { grid-area: main; }
    .tp-side-right {
        grid-area: right;
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

@media (max-width: 860px) {

    .tp-hero { padding-top: 36px; }
    .tp-hero-grid {
        grid-template-columns: 1fr;
        gap: 26px;
    }
    .tp-stats { grid-template-columns: 1fr 1fr; }
    .tp-layout,
    .tp-layout.is-no-left,
    .tp-layout.is-no-right,
    .tp-layout.is-no-left.is-no-right {
        grid-template-columns: 1fr;
        grid-template-areas:
            "main"
            "left"
            "right";
    }
    .tp-side-left {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
    .tp-side-right { grid-template-columns: 1fr; }
    .tp-command-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .tp-wrap { padding: 0 15px; }
    .tp-hero h1 { font-size: 32px; }
    .tp-hero-facts li { flex: 1; min-width: 0; }
    .tp-card-tile strong { font-size: 19px; }
    .tp-tabs { padding: 0 10px; }
    .tp-table-head { padding: 15px; }
    .tp-search { max-width: none; min-width: 0; width: 100%; }
    .tp-side-left { grid-template-columns: 1fr; }
    .tp-stats { grid-template-columns: 1fr 1fr; gap: 9px; }
    .tp-stat { padding: 12px; gap: 9px; }
    .tp-stat strong { font-size: 18px; }
    .tp-bots { grid-template-columns: 1fr; }
    .tp-cta-inner { padding: 22px; }
}

/* =========================================================
   Брзи акции — картички во блокови (админ и почетна)
   ========================================================= */

.quick-actions {
    margin-bottom: 24px;
}

.quick-actions-inner {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    color: var(--text-primary);
}

.quick-actions-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.quick-actions-title svg {
    color: var(--accent);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 12px;
}

.quick-action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.quick-action-card:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-action-icon.blue   { background: rgba(0, 136, 204, 0.12); color: var(--accent); }
.quick-action-icon.green  { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.quick-action-icon.orange { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.quick-action-icon.purple { background: rgba(168, 85, 247, 0.14); color: #a855f7; }

.quick-action-icon svg {
    width: 22px;
    height: 22px;
}

.quick-action-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.quick-action-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-action-desc {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Групирани блокови: Управување / Комуникација / Систем */
.qa-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.qa-block {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.qa-block-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.qa-block-head svg {
    width: 15px;
    height: 15px;
    color: var(--accent);
}

.qa-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.qa-link:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    transform: translateX(2px);
}

.qa-link-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.qa-link-ico svg {
    width: 18px;
    height: 18px;
}

.qa-link-txt {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.qa-link-txt strong {
    font-size: 13px;
    font-weight: 600;
}

.qa-link-txt span {
    font-size: 11.5px;
    color: var(--text-muted);
}

.qa-chev {
    flex-shrink: 0;
    color: var(--text-muted);
    opacity: 0.7;
}

.qa-chev svg {
    width: 15px;
    height: 15px;
}

@media (max-width: 640px) {
    .qa-blocks { grid-template-columns: 1fr; }
    .quick-actions-inner { padding: 15px; }
    .quick-actions-grid { grid-template-columns: 1fr; }
}

/* Во тесната десна колона на почетната, блоковите се редат вертикално
   без вгнездени рамки — само тенка линија меѓу групите. */
.quick-actions-inner .qa-blocks {
    grid-template-columns: 1fr;
    gap: 0;
}

.quick-actions-inner .qa-block {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
}

.quick-actions-inner .qa-block + .qa-block {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
