@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #F59E0B;
    --primary-dark: #D97706;
    --secondary: #6B7280;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #1F2937;
    --bg-body: #F3F4F6;
    --bg-sidebar: #1F2937;
    --bg-card: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px 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);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Sidebar */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
}

.sidebar-brand-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.user-role {
    font-size: 0.75rem;
    opacity: 0.7;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section {
    padding: 0.75rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.5;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.25rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.nav-link.active {
    background: rgba(245, 158, 11, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-footer {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.app-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-content {
    padding: 1.5rem;
}

.page-title {
    font-weight: 600;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-body);
    color: var(--text-primary);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

/* Cards */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
}

.stat-info h3, .stat-info h5 {
    font-weight: 700;
    margin-bottom: 0.125rem;
}

.stat-info span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-info small {
    display: block;
    font-size: 0.7rem;
    margin-top: 0.125rem;
}

/* Dashboard Cards */
.dashboard-card .card-header {
    background: transparent;
}

/* Activity List */
.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.activity-item:hover {
    background: var(--bg-body);
}

.activity-icon {
    margin-top: 0.25rem;
}

.activity-icon i {
    font-size: 0.5rem;
}

.activity-content p {
    font-size: 0.875rem;
}

/* Auth Pages */
.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-header {
    text-align: center;
    padding: 2rem 2rem 1.5rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
    border-radius: 50%;
}

.auth-body {
    padding: 0 2rem 2rem;
}

.auth-footer {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-body);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

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

.btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
}

/* Apiary Cards */
.apiary-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

.apiary-img {
    height: 180px;
    object-fit: cover;
}

/* DataTables */
.datatable thead {
    background: var(--bg-body);
}

.datatable thead th {
    border-bottom: 2px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.75rem;
}

/* Profile */
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto;
}

/* Alerts */
.alert {
    border-radius: var(--radius);
    border: none;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: var(--border-color);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.15);
}

/* Admin Cards */
.admin-card {
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

/* Report Cards */
.report-card {
    cursor: pointer;
    transition: var(--transition);
}

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

/* Notifications */
.notification-dropdown {
    max-height: 350px;
    overflow-y: auto;
}

.notification-list {
    max-height: 250px;
    overflow-y: auto;
}

/* Responsive */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

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

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .app-content {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .auth-card {
        border-radius: 0;
    }
}

/* RTL Support */
[dir="rtl"] .app-sidebar {
    right: 0;
    left: auto;
}

[dir="rtl"] .app-main {
    margin-right: var(--sidebar-width);
    margin-left: 0;
}

[dir="rtl"] .nav-link {
    border-left: none;
    border-right: 3px solid transparent;
}

[dir="rtl"] .nav-link.active {
    border-left-color: transparent;
    border-right-color: var(--primary);
}

@media (max-width: 991.98px) {
    [dir="rtl"] .app-sidebar {
        transform: translateX(100%);
    }

    [dir="rtl"] .app-sidebar.show {
        transform: translateX(0);
    }

    [dir="rtl"] .app-main {
        margin-right: 0;
    }
}

/* Select2 */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 38px;
    border-radius: 0.5rem;
}

/* Image thumbnails */
.img-thumbnail {
    border-radius: 0.5rem;
    transition: var(--transition);
}

.img-thumbnail:hover {
    transform: scale(1.05);
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Theme switch animation */
.btn-outline-secondary.rounded-circle {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Badge colors */
.bg-success { background: var(--success) !important; }
.bg-danger { background: var(--danger) !important; }
.bg-warning { background: var(--warning) !important; }
.bg-info { background: var(--info) !important; }
.bg-primary { background: var(--primary) !important; }

/* Table fonts */
.table td, .table th {
    vertical-align: middle;
}
