/* Dashboard Layout - AgriFish OS Dark Theme */
:root {
    --bg-dark: #0b1210;
    --surface-dark: #141f1b;
    --primary-green: #00e676;
    /* Neon Green */
    --secondary-green: #00c853;
    --blue-fishery: #29b6f6;
    --text-primary: #ffffff;
    --text-secondary: #b0bec5;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(20, 31, 27, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --success: #00e676;
    --danger: #ff5252;
    --warning: #ffab00;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text-primary);
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 24px;
    background-color: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 10px;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.sidebar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    font-size: 1.2rem;
}

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

.nav-group-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 24px 0 12px 12px;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0.8;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.sidebar-nav li a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-nav li a.active {
    background: linear-gradient(90deg, rgba(0, 230, 118, 0.15) 0%, rgba(0, 230, 118, 0.0) 100%);
    color: var(--primary-green);
    border-left: 3px solid var(--primary-green);
    border-radius: 4px 12px 12px 4px;
    /* Only round right side slightly */
}

.sidebar-nav li a .icon {
    margin-right: 12px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}

/* Sidebar Footer (User Profile) */
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.user-profile:hover {
    background: rgba(255, 255, 255, 0.05);
}

.avatar {
    width: 36px;
    height: 36px;
    background: #ffab91;
    /* Example Avatar Color */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #d84315;
}

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

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}


/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    /* Ensure main content matches bg */
}

/* Top Bar / Command Center */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-dark);
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.search-bar-container {
    flex-grow: 1;
    max-width: 400px;
    margin: 0 40px;
    position: relative;
}

.search-input {
    width: 100%;
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    padding: 10px 16px 10px 40px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-green);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    position: relative;
}

.icon-btn:hover {
    color: white;
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--primary-green);
    border-radius: 50%;
}

/* Content Wrapper */
.content-wrapper {
    flex-grow: 1;
    padding: 32px;
    overflow-y: auto;
}

/* Cards */
.card {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0;
    /* Reset padding to handle header/body split */
    box-shadow: none;
}

.card-body {
    padding: 20px;
}

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

/* Stat Cards (Summary) */
.glass-card {
    background: rgba(20, 31, 27, 0.65);
    /* var(--glass-bg) adjusted */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* var(--glass-border) adjusted */
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-card .card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card .h5,
.glass-card .text-gray-800,
.glass-card .text-gray-300,
.glass-card i {
    color: white !important;
}

.glass-card .text-xs {
    color: rgba(255, 255, 255, 0.8) !important;
}

.glass-card .text-xs {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Glass Card Table Overrides */
.glass-card .table {
    color: white !important;
    background-color: transparent !important;
    --bs-table-bg: transparent !important;
    --bs-table-accent-bg: transparent !important;
    --bs-table-striped-bg: transparent !important;
    --bs-table-hover-bg: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.glass-card .table td,
.glass-card .table th {
    background-color: transparent !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    backdrop-filter: none !important;
    /* Ensure children don't stack blur */
}

.glass-card .table-bordered {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.glass-card .table-striped>tbody>tr:nth-of-type(odd)>* {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: white !important;
    box-shadow: none !important;
}

.glass-card .table-hover>tbody>tr:hover>* {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    box-shadow: none !important;
}

.stat-card-premium {
    background: var(--surface-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.stat-card-premium .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: block;
}

.stat-card-premium .value {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    display: block;
}

.stat-card-premium .unit {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

.stat-card-premium .trend {
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
}

.trend.positive {
    color: var(--success);
}

.trend.negative {
    color: var(--danger);
}

.stat-card-premium .bg-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.05;
    color: white;
}

.stat-card-premium .progress-line {
    height: 3px;
    background: #333;
    margin-top: 16px;
    border-radius: 2px;
    position: relative;
}

.stat-card-premium .progress-fill {
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 2px;
}

/* Common Text Classes */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: white;
}

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

/* Button Overrides */
.btn-primary {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: #000;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--secondary-green);
    border-color: var(--secondary-green);
    color: #000;
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: white;
}

/* Form Controls Dark */
.form-select,
.form-control {
    background-color: var(--surface-dark);
    border: 1px solid var(--border-color);
    color: white;
}

.form-select:focus,
.form-control:focus {
    background-color: var(--surface-dark);
    color: white;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 0.25rem rgba(0, 230, 118, 0.25);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1;
}

.form-control:focus::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Tables */
.table {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.table thead th {
    color: white;
    border-bottom: 2px solid var(--border-color);
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    color: var(--text-secondary);
    box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.02);
}

.table-hover>tbody>tr:hover>* {
    color: white;
    box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.05);
}

/* Mobile Toggle Style */
.mobile-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin-right: 16px;
    display: flex;
    align-items: center;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 99;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Overrides */
@media (max-width: 991.98px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        padding: 15px 20px;
    }

    .search-bar-container {
        margin: 0 15px;
        max-width: none;
    }

    .content-wrapper {
        padding: 20px;
    }

    .topbar-actions {
        gap: 12px;
    }
}

@media (max-width: 767.98px) {
    .topbar-title {
        display: none;
    }

    .search-bar-container {
        margin: 0 10px;
    }

    .icon-btn {
        font-size: 1.1rem;
    }
}

/* Premium Status Badges */
.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    transition: all 0.3s ease;
}

.badge-submitted {
    background: rgba(255, 171, 0, 0.15);
    /* Warning Orange */
    color: #ffab00;
    border: 1px solid rgba(255, 171, 0, 0.3);
    box-shadow: 0 0 15px rgba(255, 171, 0, 0.1);
}

.badge-visitcompleted {
    background: rgba(41, 182, 246, 0.15);
    /* Fishery Blue */
    color: #29b6f6;
    border: 1px solid rgba(41, 182, 246, 0.3);
    box-shadow: 0 0 15px rgba(41, 182, 246, 0.1);
}

.badge-approved {
    background: rgba(0, 230, 118, 0.15);
    /* Success Green */
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.1);
}

.badge-rejected,
.badge-cancelled {
    background: rgba(255, 82, 82, 0.15);
    /* Danger Red */
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.status-badge:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.table-responsive {
    border: none;
}