/* ===========================
   BEI CMS - Modern Styles
   Bailey-Inspired Design
   Mobile-First Responsive
   =========================== */

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

/* ===========================
   CSS Variables (Bailey-Inspired)
   =========================== */
:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    
    /* Secondary & Status Colors */
    --secondary: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Gray Scale (Bailey's refined palette) */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Shadows (Bailey-style) */
    --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 rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    
    /* Legacy compatibility */
    --primary-color: var(--primary);
    --primary-hover: var(--primary-dark);
    --white: #ffffff;
    --text-dark: var(--gray-900);
    --text-muted: var(--gray-500);
    --light-bg: var(--gray-50);
    --border-color: var(--gray-200);
}

/* ===========================
   Global Reset & Base Styles
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

/* ===========================
   Navigation Bar (Modern)
   =========================== */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-200);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo h1,
.logo span {
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    letter-spacing: -0.025em;
    line-height: 1;
    margin: 0;
}

/* Mobile: Logo centered with BEI CMS */
@media (max-width: 767px) {
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .logo h1,
    .logo span {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
        border-radius: var(--radius-sm);
    }
}

/* Desktop Navigation */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.nav-menu a:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

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

/* User Info in Navigation */
/* Separator before user info (desktop) - using class instead of :has() for better browser support */
.nav-menu li.nav-user-separator {
    position: relative;
    margin-left: 1rem;
    padding-left: 1rem;
}

.nav-menu li.nav-user-separator::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 1px;
    background: var(--gray-300);
}

.nav-user-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 1rem;
    margin: 0;
}

.nav-user-info .user-email {
    font-size: 0.875rem;
    font-weight: var(--font-medium);
    color: var(--gray-700);
    white-space: nowrap;
}

.nav-user-info .user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: capitalize;
}

.logout-btn {
    color: var(--error) !important;
}

.logout-btn:hover {
    background-color: #fee2e2 !important;
    color: var(--error) !important;
}

@media (max-width: 767px) {
    .nav-menu li.nav-user-separator {
        margin-left: 0;
        padding-left: 0;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid var(--gray-200);
        width: 100%;
    }
    
    .nav-menu li.nav-user-separator::before {
        display: none;
    }
    
    .nav-user-info {
        margin: 0;
        padding: 1rem;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .logout-btn {
        margin-top: 0.5rem;
    }
}

/* Hamburger Menu Button (Mobile) */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Mobile Navigation Styles */
@media (max-width: 767px) {
    .nav-container {
        position: relative;
        padding: 0.75rem 1rem;
    }
    
    .hamburger {
        display: flex;
        order: 1;
        z-index: 1001;
    }
    
    .nav-menu {
        position: fixed;
        left: 0;
        top: 64px;
        bottom: 0;
        width: 280px;
        max-width: 80%;
        background: white;
        box-shadow: var(--shadow-xl);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        flex-direction: column;
        gap: 0;
        padding: 1rem;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-menu a {
        width: 100%;
        padding: 1rem;
        border-radius: var(--radius-md);
        font-size: 1rem;
    }
    
    /* Nav right side - refresh and logout */
    .nav-right {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        order: 3;
    }
    
    .refresh-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--gray-700);
        font-size: 1.125rem;
        padding: 0;
    }
    
    .refresh-btn:hover {
        color: var(--primary);
    }
    
    .nav-right .logout-btn {
        color: var(--gray-700);
        font-size: 0.875rem;
        padding: 0.5rem;
        margin: 0;
        background: transparent;
        border: none;
        cursor: pointer;
        font-weight: 500;
    }
    
    .nav-right .logout-btn:hover {
        color: var(--error);
    }
}

/* Desktop: Hide nav-right, show logout in nav-menu */
@media (min-width: 768px) {
    .nav-right {
        display: none;
    }
}

/* ===========================
   Container & Layout
   =========================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

@media (max-width: 767px) {
    .container {
        padding: var(--space-lg) var(--space-md);
    }
}

.page-header,
.dashboard-header {
    margin-bottom: var(--space-xl);
}

.page-header h2,
.dashboard-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.025em;
}

.page-header p,
.dashboard-header p {
    color: var(--gray-600);
    font-size: 1rem;
}

/* Page header with button on same line */
.page-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: var(--space-xl);
}

.page-header-flex h2 {
    margin-bottom: 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
}

