/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #e4e4e7;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

a {
    color: #60a5fa;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #4b5563;
    cursor: not-allowed;
    transform: none;
}

.btn-action {
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #93c5fd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}

.btn-action:hover {
    background: rgba(59, 130, 246, 0.3);
    text-decoration: none;
}

/* ===== Card ===== */
.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(10px);
}

/* ===== Alerts ===== */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: #f4f4f5;
    text-decoration: none;
}

.navbar-brand:hover {
    text-decoration: none;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.user-name {
    font-weight: 500;
    color: #f4f4f5;
}

.user-role {
    font-size: 12px;
    color: #a1a1aa;
}

.btn-logout {
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.3);
    text-decoration: none;
}

/* ===== Layout ===== */
.main-layout {
    display: flex;
    min-height: calc(100vh - 65px);
}

.sidebar {
    width: 260px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px 0;
    flex-shrink: 0;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    padding: 0 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #71717a;
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #a1a1aa;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f4f4f5;
    text-decoration: none;
}

.nav-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-left-color: #3b82f6;
}

.nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    opacity: 1;
}

.admin-section {
    display: none;
}

.admin-section.visible {
    display: block;
}

.page-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: #a1a1aa;
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 48px;
    color: #a1a1aa;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 0.8s ease infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Data Table ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
    background: rgba(0, 0, 0, 0.2);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a1a1aa;
}

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

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.badge-warning {
    background: rgba(234, 179, 8, 0.2);
    color: #fde047;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 64px 32px;
    color: #71717a;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ===== Table Stats Bar ===== */
.table-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.table-stat-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    min-width: 120px;
}

.table-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #f4f4f5;
}

.table-stat-label {
    font-size: 12px;
    color: #a1a1aa;
    margin-top: 4px;
}

/* ===== DataTables Dark Theme ===== */
.dataTables_wrapper {
    color: #e4e4e7;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: #a1a1aa;
    margin-bottom: 16px;
}

.dataTables_wrapper .dataTables_length {
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_filter {
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #f4f4f5;
    padding: 8px 12px;
    margin: 0 8px;
}

.dataTables_wrapper .dataTables_filter input {
    width: 250px;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    outline: none;
    border-color: #3b82f6;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px;
    color: #a1a1aa !important;
    padding: 8px 14px;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: rgba(59, 130, 246, 0.3) !important;
    border-color: #3b82f6 !important;
    color: #93c5fd !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

table.dataTable {
    border-collapse: collapse !important;
}

table.dataTable thead th {
    background: rgba(0, 0, 0, 0.3) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #a1a1aa;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px !important;
}

table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
    opacity: 0.5;
}

table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:after {
    opacity: 1;
    color: #3b82f6;
}

table.dataTable tbody td {
    padding: 14px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    vertical-align: middle;
}

table.dataTable tbody tr {
    background: transparent !important;
}

table.dataTable tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

table.dataTable tbody tr.clickable-row {
    cursor: pointer;
}

table.dataTable tbody tr.clickable-row:hover {
    background: rgba(59, 130, 246, 0.1) !important;
}

.dataTables_empty {
    color: #71717a;
    padding: 48px !important;
    text-align: center;
}

/* DataTables responsive */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    background-color: #3b82f6;
    border: none;
}

.dtr-details {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
}

.dtr-details li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 0;
}

.dtr-title {
    color: #a1a1aa;
    font-weight: 600;
    margin-right: 8px;
}
