:root {
    --primary-color: #064E3B;
    /* Emerald Green */
    --primary-light: #065F46;
    --primary-dark: #064535;
    --accent-color: #F59E0B;
    /* Amber Gold */
    --bg-color: #F9FAFB;
    --text-color: #111827;
    --text-light: #6B7280;
    --white: #FFFFFF;
    --error-color: #EF4444;
    --success-color: #10B981;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

.premium-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #D1D5DB;
    background-color: var(--white);
    transition: border-color 0.2s, ring 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(6, 78, 59, 0.1);
}

/* Layout Structure */
.portal-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--primary-dark);
    color: var(--white);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    padding: 1.5rem 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

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

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.page-container {
    padding: 2rem;
    flex: 1;
}

/* User Profile in Header */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
}

/* Add these to your existing global.css */

/* Table-specific styles */
.table-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

.premium-table {
    min-width: 1200px;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

.premium-table th {
    text-align: left;
    padding: 1rem;
    background: #F3F4F6;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #E5E7EB;
    position: sticky;
    top: 0;
    z-index: 10;
}

.premium-table td {
    padding: 1rem;
    border-bottom: 1px solid #E5E7EB;
    font-size: 0.875rem;
    color: var(--text-color);
    vertical-align: middle;
    white-space: nowrap;
}

.premium-table tr:hover td {
    background-color: #F9FAFB;
}

/* Make first column sticky when scrolling horizontally */
.premium-table th:first-child,
.premium-table td:first-child {
    position: sticky;
    left: 0;
    background: var(--white);
    z-index: 5;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.premium-table tr:hover td:first-child {
    background-color: #F9FAFB;
}

.premium-table th:first-child {
    background: #F3F4F6;
    z-index: 11;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
    display: inline-block;
}

.status-active {
    background: #D1FAE5;
    color: #065F46;
}

.status-draft {
    background: #E5E7EB;
    color: #374151;
}

.status-completed {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-archived {
    background: #FEE2E2;
    color: #991B1B;
}

/* Action buttons */
.action-btn {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #D1D5DB;
    background: var(--white);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-color);
    white-space: nowrap;
}

.action-btn:hover {
    background: #F9FAFB;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Table card layout */
.table-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    /* Adjust based on your layout */
    min-height: 500px;
}

.card-header {
    padding: 1.5rem 1.5rem 0.5rem;
    flex-shrink: 0;
}

.card-body {
    flex: 1;
    overflow: hidden;
    padding: 0 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Header actions */
.table-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Scrollbar styling */
.table-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
    margin: 0 1.5rem;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Responsive adjustments */
@media (max-width: 1400px) {
    .table-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .table-header-actions>div:last-child {
        display: flex;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .table-card {
        height: calc(100vh - 200px);
        min-height: 400px;
    }

    .card-header {
        padding: 1rem 1rem 0.5rem;
    }

    .card-body {
        padding: 0 1rem 1rem;
    }

    .table-scroll-container {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
}

/* Fix for .main-content to prevent overall horizontal scroll */
.main-content {
    overflow-x: hidden;
}

.page-container {
    overflow: hidden;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-container {
    background: var(--white);
    width: 100%;
    max-width: 550px;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    background: #F9FAFB;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 1.5rem;
}

.modal-tab {
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
}

.modal-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.multiselect-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.multiselect-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
}

.multiselect-item:hover {
    background: #F3F4F6;
}

.multiselect-item input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Alert/Message Styles */
.messages-container {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.alert-error,
.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.close-alert {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: currentColor;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.close-alert:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}