@media (max-width: 767px) {
    .page-header h2,
    .dashboard-header h2,
    .page-header-flex h2 {
        font-size: 1.5rem;
    }
    
    .page-header-flex {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.breadcrumb a {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--gray-400);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item.active {
    color: var(--gray-900);
    font-weight: 500;
}

.breadcrumb-icon {
    font-size: 1rem;
    color: var(--gray-600);
}

/* ===========================
   Buttons (Modern Bailey-style)
   =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 44px;
    gap: 0.5rem;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

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

/* Edit button - blue */
.btn-icon[onclick*="edit"]:hover,
.btn-icon[title="Edit"]:hover {
    background: #dbeafe;
    color: var(--primary);
}

/* Delete button - red */
.btn-icon[onclick*="delete"]:hover,
.btn-icon[title="Delete"]:hover,
.btn-icon[title="Deactivate"]:hover {
    background: #fee2e2;
    color: var(--error);
}

@media (max-width: 767px) {
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===========================
   Cards (Modern Bailey-style)
   =========================== */
.card,
.action-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-lg);
    transition: all 0.2s ease;
    border: 1px solid var(--gray-200);
}

.card:hover,
.action-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--gray-300);
}

.card-header {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.action-card h3 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.action-card p {
    color: var(--gray-600);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.action-card .btn {
    width: 100%;
    margin-bottom: 0.75rem;
}

.action-card .btn:last-child {
    margin-bottom: 0;
}

/* Quick Actions Grid */
.quick-actions,
.dashboard-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

@media (min-width: 768px) {
    .quick-actions,
    .dashboard-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .quick-actions,
    .dashboard-actions {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Reports page - single column on mobile */
@media (max-width: 767px) {
    .dashboard-actions {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 767px) {
    .card,
    .action-card {
        border-radius: var(--radius-md);
        padding: var(--space-md);
    }
}

/* ===========================
   Tables (Modern with Mobile Support)
   =========================== */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    margin-bottom: var(--space-xl);
}

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

.data-table thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
}

/* Actions column - right align on desktop */
.data-table th:last-child,
.data-table td:last-child {
    text-align: right;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.875rem;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

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

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Mobile: Keep table layout but simplify */
@media (max-width: 767px) {
    .table-container {
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        min-width: 100%;
        background: white;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow);
        border: 1px solid var(--gray-200);
    }
    
    .data-table thead {
        background: var(--gray-50);
    }
    
    .data-table th {
        padding: 0.75rem 0.75rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }
    
    .data-table td {
        padding: 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }
    
    /* Hide Sort Order column on mobile for agencies and clients */
    #agenciesTable th:nth-child(2),
    #agenciesTable td:nth-child(2),
    #clientsTable th:nth-child(2),
    #clientsTable td:nth-child(2) {
        display: none;
    }
    
    /* Name column - left align */
    #agenciesTable th:nth-child(1),
    #agenciesTable td:nth-child(1),
    #clientsTable th:nth-child(1),
    #clientsTable td:nth-child(1) {
        text-align: left;
    }
    
    /* Actions column - right align */
    #agenciesTable th:nth-child(3),
    #agenciesTable td:nth-child(3),
    #clientsTable th:nth-child(3),
    #clientsTable td:nth-child(3) {
        text-align: right;
    }
    
    /* Users table - Name/Email left, Role center, Actions right */
    #usersTable th:nth-child(1),
    #usersTable td:nth-child(1) {
        text-align: left;
    }
    
    #usersTable th:nth-child(2),
    #usersTable td:nth-child(2) {
        text-align: center;
    }
    
    #usersTable th:nth-child(3),
    #usersTable td:nth-child(3) {
        text-align: right;
    }
}

/* ===========================
   Badges & Status (Bailey-style)
   =========================== */
.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-active,
.status-active {
    background: #dbeafe;
    color: #1e40af;
}

.badge-complete,
.status-complete {
    background: #d1fae5;
    color: #065f46;
}

.badge-on-hold,
.status-on-hold {
    background: #fef3c7;
    color: #92400e;
}

.badge-cancelled,
.status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    background: var(--gray-200);
    color: var(--gray-700);
}

/* ===========================
   Forms (Mobile-Friendly)
   =========================== */
.form-group {
    margin-bottom: var(--space-lg);
}

