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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background-color: #0a0a0a;
    color: #ffffff;
    min-height: 100vh;
}

.view {
    display: none !important;
}

.view.active {
    display: block !important;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #0a0a0a;
}

.login-box {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
}

.login-subtitle {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 32px;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
    text-align: center;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #999;
    font-weight: 500;
    font-size: 13px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 14px;
    background: #1a1a1a;
    color: #fff;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #444;
    background: #1f1f1f;
}

.form-group input::placeholder {
    color: #555;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #e5e5e5;
}

.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    color: #999;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #1a1a1a;
    color: #fff;
    border-color: #444;
}

.admin-container {
    display: flex;
    min-height: 100vh;
    background: #0a0a0a;
}

.sidebar {
    width: 200px;
    background: #0f0f0f;
    border-right: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid #1a1a1a;
}

.sidebar-brand h1 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.sidebar-brand span {
    font-size: 11px;
    color: #555;
    display: block;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 20px;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.nav-btn:hover {
    background: #141414;
    color: #999;
}

.nav-btn.active {
    background: #141414;
    color: #fff;
    border-left-color: #fff;
}

.nav-btn svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.nav-btn.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #1a1a1a;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.user-role {
    font-size: 11px;
    color: #555;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    background: none;
    border: none;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    padding: 4px 0;
    transition: color 0.15s;
}

.sidebar-link:hover {
    color: #999;
}

.main-content {
    flex: 1;
    margin-left: 200px;
    min-height: 100vh;
}

.page-header {
    padding: 32px 40px 24px;
    border-bottom: 1px solid #1a1a1a;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.page-header p {
    font-size: 13px;
    color: #555;
}

.admin-content {
    padding: 32px 40px;
}

.admin-page {
    display: none;
}

.admin-page.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-box {
    background: #141414;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
    padding: 20px 24px;
}

.stat-box h3 {
    color: #555;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    color: #fff;
    font-size: 28px;
    font-weight: 600;
}

.content-box {
    background: #141414;
    border: 1px solid #1f1f1f;
    border-radius: 8px;
    margin-bottom: 24px;
    overflow: hidden;
}

.content-box-header {
    padding: 20px 24px;
    border-bottom: 1px solid #1f1f1f;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-box-header h2 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.content-box h2 {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
}

.content-box-body {
    padding: 0;
}

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

.sessions-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 11px;
    font-weight: 500;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #1f1f1f;
    background: #111;
}

.sessions-table td {
    padding: 16px 20px;
    font-size: 13px;
    color: #999;
    border-bottom: 1px solid #1a1a1a;
    vertical-align: middle;
}

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

.sessions-table tr:hover td {
    background: #181818;
}

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

.session-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
}

.session-dot.active {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.session-id {
    color: #fff;
    font-weight: 500;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge.offline {
    background: #262626;
    color: #666;
}

.status-badge.inactive {
    background: #262626;
    color: #666;
}

.device-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
}

.device-info svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.location-icon {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.service-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #1a1a1a;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
}

.service-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}

.page-badge {
    color: #666;
    font-size: 12px;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.action-btn:hover {
    background: #262626;
    color: #fff;
}

.action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

.empty-state {
    color: #444;
    text-align: center;
    padding: 60px 40px;
    font-size: 13px;
}

.antibot-settings {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #fff;
    font-size: 14px;
}

.setting-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #fff;
}

.setting-desc {
    font-size: 12px;
    color: #555;
    margin-left: 30px;
}

.setting-item select {
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 8px;
    font-size: 14px;
    background: #1a1a1a;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    max-width: 400px;
}

.setting-item select:focus {
    outline: none;
    border-color: #444;
}

#saveAntibotBtn,
#saveSettingsBtn {
    max-width: 160px;
    margin-top: 8px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #141414;
    border: 1px solid #262626;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-header h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #555;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s;
    line-height: 1;
}

.modal-close:hover {
    background: #262626;
    color: #fff;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #262626;
    padding: 0 24px;
    gap: 0;
}

.modal-tab {
    padding: 14px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    top: 1px;
}

.modal-tab:hover {
    color: #999;
}

.modal-tab.active {
    color: #fff;
    border-bottom-color: #fff;
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.focus-section {
    margin-bottom: 28px;
}

.focus-section:last-child {
    margin-bottom: 0;
}

.focus-section h3 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #262626;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-item label {
    color: #555;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #fff;
    font-size: 13px;
    word-break: break-all;
    padding: 10px 14px;
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 6px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.data-container {
    background: #1a1a1a;
    border: 1px solid #262626;
    border-radius: 6px;
    padding: 16px;
}

.data-preview {
    margin: 0;
    color: #999;
    font-size: 12px;
    font-family: 'SF Mono', 'Consolas', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 250px;
    overflow-y: auto;
    line-height: 1.6;
}

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

.modal-footer .btn-secondary {
    background: rgba(239, 68, 68, 0.1);
    border-color: transparent;
    color: #ef4444;
}

.modal-footer .btn-secondary:hover {
    background: rgba(239, 68, 68, 0.2);
}

.modal-footer .btn-primary {
    width: auto;
    padding: 10px 20px;
}

.redirect-control {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.redirect-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.redirect-input-group label {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.redirect-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #333;
    border-radius: 6px;
    font-size: 14px;
    background: #1a1a1a;
    color: #fff;
    transition: all 0.2s;
}

.redirect-input:focus {
    outline: none;
    border-color: #444;
}

.redirect-hint {
    color: #555;
    font-size: 12px;
    margin: 0;
}

.redirect-status {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    display: none;
}

.redirect-status.success {
    display: block;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.redirect-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.delete-all-btn {
    padding: 8px 14px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.delete-all-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

.add-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #262626;
    border: none;
    color: #888;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
    font-size: 18px;
}

.add-btn:hover {
    background: #333;
    color: #fff;
}

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

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .page-header,
    .admin-content {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .sessions-table {
        display: block;
        overflow-x: auto;
    }

    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        margin: 10px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}
