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

:root {
    --primary: #5a6c57;        /* Sage dark (was purple #667eea) */
    --primary-dark: #4a5847;   /* Darker sage for hover states */
    --secondary: #7d8f69;      /* Sage light (was purple #764ba2) */
    --success: #48bb78;        /* Keep - complements sage */
    --warning: #ed8936;        /* Keep - good contrast */
    --danger: #f56565;         /* Keep - clear alert */
    --dark: #2d3748;           /* Keep - neutral dark */
    --gray: #718096;           /* Keep - neutral gray */
    --light: #f8f7f5;          /* Warmer background (was cool #f7fafc) */
    --white: #ffffff;          /* Keep - pure white */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light);
    display: flex;
    min-height: 100vh;
}

/* App Container - for new pages */
.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Main Content - for new pages */
.main-content {
    margin-left: 240px;
    padding: 30px;
    flex: 1;
    width: calc(100% - 240px);
}

/* Page Header - for new pages */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    color: var(--dark);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

/* Navigation Items - for new sidebar style */
.nav-menu {
    list-style: none;
    padding: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 4px 12px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    transform: translateX(3px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left: 3px solid white;
}

.nav-icon {
    font-size: 1.2rem;
}

.nav-label {
    font-size: 0.95rem;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    list-style: none;
}

.nav-links li a {
    display: block;
    padding: 12px 20px;
    margin: 4px 12px;                      /* Add margin for pill shape */
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 8px;                    /* Soft rounded corners */
    transition: all 0.2s ease;
}

.nav-links li a:hover {
    background: rgba(255, 255, 255, 0.12);  /* Slightly stronger glow */
    color: white;
    transform: translateX(3px);             /* Subtle right shift */
}

.nav-links li a.active {
    background: rgba(255, 255, 255, 0.15);  /* Active state stronger */
    color: white;
    border-left: 3px solid white;
}

/* Main Content */
.content {
    margin-left: 240px;
    padding: 30px;
    flex: 1;
}

.content h2 {
    color: var(--dark);
    margin-bottom: 24px;
    font-size: 1.75rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h3 {
    color: var(--gray);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.big-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.target {
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(90, 108, 87, 0.15);  /* Sage glow */
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 1px solid #e2e8f0;
}

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

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

tr:hover {
    background: #f8fafc;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending { background: #fef3c7; color: #d97706; }
.status-approved { background: #d1fae5; color: #059669; }
.status-production { background: #dbeafe; color: #2563eb; }
.status-complete { background: #e0e7ff; color: #4f46e5; }

/* Quote Builder specific */
.quote-section {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.quote-section h3 {
    margin-bottom: 16px;
    color: var(--dark);
    font-size: 1.1rem;
}

.component-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.quote-total {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: right;
}

.quote-total .amount {
    font-size: 2.5rem;
    font-weight: 700;
}

.placeholder {
    color: var(--gray);
    font-style: italic;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h3 {
    margin-bottom: 20px;
    color: var(--dark);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    background: #2c3e50;
    color: white;
    font-weight: 600;
}

.data-table tr:hover {
    background: #f5f5f5;
    cursor: pointer;
}

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

/* Legacy table class names for compatibility */
.clients-table,
.projects-table,
.quotes-table,
.orders-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.clients-table th, .clients-table td,
.projects-table th, .projects-table td,
.quotes-table th, .quotes-table td,
.orders-table th, .orders-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.clients-table th,
.projects-table th,
.quotes-table th,
.orders-table th {
    background: #2c3e50;
    color: white;
    font-weight: 600;
}

.clients-table tr:hover,
.projects-table tr:hover,
.quotes-table tr:hover,
.orders-table tr:hover {
    background: #f5f5f5;
}

/* Action Buttons */
.btn-edit {
    padding: 6px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-delete {
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-left: 8px;
}

.btn-delete:hover {
    background: #c0392b;
}

.btn-view {
    padding: 6px 12px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-view:hover {
    background: #7f8c8d;
}

/* Filters */
.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.filters input {
    width: 250px;
}

/* Status Badges */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    display: inline-block;
}

.status-active {
    background: #d1fae5;
    color: #059669;
}

.status-completed {
    background: #e0e7ff;
    color: #4f46e5;
}

.status-on-hold {
    background: #fef3c7;
    color: #d97706;
}

.status-draft {
    background: #ffeaa7;
    color: #856404;
}

.status-sent {
    background: #81ecec;
    color: #0c5460;
}

.status-approved {
    background: #55efc4;
    color: #155724;
}

.status-rejected {
    background: #fab1a0;
    color: #721c24;
}

/* Loading, Empty, and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1rem;
}

.empty-state a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: inline-block;
}

.empty-state a:hover {
    background: rgba(90, 108, 87, 0.08);  /* Soft sage tint */
    transform: translateY(-1px);
}

.error-state {
    text-align: center;
    padding: 40px;
    color: var(--danger);
    font-size: 1rem;
    background: #fee;
    border-radius: 8px;
    margin: 20px 0;
}

/* Helper Classes */
.client-name,
.client-company {
    color: #888;
    font-size: 0.9rem;
}

.due-date {
    font-size: 0.9rem;
}

.due-date.overdue {
    color: #dc2626;
    font-weight: 600;
}

.due-date.soon {
    color: #d97706;
    font-weight: 500;
}

.due-date.ok {
    color: #666;
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 300px;
    font-size: 1rem;
}

/* Detail Page Header with Breadcrumbs */
.detail-header {
    background: linear-gradient(180deg, #5a6c57 0%, #7d8f69 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.detail-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.detail-header .logo:hover {
    opacity: 0.9;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: white;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.breadcrumb a:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.breadcrumb-separator {
    opacity: 0.6;
    margin: 0 0.25rem;
}

.breadcrumb .current-page {
    opacity: 0.9;
    font-weight: 500;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-secondary {
    background-color: #e2e8f0;
    color: #4a5568;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Designer Tags */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 40px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
}

.tag-container:empty::before {
    content: 'No designers assigned yet';
    color: #999;
    font-style: italic;
}

.designer-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e0e7ff;
    color: #3730a3;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.9rem;
}

.designer-tag button {
    background: none;
    border: none;
    color: #3730a3;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    margin: 0;
}

.designer-tag button:hover {
    color: #1e1b4b;
}