label {
    display: block;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    color: var(--gray-900);
    transition: all 0.2s ease;
    font-family: inherit;
    min-height: 44px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Disabled and readonly inputs - greyed out */
input[disabled],
input[readonly],
select[disabled],
select[readonly],
textarea[disabled],
textarea[readonly] {
    background-color: var(--gray-100) !important;
    color: var(--gray-600) !important;
    cursor: not-allowed !important;
    border-color: var(--gray-300) !important;
    opacity: 0.7;
}

input[disabled]:focus,
input[readonly]:focus,
select[disabled]:focus,
select[readonly]:focus,
textarea[disabled]:focus,
textarea[readonly]:focus {
    border-color: var(--gray-300) !important;
    box-shadow: none !important;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.form-error {
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Single Column on Mobile */
@media (max-width: 767px) {
    .form-row {
        display: block !important;
    }
    
    .form-row .form-group {
        margin-bottom: var(--space-md);
    }
}

/* ===========================
   Loading States (Bailey-style)
   =========================== */
.loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-card {
    height: 200px;
}

.spinner {
    border: 2px solid var(--gray-200);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================
   Project Cards (View Projects Page)
   =========================== */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.project-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--space-lg);
    border: 1px solid var(--gray-200);
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.project-card-title h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.25rem 0;
}

.project-card-number {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
}

.project-card-info {
    margin-bottom: var(--space-md);
}

.project-info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.project-info-row svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--gray-500);
}

.project-info-label {
    font-weight: 500;
    color: var(--gray-600);
}

.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--gray-200);
}

.project-lots-count {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* ===========================
   Search & Filter Section (View Projects)
   =========================== */
.search-filter-card {
    padding: var(--space-xl);
}

.search-header {
    margin-bottom: var(--space-lg);
}

.search-title {
    display: flex;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.search-title svg {
    flex-shrink: 0;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: var(--space-xl);
}

.search-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    color: var(--gray-900);
    transition: all 0.2s ease;
    min-height: 44px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--gray-500);
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.clear-search-btn.show {
    display: flex;
}

.filters-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (min-width: 768px) {
    .filters-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.filter-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    color: var(--gray-900);
    transition: all 0.2s ease;
    min-height: 44px;
    cursor: pointer;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--gray-200);
    margin-top: var(--space-md);
}

.results-count {
    font-size: 0.9375rem;
    color: var(--primary);
    font-weight: 500;
}

.btn-clear-filters {
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
}

@media (max-width: 767px) {
    .search-filter-card {
        padding: var(--space-lg);
    }
    
    .filter-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .btn-clear-filters {
        width: 100%;
    }
}

/* ===========================
   Links
   =========================== */
.link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===========================
   Section Spacing
   =========================== */
.dashboard-section,
.section {
    margin-bottom: var(--space-2xl);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

@media (max-width: 767px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
}

/* ===========================
   Modals
   =========================== */
.modal,
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    padding: var(--space-md);
}

.modal.active,
.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.modal-header .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-600);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.modal-header .close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.modal-body {
    padding: var(--space-lg);
}

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

/* Toolbar spacing */
.toolbar {
    margin-bottom: var(--space-lg);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
    }
    
    .toolbar .btn {
        width: 100%;
    }
}

/* Mobile: Full-screen modals */
@media (max-width: 767px) {
    .modal,
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin: 0;
    }
}

/* ===========================
   Utility Classes
   =========================== */
.text-center {
    text-align: center;
}

