/* ============================================
   Oslo Camping Utleie - Admin Dashboard Styles
   Clean, Production-Ready Design
   ============================================ */

:root {
    /* Colors */
    --primary: #FF385C;
    --primary-dark: #E31C5F;
    --secondary: #222222;
    --success: #008A05;
    --warning: #F59E0B;
    --danger: #DC2626;
    --info: #0284C7;

    /* Grays */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 80px;
    --border-radius: 12px;
    --border-radius-sm: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Transitions */
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* ============================================
   Login Screen
   ============================================ */

.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 48px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.login-logo p {
    color: var(--gray-500);
    font-size: 14px;
}

.error-text {
    color: var(--danger);
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
}

/* ============================================
   App Container
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    background: var(--gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-header .logo-icon {
    font-size: 32px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 16px;
    font-weight: 700;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--gray-400);
}

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

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

.nav-section-title {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    padding: 0 24px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.nav-item:hover {
    background: var(--gray-800);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.nav-badge.warning {
    background: var(--warning);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-700);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.admin-details {
    display: flex;
    flex-direction: column;
}

.admin-name {
    font-size: 14px;
    font-weight: 600;
}

.admin-role {
    font-size: 12px;
    color: var(--gray-400);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--gray-600);
    border-radius: var(--border-radius-sm);
    color: var(--gray-300);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--gray-800);
    border-color: var(--gray-500);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.content-header {
    background: white;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-900);
}

.header-left p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-search input {
    width: 300px;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.1);
}

.content-section {
    padding: 32px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.section-header p {
    font-size: 14px;
    color: var(--gray-500);
}

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

/* ============================================
   Stats Grid
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stats-grid.small {
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}

.stat-card.danger {
    border-left: 4px solid var(--danger);
}

.stat-card.warning {
    border-left: 4px solid var(--warning);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: #EFF6FF; }
.stat-icon.green { background: #ECFDF5; }
.stat-icon.purple { background: #F5F3FF; }
.stat-icon.orange { background: #FFF7ED; }

.stat-info {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.stat-trend {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.stat-trend.up {
    background: #ECFDF5;
    color: var(--success);
}

.stat-trend.down {
    background: #FEF2F2;
    color: var(--danger);
}

/* ============================================
   Cards
   ============================================ */

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.card-header .link {
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.card-header .link:hover {
    text-decoration: underline;
}

.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    min-height: 400px;
}

.chart-card.small {
    min-height: auto;
}

.chart-container {
    padding: 24px;
    height: 300px;
}

.cards-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

/* ============================================
   Tables
   ============================================ */

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

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

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
}

.data-table th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    background: var(--gray-50);
}

.data-table td {
    font-size: 14px;
    color: var(--gray-700);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.loading-cell {
    text-align: center !important;
    padding: 40px !important;
    color: var(--gray-400);
}

.table-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--gray-500);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #B91C1C;
}

.btn-success {
    background: var(--success);
    color: white;
}

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

.btn-full {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    background: var(--gray-100);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--gray-200);
}

/* ============================================
   Badges
   ============================================ */

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-active,
.badge-confirmed,
.badge-completed {
    background: #ECFDF5;
    color: var(--success);
}

.badge-pending {
    background: #FFF7ED;
    color: #D97706;
}

.badge-suspended,
.badge-cancelled {
    background: #FEF2F2;
    color: var(--danger);
}

.badge-verified {
    background: #EFF6FF;
    color: var(--info);
}

/* ============================================
   Forms
   ============================================ */

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 56, 92, 0.1);
}

.search-filter-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.search-input {
    flex: 1;
    max-width: 300px;
    padding: 10px 16px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    padding: 8px 16px;
    border: 1px solid var(--gray-300);
    border-radius: 20px;
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition);
}

.filter-tab:hover {
    border-color: var(--gray-400);
}

.filter-tab.active {
    background: var(--gray-900);
    color: white;
    border-color: var(--gray-900);
}

/* ============================================
   Modals
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-content.large {
    max-width: 800px;
}

.modal-content.small {
    max-width: 400px;
}

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-200);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================
   Toasts
   ============================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--gray-900);
    color: white;
    padding: 16px 24px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
}

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

/* ============================================
   Loading Spinner
   ============================================ */

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

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

/* ============================================
   Reports Grid
   ============================================ */

.reports-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.report-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.report-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.report-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.report-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.report-card p {
    font-size: 14px;
    color: var(--gray-500);
}

/* ============================================
   Settings Grid
   ============================================ */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.settings-card {
    padding: 24px;
}

.settings-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 40px;
}

.empty-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
}

/* ============================================
   Alerts
   ============================================ */

.alerts-list {
    padding: 16px 24px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    border-left: 4px solid var(--warning);
}

.alert-item.danger {
    border-left-color: var(--danger);
    background: #FEF2F2;
}

.alert-item:last-child {
    margin-bottom: 0;
}

.no-alerts {
    color: var(--gray-400);
    text-align: center;
    padding: 20px;
}

/* ============================================
   User/Listing Items
   ============================================ */

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-600);
    overflow: hidden;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.listing-thumb {
    width: 48px;
    height: 36px;
    border-radius: 4px;
    background: var(--gray-200);
    overflow: hidden;
}

.listing-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   Action Buttons in Tables
   ============================================ */

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

/* ============================================
   Fraud Detection
   ============================================ */

.fraud-item {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
}

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

.fraud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.fraud-risk {
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
}

.fraud-risk.critical {
    background: #8B0000;
    color: white;
}

.fraud-risk.high {
    background: var(--danger);
    color: white;
}

.fraud-risk.medium {
    background: var(--warning);
    color: white;
}

.fraud-users {
    font-size: 14px;
    color: var(--gray-700);
}

.fraud-messages {
    background: var(--gray-50);
    border-radius: var(--border-radius-sm);
    padding: 16px;
    margin-top: 12px;
}

.fraud-message {
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
}

.fraud-message:last-child {
    border-bottom: none;
}

.fraud-message .sender {
    font-weight: 600;
    margin-right: 8px;
}

.fraud-message .highlight {
    background: #FEF3C7;
    padding: 2px 4px;
    border-radius: 2px;
}

.fraud-actions {
    margin-top: 16px;
    display: flex;
    gap: 12px;
}

/* ============================================
   Responsive
   ============================================ */

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

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

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

    .reports-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .content-header {
        padding: 16px;
    }

    .header-search {
        display: none;
    }

    .content-section {
        padding: 16px;
    }

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

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

    .search-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        max-width: none;
    }

    .filter-tabs {
        flex-wrap: wrap;
    }
}
