/* Admin Back Office Styles */

/* Admin Container */
.admin-container {
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
    height: calc(100vh - 50px);
    overflow-y: auto;
}

.admin-header {
    margin-bottom: 20px;
}

.admin-header h1 {
    color: #d1d4dc;
    font-size: 24px;
    margin: 0 0 5px 0;
}

.admin-header p {
    color: #808080;
    font-size: 14px;
    margin: 0;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 1px solid #2b2d35;
    padding-bottom: 10px;
}

.admin-tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #808080;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.admin-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #d1d4dc;
}

.admin-tab-btn.active {
    background: #2962ff;
    color: white;
}

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

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

/* Admin Toolbar */
.admin-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.admin-sub-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    padding: 10px;
    background: #1a1b1f;
    border-radius: 4px;
}

.admin-search-input {
    padding: 8px 12px;
    background: #1e2229;
    border: 1px solid #3a3c45;
    border-radius: 4px;
    color: #d1d4dc;
    font-size: 14px;
    min-width: 250px;
}

.admin-search-input:focus {
    outline: none;
    border-color: #2962ff;
}

.admin-select {
    padding: 8px 12px;
    background: #2b2d35;
    border: 1px solid #3a3c45;
    border-radius: 4px;
    color: #d1d4dc;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

.admin-select:focus {
    outline: none;
    border-color: #2962ff;
}

.admin-date-input {
    padding: 8px 12px;
    background: #1e2229;
    border: 1px solid #3a3c45;
    border-radius: 4px;
    color: #d1d4dc;
    font-size: 14px;
}

.admin-date-input:focus {
    outline: none;
    border-color: #2962ff;
}

.admin-btn {
    padding: 8px 16px;
    background: #2962ff;
    border: none;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-btn:hover {
    background: #1e4fd6;
}

.admin-btn-secondary {
    background: #2b2d35;
    border: 1px solid #3a3c45;
    color: #d1d4dc;
}

.admin-btn-secondary:hover {
    background: #3a3c45;
}

.admin-btn-primary {
    background: #26a69a;
}

.admin-btn-primary:hover {
    background: #1e8e82;
}

.admin-btn-danger {
    background: #ff1744;
}

.admin-btn-danger:hover {
    background: #d50000;
}

/* Admin Tables */
.admin-table-container {
    overflow-x: auto;
    background: #1a1b1f;
    border: 1px solid #2b2d35;
    border-radius: 8px;
}

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

.admin-table th {
    background: #2b2d35;
    color: #d1d4dc;
    font-weight: 600;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid #3a3c45;
    white-space: nowrap;
}

.admin-table td {
    color: #d1d4dc;
    padding: 10px 15px;
    border-bottom: 1px solid #2b2d35;
    white-space: nowrap;
}

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

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

.admin-table .positive {
    color: #00e676;
}

.admin-table .negative {
    color: #ff1744;
}

.admin-table-compact {
    font-size: 12px;
}

.admin-table-compact th,
.admin-table-compact td {
    padding: 8px 10px;
}

.admin-loading {
    text-align: center;
    color: #808080;
    padding: 30px !important;
}

/* Status Badges */
.admin-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-badge-active {
    background: rgba(0, 230, 118, 0.2);
    color: #00e676;
}

.admin-badge-inactive {
    background: rgba(255, 23, 68, 0.2);
    color: #ff1744;
}

.admin-badge-admin {
    background: rgba(41, 98, 255, 0.2);
    color: #2962ff;
}

.admin-badge-user {
    background: rgba(128, 128, 128, 0.2);
    color: #808080;
}

.admin-badge-live {
    background: rgba(0, 230, 118, 0.2);
    color: #00e676;
}

.admin-badge-paper {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* Action Buttons */
.admin-action-btn {
    padding: 4px 10px;
    background: #2b2d35;
    border: 1px solid #3a3c45;
    border-radius: 4px;
    color: #d1d4dc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 5px;
}

.admin-action-btn:hover {
    background: #3a3c45;
    border-color: #4a4c55;
}

.admin-action-btn:last-child {
    margin-right: 0;
}

/* Pagination */
.admin-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 10px;
}

.admin-pagination-btn {
    padding: 6px 12px;
    background: #2b2d35;
    border: 1px solid #3a3c45;
    border-radius: 4px;
    color: #d1d4dc;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-pagination-btn:hover:not(:disabled) {
    background: #3a3c45;
}

.admin-pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.admin-pagination-info {
    color: #808080;
    font-size: 13px;
}

/* Modals */
.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.2s;
}

.admin-modal-content {
    background: #1a1b1f;
    border: 1px solid #2b2d35;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s;
}

.admin-modal-large {
    max-width: 1000px;
}

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

.admin-modal-header h2 {
    color: #d1d4dc;
    font-size: 18px;
    margin: 0;
}

.admin-modal-close {
    background: none;
    border: none;
    color: #808080;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.admin-modal-close:hover {
    background: #2b2d35;
    color: #d1d4dc;
}

.admin-modal-body {
    padding: 20px;
}

.admin-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #2b2d35;
}