.text-muted {
    color: var(--gray-600);
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

/* Hide on Mobile */
@media (max-width: 767px) {
    .mobile-hidden {
        display: none !important;
    }
}

/* Hide on Desktop */
@media (min-width: 768px) {
    .desktop-hidden {
        display: none !important;
    }
}

/* ===========================
   Animations & Transitions
   =========================== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scroll */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    .navbar,
    .btn,
    .hamburger,
    .nav-overlay {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card,
    .action-card,
    .table-container {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}

/* ============================================
   REDESIGN STYLES - Applied from Test Page
   December 2025 - CMS Frontend Cleanup
   ============================================ */

/* ===========================
   Navigation Bar (New Design)
   =========================== */
.navbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 16px;
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    color: #4b5563;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 40px;
}

.logo-icon {
    background: #2563eb;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

.site-name {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.nav-links {
    display: flex;
    gap: 24px;
    flex: 1;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: #2563eb;
    background: #f3f4f6;
}

.nav-links a.active {
    color: #2563eb;
    background: #eff6ff;
}

.nav-icon {
    width: 20px;
    height: 20px;
    color: currentColor;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-email {
    font-size: 14px;
    color: #111827;
}

.user-role {
    color: #6b7280;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #6b7280;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: #2563eb;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.logout-link {
    color: #ef4444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.logout-link:hover {
    text-decoration: underline;
}

/* ===========================
   Breadcrumb Navigation
   =========================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #6b7280;
}

.breadcrumb-icon {
    width: 16px;
    height: 16px;
    color: #6b7280;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #2563eb;
}

.breadcrumb-separator {
    color: #d1d5db;
}

.breadcrumb-current {
    color: #111827;
}

/* ===========================
   Page Container
   =========================== */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    color: #6b7280;
}

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

.page-header-flex h1 {
    margin-bottom: 0;
}

/* ===========================
   Admin Cards Grid
   =========================== */
.admin-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 1400px) {
    .admin-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.admin-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    text-decoration: none;
    transition: all 0.2s;
    display: block;
}

.admin-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

.card-icon.yellow {
    background: #fef3c7;
}

.card-icon.yellow svg {
    color: #d97706;
}

.card-icon.blue {
    background: #dbeafe;
}

.card-icon.blue svg {
    color: #2563eb;
}

.card-icon.green {
    background: #d1fae5;
}

.card-icon.green svg {
    color: #059669;
}

.card-icon.purple {
    background: #e9d5ff;
}

.card-icon.purple svg {
    color: #7c3aed;
}

.card-icon.orange {
    background: #fed7aa;
}

.card-icon.orange svg {
    color: #ea580c;
}

.card-icon.indigo {
    background: #e0e7ff;
}

.card-icon.indigo svg {
    color: #4f46e5;
}

.admin-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.admin-card p {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

/* ===========================
   Buttons
   =========================== */
.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

/* ===========================
   Table Styles
   =========================== */
.table-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

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

.data-table thead {
    background: #f9fafb;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e5e7eb;
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #111827;
}

.data-table tbody tr:hover {
    background: #f9fafb;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===========================
   Badges
   =========================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-purple {
    background: #f3e8ff;
    color: #7c3aed;
}

.badge-blue {
    background: #dbeafe;
    color: #2563eb;
}

.badge-green {
    background: #d1fae5;
    color: #059669;
}

.badge-gray {
    background: #f3f4f6;
    color: #6b7280;
}

/* ===========================
   Icon Buttons
   =========================== */
.icon-btn.edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    color: #6b7280;
    transition: color 0.2s;
}

.icon-btn.edit-btn:hover {
    color: #2563eb;
}

.icon-btn.edit-btn svg {
    width: 18px;
    height: 18px;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 1024px) {
    .admin-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .navbar-container {
        flex-wrap: wrap;
        position: relative;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: -24px;
        right: -24px;
        background: white;
        flex-direction: column;
        padding: 16px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        border-top: 1px solid #e5e7eb;
        width: calc(100% + 48px);
        z-index: 1001;
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .nav-user {
        margin-left: auto;
    }

    .user-email {
        display: none;
    }

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

    .page-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .btn-primary {
        width: 100%;
        justify-content: center;
    }

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

/* ===========================
   Section Divider
   =========================== */
.section-divider {
    height: 2px;
    background: #e5e7eb;
    margin: 60px 0;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 24px;
}

/* ===========================
   Dashboard Action Cards
   =========================== */
.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.action-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
}

.action-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.action-card p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.action-card .btn {
    margin-right: 8px;
    margin-bottom: 8px;
}

/* ===========================
   Form Styles
   =========================== */
.form-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.required {
    color: #ef4444;
}

.help-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Input Group for prefixes (e.g., dollar sign, contract prefix) */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-prefix {
    padding: 0.75rem 1rem;
    background-color: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-weight: 500;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    min-height: 44px;
}

.input-group input {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    border-left: none;
}

.input-group input:focus {
    border-left: 1px solid var(--primary);
}

/* ===========================
   Search and Filter
   =========================== */
.search-filter-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 18px;
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.filter-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.results-count {
    font-size: 14px;
    color: #6b7280;
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* ===========================
   Projects Grid
   =========================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
}

.project-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

.project-number {
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
}

.project-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.project-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.project-meta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

/* ===========================
   Stats Cards
   =========================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon-blue {
    background: #dbeafe;
}

.stat-icon-blue svg {
    color: #2563eb;
}

.stat-icon-purple {
    background: #e9d5ff;
}

.stat-icon-purple svg {
    color: #7c3aed;
}

.stat-icon-green {
    background: #d1fae5;
}

.stat-icon-green svg {
    color: #059669;
}

.stat-icon-orange {
    background: #fed7aa;
}

.stat-icon-orange svg {
    color: #ea580c;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.stat-change {
    font-size: 12px;
    color: #059669;
    margin-top: 4px;
    font-weight: 500;
}

.stat-change.negative {
    color: #dc2626;
}

.stat-change.positive {
    color: #059669;
}

/* ===========================
   Section Headers
   =========================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.link {
    color: #2563eb;
    text-decoration: none;
    font-size: 14px;
}

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