/* ============================================
   RADIUS Manager - MikroTik
   ============================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f23;
    color: #e0e0e0;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d1b69 100%);
    padding: 20px 40px;
    border-bottom: 2px solid #6c63ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.3);
}

.header h1 {
    font-size: 24px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 .icon {
    font-size: 28px;
}

.header-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.header-stat {
    background: rgba(255,255,255,0.1);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
}

.header-stat span {
    color: #6c63ff;
    font-weight: bold;
    font-size: 16px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 40px;
}

/* Alert Messages */
.alert {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

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

.alert-success {
    background: rgba(46, 204, 113, 0.15);
    border-color: #2ecc71;
    color: #2ecc71;
}

.alert-danger {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
    color: #e74c3c;
}

.alert-warning {
    background: rgba(241, 196, 15, 0.15);
    border-color: #f1c40f;
    color: #f1c40f;
}

.alert-info {
    background: rgba(52, 152, 219, 0.15);
    border-color: #3498db;
    color: #3498db;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

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

.search-box input {
    background: #1a1a3e;
    border: 1px solid #333;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    width: 300px;
    transition: border-color 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.search-box button {
    padding: 10px 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.btn-primary {
    background: linear-gradient(135deg, #6c63ff, #5a52d5);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c74ff, #6c63ff);
}

.btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #3ddc84, #2ecc71);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff6b6b, #e74c3c);
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: #fff;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.btn-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}

.btn-info:hover {
    background: linear-gradient(135deg, #5dade2, #3498db);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #6c63ff;
    color: #6c63ff;
}

.btn-outline:hover {
    background: #6c63ff;
    color: #fff;
}

/* Table */
.table-wrapper {
    background: #1a1a3e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid #2a2a5a;
}

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

thead {
    background: linear-gradient(135deg, #2d1b69, #1a1a3e);
}

th {
    padding: 14px 18px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #8b8baf;
    border-bottom: 2px solid #6c63ff;
    font-weight: 700;
}

td {
    padding: 12px 18px;
    border-bottom: 1px solid #2a2a4a;
    font-size: 14px;
    vertical-align: middle;
}

tbody tr {
    transition: background 0.2s;
}

tbody tr:hover {
    background: rgba(108, 99, 255, 0.08);
}

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

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-check {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.badge-reply {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.badge-user {
    background: rgba(108, 99, 255, 0.2);
    color: #6c63ff;
    border: 1px solid rgba(108, 99, 255, 0.3);
}

.badge-online {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
}

.badge-offline {
    background: rgba(149, 165, 166, 0.2);
    color: #95a5a6;
}

/* Code / Value Display */
.code-value {
    background: #0f0f23;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    color: #f39c12;
    border: 1px solid #333;
}

.attr-name {
    color: #6c63ff;
    font-weight: 600;
}

.op-symbol {
    color: #e74c3c;
    font-weight: bold;
    font-family: 'Fira Code', monospace;
    font-size: 15px;
}

/* Forms */
.form-card {
    background: #1a1a3e;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid #2a2a5a;
    max-width: 700px;
    margin: 0 auto;
}

.form-card h2 {
    margin-bottom: 25px;
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2a2a5a;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #8b8baf;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6c63ff;
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.form-group select {
    cursor: pointer;
}

.form-group select option {
    background: #1a1a3e;
    color: #fff;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #2a2a5a;
}

.form-help {
    font-size: 11px;
    color: #666;
    margin-top: 4px;
}

/* User Detail Card */
.user-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.detail-section {
    background: #1a1a3e;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #2a2a5a;
}

.detail-section h3 {
    margin-bottom: 15px;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2a5a;
}

.detail-section .table-wrapper {
    box-shadow: none;
    border: none;
    background: transparent;
}

.detail-section table {
    background: #0f0f23;
    border-radius: 8px;
    overflow: hidden;
}

/* User Info Header */
.user-header {
    background: linear-gradient(135deg, #1a1a3e, #2d1b69);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #2a2a5a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-header-info h2 {
    color: #fff;
    font-size: 24px;
    margin-bottom: 5px;
}

.user-header-info p {
    color: #8b8baf;
    font-size: 14px;
}

.user-header-actions {
    display: flex;
    gap: 10px;
}

/* Actions Cell */
.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Modal / Confirm Dialog */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

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

.modal {
    background: #1a1a3e;
    border-radius: 12px;
    padding: 30px;
    max-width: 450px;
    width: 90%;
    border: 1px solid #2a2a5a;
    text-align: center;
}

.modal h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 20px;
}

.modal p {
    color: #8b8baf;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.pagination a {
    background: #1a1a3e;
    color: #8b8baf;
    border: 1px solid #2a2a5a;
}

.pagination a:hover {
    background: #6c63ff;
    color: #fff;
    border-color: #6c63ff;
}

.pagination .active {
    background: #6c63ff;
    color: #fff;
    border: 1px solid #6c63ff;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #555;
}

.empty-state .icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.empty-state h3 {
    color: #8b8baf;
    margin-bottom: 10px;
}

.empty-state p {
    color: #555;
    margin-bottom: 20px;
}

/* Bandwidth Display */
.bandwidth {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(46, 204, 113, 0.1);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.bandwidth .up {
    color: #2ecc71;
    font-size: 12px;
}

.bandwidth .down {
    color: #3498db;
    font-size: 12px;
}

.bandwidth .speed {
    color: #fff;
    font-family: 'Fira Code', monospace;
    font-weight: 600;
    font-size: 13px;
}

/* Stats Cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #1a1a3e;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #2a2a5a;
    text-align: center;
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: #6c63ff;
    margin-bottom: 5px;
}

.stat-card .label {
    color: #8b8baf;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card.green .number { color: #2ecc71; }
.stat-card.blue .number { color: #3498db; }
.stat-card.orange .number { color: #f39c12; }
.stat-card.red .number { color: #e74c3c; }

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .container {
        padding: 20px 15px;
    }

    .top-bar {
        flex-direction: column;
    }

    .search-box input {
        width: 100%;
    }

    .user-detail {
        grid-template-columns: 1fr;
    }

    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .user-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

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

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

::-webkit-scrollbar-track {
    background: #0f0f23;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6c63ff;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 10;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #2a2a5a;
    padding-bottom: 0;
}

.tab-nav a {
    padding: 10px 20px;
    text-decoration: none;
    color: #8b8baf;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
}

.tab-nav a:hover,
.tab-nav a.active {
    color: #6c63ff;
    border-bottom-color: #6c63ff;
}