/* Modern Premium Design CSS */
:root {
    --bg-dark: #0f1115;
    --bg-panel: #16181d;
    --bg-panel-hover: #1c1f26;
    --bg-sidebar: #13151a;

    --text-main: #f3f4f6;
    --text-muted: #9ca3af;

    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-glow: rgba(249, 115, 22, 0.2);

    --border: #272a30;
    --border-light: #374151;

    --danger: #ef4444;
    --success: #10b981;

    --blur-bg: rgba(22, 24, 29, 0.7);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-orange {
    color: var(--accent);
}

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

.text-sm {
    font-size: 0.875rem;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-0 {
    margin-bottom: 0 !important;
}

/* Layout */
.layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-brand {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #f59e0b);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.sidebar-brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-nav {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    background-color: var(--bg-panel-hover);
    color: var(--text-main);
}

.nav-item.active {
    background-color: var(--accent-glow);
    color: var(--accent);
    box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.auth-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 8px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
}

.auth-user img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.auth-user-info {
    display: flex;
    flex-direction: column;
}

.auth-user-info strong {
    font-size: 0.875rem;
    font-weight: 600;
}

.auth-user-info a {
    font-size: 0.75rem;
    color: var(--danger);
    text-decoration: none;
    transition: var(--transition);
}

.auth-user-info a:hover {
    text-decoration: underline;
}

/* Base Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    outline: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-secondary {
    background-color: var(--bg-panel-hover);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

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

.btn-discord {
    width: 100%;
    background-color: #5865F2;
    color: white;
}

.btn-discord:hover {
    background-color: #4752C4;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
}

/* Main Workspace */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem;
    background: radial-gradient(circle at top right, #1a1614 0%, var(--bg-dark) 40%);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out forwards;
}

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.section-header p {
    color: var(--text-muted);
}

.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

/* Data Panels */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
}

.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.panel.full-width {
    width: 100%;
}

.panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.02);
}

.panel-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel-body {
    padding: 0;
}

/* Lists */
.list-container {
    max-height: 500px;
    overflow-y: auto;
}

.list-container::-webkit-scrollbar {
    width: 8px;
}

.list-container::-webkit-scrollbar-track {
    background: transparent;
}

.list-container::-webkit-scrollbar-thumb {
    background-color: var(--border-light);
    border-radius: 4px;
}

.item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: var(--transition);
}

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

.item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--border);
}

.item-rep {
    align-items: center;
}

.item-rep .avatar {
    width: 48px;
    height: 48px;
}

.content-box {
    flex-grow: 1;
}

.header-box {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.25rem;
}

.header-box strong {
    font-weight: 600;
}

.header-box .meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

.loading-spinner,
.loading-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Data Table */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background-color: rgba(255, 255, 255, 0.02);
}

.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

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

.data-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.user-cell img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 101;
    overflow: hidden;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--text-main);
}

.modal-content form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    font-size: 0.875rem;
}

.form-control {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}

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

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Role Badges & Checkboxes */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 4px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-light);
}

.role-badge .color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.roles-selection-container {
    max-height: 200px;
    overflow-y: auto;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.role-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--transition);
    user-select: none;
}

.role-checkbox-label:hover {
    border-color: var(--border-light);
}

.role-checkbox-label.selected {
    border-color: var(--accent);
    background-color: rgba(249, 115, 22, 0.05);
}

.role-checkbox-label input {
    display: none;
}

/* Toasts */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-error {
    border-left: 4px solid var(--danger);
}

.toast.toast-info {
    border-left: 4px solid var(--accent);
}

.toast.removing {
    animation: toastFadeOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastFadeOut {
    to {
        transform: translateX(10px);
        opacity: 0;
    }
}