:root {
    --primary-color: #10b981; /* Emerald 500 */
    --secondary-color: #059669; /* Emerald 600 */
    --dark-color: #047857; /* Emerald 700 */
    --light-color: #d1fae5; /* Emerald 100 */
    --ultra-light-bg: #f0fdf4; /* Emerald 50 */
    --accent-color: #a7f3d0; /* Emerald 200 */
    --text-primary: #1f2937; /* Gray 800 */
    --text-secondary: #4b5563; /* Gray 600 */
    --border-color: #e5e7eb; /* Gray 200 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --warning-color: #f59e0b;  /* Orange */
    --danger-color: #ef4444;  /* Red */
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-secondary);
    line-height: 1.6;
    background-color: #f9fafb; /* Gray 50 */
}

/* Navbar Styles */
.navbar {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

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

.search-wrapper {
    display: flex;
    align-items: center;
}

.search-wrapper .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem; /* Adjust padding as needed */
}

.search-wrapper .form-control {
    background-color: white;
    color: var(--text-color);
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    color: var(--text-color);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: var(--light-bg);
    color: var(--primary-color);
}

.navbar-toggler {
    border-color: var(--border-color);
}

.navbar-toggler:focus {
    box-shadow: none;
    border-color: var(--primary-color);
}

/* Footer Styles */
.footer {
    background: linear-gradient(135deg, var(--dark-color), var(--accent-color));
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer h5 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.footer-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--secondary-color);
}

.social-links a {
    color: white;
    margin-right: 1rem;
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.card-header {
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
}

.card-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary-color);
}

.card-body {
    padding: 1rem;
}

/* Form Styles */
.form-control, .form-select {
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.9);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(126, 212, 163, 0.25);
}

.btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* Breadcrumb Styles */
.breadcrumb {
    background-color: var(--light-bg);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Table Styles */
.table {
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.9);
}

.table th {
    background-color: var(--light-bg);
    font-weight: 600;
    color: var(--secondary-color);
}

.table td {
    vertical-align: middle;
}

/* Alert Styles */
.alert {
    border-radius: 4px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
}

.alert-success {
    background-color: rgba(220, 252, 231, 0.9);
    color: #166534;
}

.alert-danger {
    background-color: rgba(254, 226, 226, 0.9);
    color: #991b1b;
}

.alert-warning {
    background-color: rgba(254, 243, 199, 0.9);
    color: #92400e;
}

.alert-info {
    background-color: rgba(219, 234, 254, 0.9);
    color: #1e40af;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Side Panel Styles */
.side-panel {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    background-color: rgba(255, 255, 255, 0.98);
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.side-panel .logo-container {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.side-panel .logo-container img {
    height: 80px;
    width: auto;
    margin-bottom: 0.5rem;
}

.side-panel .nav-link {
    color: var(--text-color) !important;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.side-panel .nav-link:hover {
    background-color: var(--light-bg);
    color: var(--primary-color) !important;
    transform: translateX(5px);
}

.side-panel .nav-link i {
    width: 24px;
    text-align: center;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* Main Content Adjustment */
.main-content {
    margin-left: 280px;
    padding: 2rem;
    min-height: 100vh;
}

/* Container Adjustment */
.container {
    max-width: 100%;
    padding: 0;
}

/* Remove footer styles and adjustments */
.footer {
    display: none;
}

.side-panel-footer {
    padding: 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.side-panel-footer a:hover {
    color: var(--primary-color) !important;
    text-decoration: underline !important;
}

.side-panel-footer hr {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

.side-panel .nav {
    flex: 1;
    margin-bottom: 1rem;
}

/* Sidebar tools grid */
.sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    padding: 0.75rem 1rem 0.4rem;
}

.sidebar-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    padding: 0 0.5rem 0.5rem;
}

.sidebar-tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 0.25rem;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    transition: background 0.2s ease, transform 0.15s ease;
}

.sidebar-tool-item:hover {
    background: #f3f4f6;
    color: #10b981;
    transform: translateY(-2px);
    text-decoration: none;
}

.sidebar-tool-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-tool-name {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.btn-primary {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}
.btn-primary:hover {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
}
.btn-outline-primary {
    color: #28a745;
    border-color: #28a745;
}
.btn-outline-primary:hover {
    background-color: #28a745;
    border-color: #28a745;
}
.bg-primary {
    background-color: #28a745 !important;
}
.text-primary {
    color: #28a745 !important;
}
.border-primary {
    border-color: #28a745 !important;
}

/* ===== Viewport-Filling Embeds and Tables ===== */
/* Ensure viewport height calculations work reliably */
html, body {
    height: 100%;
}

/* Iframe defaults and fullscreen helpers */
iframe {
    max-width: 100%;
    display: block;
}

/* Apply viewport-based height to common placements */
.card-body > iframe,
.iframe-fullscreen,
.embed-fullscreen iframe {
    width: 100% !important;
    height: calc(100vh - 180px) !important; /* header/nav + padding allowance */
    min-height: 600px;
    border: 0;
}

/* Tighter allowance on smaller screens */
@media (max-width: 576px) {
    .card-body > iframe,
    .iframe-fullscreen,
    .embed-fullscreen iframe {
        height: calc(100vh - 140px) !important;
        min-height: 400px;
    }
}

/* Full-width tables and fullscreen scrolling wrapper */
.table {
    width: 100%;
}

/* Use this wrapper around a table to make it occupy viewport height with sticky header */
.table-fullscreen {
    display: block;
    width: 100%;
    max-height: calc(100vh - 200px);
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.9);
}

.table-fullscreen .table {
    margin-bottom: 0; /* avoid extra scroll space */
}

.table-fullscreen .table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: var(--light-bg);
}

@media (max-width: 576px) {
    .table-fullscreen {
        max-height: calc(100vh - 160px);
    }
}

/* Navbar search */
.navbar-search-form {
    flex-shrink: 0;
}

.navbar-search-group {
    width: 220px;
}

.navbar-search-input {
    font-size: 0.85rem;
    border-color: #dee2e6;
}

.navbar-search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 0.15rem rgba(16, 185, 129, 0.2);
}

@media (max-width: 576px) {
    .navbar-search-group { width: 140px; }
}