/* Detail Sections */
.admin-detail-section {
    margin-bottom: 20px;
}

.admin-detail-section h3 {
    color: #d1d4dc;
    font-size: 14px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #2b2d35;
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.admin-detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-detail-item label {
    color: #808080;
    font-size: 12px;
    font-weight: 500;
}

.admin-detail-item span {
    color: #d1d4dc;
    font-size: 14px;
}

.admin-input {
    padding: 8px 12px;
    background: #1e2229;
    border: 1px solid #3a3c45;
    border-radius: 4px;
    color: #d1d4dc;
    font-size: 14px;
    width: 100%;
}

.admin-input:focus {
    outline: none;
    border-color: #2962ff;
}

/* Account Tabs (Sub-tabs within account modal) */
.admin-account-tabs {
    display: flex;
    gap: 5px;
    margin: 20px 0 15px 0;
    border-bottom: 1px solid #2b2d35;
    padding-bottom: 10px;
}

.admin-account-tab-btn {
    padding: 8px 15px;
    background: transparent;
    border: none;
    color: #808080;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.admin-account-tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #d1d4dc;
}

.admin-account-tab-btn.active {
    background: #2b2d35;
    color: #d1d4dc;
}

.admin-account-tab-content {
    display: none;
}

.admin-account-tab-content.active {
    display: block;
}

/* Checkbox */
.admin-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #d1d4dc;
    font-size: 13px;
    cursor: pointer;
}

.admin-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Chart Container */
.admin-chart-container {
    background: #1e2229;
    border: 1px solid #2b2d35;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    height: 250px;
}

#balanceHistoryChart {
    width: 100%;
    height: 100%;
}

/* JSON Display */
.admin-json-display {
    background: #1e2229;
    border: 1px solid #2b2d35;
    border-radius: 4px;
    padding: 15px;
    color: #d1d4dc;
    font-size: 12px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* Notification */
.admin-notification {
    position: fixed;
    top: 70px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    z-index: 3000;
    animation: slideIn 0.3s;
}

.admin-notification-success {
    background: rgba(0, 230, 118, 0.2);
    border: 1px solid #00e676;
    color: #00e676;
}

.admin-notification-error {
    background: rgba(255, 23, 68, 0.2);
    border: 1px solid #ff1744;
    color: #ff1744;
}

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

/* Tools Section */
.admin-tools-section {
    background: #1a1b1f;
    border: 1px solid #2b2d35;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.admin-tools-section h3 {
    color: #d1d4dc;
    font-size: 16px;
    margin: 0 0 10px 0;
}

.admin-tools-description {
    color: #808080;
    font-size: 13px;
    margin: 0 0 20px 0;
}

.admin-tools-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #1e2229;
    border-radius: 6px;
}

.admin-tools-status-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.admin-tools-status-item label {
    color: #808080;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.admin-status-value {
    color: #d1d4dc;
    font-size: 14px;
    font-weight: 500;
}

.admin-status-active {
    color: #00e676;
}

.admin-status-inactive {
    color: #ff9800;
}

.admin-status-error {
    color: #ff1744;
}

.admin-tools-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-btn-warning {
    background: #ff9800;
}

.admin-btn-warning:hover {
    background: #e68900;
}

.admin-btn-warning:disabled {
    background: #5c4a00;
    cursor: not-allowed;
}

.admin-tools-result {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-size: 13px;
}

.admin-tools-result-loading {
    background: rgba(41, 98, 255, 0.1);
    border: 1px solid #2962ff;
    color: #2962ff;
}

.admin-tools-result-success {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid #00e676;
    color: #00e676;
}

.admin-tools-result-error {
    background: rgba(255, 23, 68, 0.1);
    border: 1px solid #ff1744;
    color: #ff1744;
}

.admin-loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }

    .admin-toolbar {
        flex-direction: column;
    }

    .admin-search-input {
        width: 100%;
        min-width: auto;
    }

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

    .admin-modal-content {
        width: 95%;
        margin: 10px;
    }
}
