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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --border-color: #dee2e6;
    
    /* Modern color palette */
    --primary-gradient: linear-gradient(135deg, #5b6ef7 0%, #7d66ff 100%);
    --primary-hover: #4a5de6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Shadows */
    --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 -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    background-color: #f5f7fa;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
}

.navbar-menu a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

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

.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 3rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer {
    background: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: #666;
    border-top: 1px solid var(--border-color);
}

/* CRM shell */
.crm-shell {
    background: #f5f7fa;
    min-height: 100vh;
    font-size: 13px;
    color: #1f2937;
    font-weight: 400;
}

.crm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.98);
}

.crm-brand {
    display: flex;
    flex-direction: column;
}

.crm-logo {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.crm-tagline {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.crm-nav {
    display: flex;
    gap: 4px;
}

.crm-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: #6b7280;
    font-weight: 500;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.15s ease;
    position: relative;
}

.crm-nav a:hover {
    color: #5b6ef7;
    background: #f0f4ff;
}

.crm-nav a:hover .icon-svg {
    color: #5b6ef7 !important;
}

.crm-nav a.active {
    color: #1f2937;
    background: #f0f4ff;
    font-weight: 600;
}

.crm-nav a.active .icon-svg {
    color: #5b6ef7 !important;
}

.crm-nav a.active::after {
    display: none;
}

.crm-nav a .icon-svg {
    color: #6b7280;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

/* Professional spacing */
.crm-actions {
    gap: 6px;
}

/* Professional improvements */
.btn-ghost {
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-weight: 500;
    color: #374151;
    font-size: 12px;
    transition: all 0.15s ease;
}

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

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1f2937;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
}

.user-info strong {
    font-size: 13px;
    color: #111827;
    font-weight: 600;
    display: block;
}

.user-info small {
    font-size: 11px;
    color: #6b7280;
}

.crm-user {
    display: flex;
    align-items: center;
    gap: 18px;
}

.btn-ghost {
    border: 1px solid #dfe4f2;
    background: #fff;
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    font-weight: 600;
    color: #3c4472;
}

.quick-wrapper {
    position: relative;
}

.quick-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    background: #fff;
    box-shadow: 0 15px 45px rgba(15, 22, 48, 0.15);
    border-radius: 16px;
    padding: 12px;
    display: none;
    min-width: 220px;
}

.quick-dropdown.open {
    display: block;
}

.quick-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #283254;
    font-weight: 500;
    transition: all 0.15s ease;
}

.quick-dropdown a:hover {
    background: #f0f4ff;
    color: #5b6ef7;
}

.quick-dropdown a:hover .icon-svg {
    color: #5b6ef7 !important;
}

.quick-dropdown a .icon-svg {
    color: #6b7280;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.btn-ghost:hover .icon-svg {
    color: #5b6ef7 !important;
}

.user-menu-wrapper {
    position: relative;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.user-menu:hover {
    opacity: 0.9;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b6ef7, #7d66ff);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info small {
    color: #7f87ab;
    font-size: 12px;
}

.user-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    background: #fff;
    box-shadow: 0 15px 45px rgba(15, 22, 48, 0.15);
    border-radius: 16px;
    padding: 12px;
    display: none;
    min-width: 240px;
    z-index: 1000;
}

.user-dropdown.open {
    display: block;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #283254;
    font-weight: 500;
    transition: all 0.15s ease;
}

.user-dropdown a:hover {
    background: #f0f4ff;
    color: #5b6ef7;
}

.user-dropdown a:hover .icon-svg {
    color: #5b6ef7 !important;
}

.user-dropdown a .icon-svg {
    color: #6b7280;
    transition: color 0.15s ease;
    flex-shrink: 0;
}

.user-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

.user-dropdown form button:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}

.user-dropdown form button:hover .icon-svg {
    color: #dc2626 !important;
}

.crm-content {
    padding: 16px 20px;
    width: 100%;
}

.crm-panel {
    background: #ffffff;
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.crm-panel:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

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

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

.page-header h1 {
    margin: 0;
    font-size: 20px;
    color: #1e2751;
}

.header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.crm-panel header h2 {
    margin: 0;
    font-size: 15px;
    color: #111827;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.crm-panel header p.hint {
    margin: 3px 0 0 0;
    font-size: 11px;
    color: #6b7280;
    line-height: 1.4;
}

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

.crm-stat {
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, #f8f9ff, #ffffff);
    border: 1px solid #edf0fc;
}

.crm-stat span {
    display: block;
    color: #848dad;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.crm-stat strong {
    font-size: 26px;
    display: block;
    color: #1f2351;
    margin-top: 6px;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.crm-table th,
.crm-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    transition: background-color 0.15s ease;
}

.crm-table th {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    background: #f9fafb;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 10px;
}

.crm-table tbody tr {
    transition: all 0.15s ease;
}

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

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

.crm-table td {
    color: #111827;
    font-size: 12px;
    font-weight: 400;
    padding: 8px 10px;
}

.crm-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc, #eef2fb);
    border: 1px dashed #c9cee3;
    border-radius: 16px;
}

.empty-state span {
    font-size: 28px;
    line-height: 1;
}

.empty-state h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2351;
}

.empty-state p {
    margin: 0;
    color: #5c6584;
}

@media (max-width: 900px) {
    .crm-panel header,
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .header-actions,
    .crm-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

.category-board {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-headline {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
}

.category-headline strong {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-kicker {
    font-size: 0.8rem;
    color: #8b93b6;
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.08em;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.category-group {
    background: #fff;
    border: 1px solid #dfe4f2;
    border-radius: 14px;
    padding: 16px;
}

.category-group h3 {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #2b3158;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid #dfe4f2;
    font-size: 0.85rem;
    text-decoration: none;
    color: #2f3a5f;
    transition: all 0.2s ease;
    background: #f9fafc;
}

.category-chip:hover {
    border-color: #667eea;
    color: #667eea;
}

.category-chip.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 6px 14px rgba(102, 126, 234, 0.25);
}

.category-chip.reset {
    background: transparent;
    border-style: dashed;
    color: #8b93b6;
}

.category-empty {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 32px;
    background: linear-gradient(135deg, #f8fafc, #eef2fb);
    border: 1px dashed #c9cee3;
    border-radius: 16px;
}

.category-empty__icon {
    font-size: 32px;
    line-height: 1;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: #ffffff;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px rgba(91, 110, 247, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    letter-spacing: -0.01em;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4a5de6, #6b55ff);
    box-shadow: 0 4px 12px rgba(91, 110, 247, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    border: 1px solid #d1d5db;
    background: #eef0fb;
    color: #4b567f;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    letter-spacing: -0.01em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #e0e7ff;
    border-color: #9ca3af;
    color: #4a90e2;
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.2);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-success {
    background: #34c759;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.btn-warning {
    background: #ff9f0a;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.badge-muted {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef1ff;
    color: #5b6cf3;
    font-size: 12px;
}

.badge-info {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 6px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.badge-info:hover {
    background: #bae6fd;
    color: #075985;
}

.characteristics-preview {
    position: relative;
    display: inline-block;
}

.text-muted {
    color: #9ca3af;
    font-size: 0.9em;
}

.characteristics-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 12px 16px;
    background: #1f2937;
    color: #f9fafb;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.6;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    max-width: 400px;
    word-wrap: break-word;
}

.characteristics-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.characteristics-preview:hover .characteristics-tooltip {
    opacity: 1;
    pointer-events: auto;
}

.characteristics-tooltip div {
    white-space: normal;
    margin-bottom: 6px;
}

.characteristics-tooltip div:last-child {
    margin-bottom: 0;
}

.characteristics-tooltip strong {
    color: #60a5fa;
}

.characteristics-tooltip em {
    color: #9ca3af;
    font-style: normal;
}

/* Sticky table columns */
.crm-table th[style*="position: sticky"],
.crm-table td[style*="position: sticky"] {
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.crm-table th[style*="position: sticky"][style*="right"],
.crm-table td[style*="position: sticky"][style*="right"] {
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.1);
}

/* Characteristic filter inputs in table header */
.crm-table th form {
    margin: 0;
}

.crm-table th input[type="text"] {
    width: 100%;
    padding: 4px 6px;
    font-size: 0.8em;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
}

.crm-table th input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.crm-table th input[type="text"][list] {
    width: 100%;
    padding: 4px 6px;
    font-size: 0.8em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s;
}

.crm-table th input[type="text"][list]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.form-stack {
    display: grid;
    gap: 12px;
}

.form-stack label {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
    letter-spacing: -0.01em;
}

.form-stack input,
.form-stack select,
.form-stack textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 7px 11px;
    font-size: 13px;
    background: #ffffff;
    transition: all 0.15s ease;
    font-family: inherit;
    color: #111827;
    line-height: 1.5;
}

.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus {
    outline: none;
    border-color: #5b6ef7;
    box-shadow: 0 0 0 3px rgba(91, 110, 247, 0.08);
}

.form-stack input:hover,
.form-stack select:hover,
.form-stack textarea:hover {
    border-color: #9ca3af;
}

.form-stack input::placeholder,
.form-stack textarea::placeholder {
    color: #9ca3af;
    font-size: 12px;
}

/* Compact form improvements */
.crm-form-card .form-grid {
    gap: 10px;
}

.crm-form-card label {
    margin-bottom: 4px;
}

.crm-form-card small {
    font-size: 11px;
    line-height: 1.3;
    margin-top: 2px;
}

.crm-form-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.crm-form-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-color: #d1d5db;
}

.errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.5;
}

.form-grid {
    display: grid;
    gap: 10px;
}

.form-grid.cols-2 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.form-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    grid-auto-flow: row;
}

/* Professional form card */
.crm-form-card .form-grid {
    gap: 10px;
}

.crm-form-card .form-grid label {
    margin-bottom: 5px;
}

/* Document links improvements */
.document-link {
    transition: all 0.2s ease !important;
}

.document-link:hover {
    background: #f0f4ff !important;
    border-color: #4a90e2 !important;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15) !important;
    transform: translateY(-1px);
}

/* Button improvements */
.btn-secondary {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-secondary:hover {
    background: #e0e7ff !important;
    color: #4a90e2 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Document section improvements */
.crm-form-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
    margin: 0 0 12px 0;
}

.crm-form-card h4 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.crm-form-card h4::before {
    content: '';
    width: 2px;
    height: 14px;
    background: linear-gradient(135deg, #5b6ef7, #7d66ff);
    border-radius: 1px;
    margin-right: 4px;
}

/* Modal improvements */
.modal {
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    animation: slideUp 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

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

/* Form input improvements */
.form-stack input:focus,
.form-stack select:focus,
.form-stack textarea:focus {
    outline: none;
    border-color: #5b6ef7 !important;
    box-shadow: 0 0 0 3px rgba(91, 110, 247, 0.1) !important;
}

/* Progress indicators */
.hint {
    color: #6b7280;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
}

/* Empty state improvements */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state span {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

/* Modern improvements */
.crm-header {
    backdrop-filter: blur(8px);
}

.crm-nav a {
    position: relative;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.crm-nav a:hover {
    background: #f0f2ff;
}

.crm-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 12px;
    right: 12px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Checkbox improvements */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #5b6ef7;
    border-radius: 4px;
}

/* Select improvements */
select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #5b6ef7;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Badge improvements */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-draft {
    background: #f3f4f6;
    color: #6b7280;
}

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

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

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

/* Tooltip improvements */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    margin-bottom: 2px;
    z-index: 1000;
}

/* Smooth transitions for all interactive elements */
a, button, input, select, textarea {
    transition: all 0.2s ease;
}

/* Focus visible improvements */
*:focus-visible {
    outline: 2px solid #5b6ef7;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Card hover effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* Improved autocomplete dropdown */
.autocomplete-dropdown {
    animation: slideDown 0.2s ease;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.autocomplete-dropdown option:hover {
    background: #f0f2ff;
}

/* Progress bar */
.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Improved notifications */
.notification {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Icon System - SVG Outline Icons */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.2s ease;
    color: #6b7280;
}

.icon-sm {
    width: 14px;
    height: 14px;
}

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

.icon-lg {
    width: 18px;
    height: 18px;
}

.icon-xl {
    width: 20px;
    height: 20px;
}

/* Icon colors on hover and active */
.btn-secondary:hover .icon,
.doc-tab-btn:hover .icon {
    color: #5b6ef7;
}

.doc-tab-btn[style*="background: rgb(91, 110, 247)"] .icon,
.doc-tab-btn[style*="background: #5b6ef7"] .icon {
    color: white;
}

/* Specific icon colors */
.icon-money { color: #10b981; }
.icon-shipment { color: #3b82f6; }
.icon-message { color: #6b7280; }
.icon-briefcase { color: #6b7280; }
.icon-invoice { color: #6b7280; }
.icon-clipboard { color: #6b7280; }
.icon-document { color: #6b7280; }
.icon-send { color: #6b7280; }
.icon-attachment { color: #6b7280; }
.icon-folder { color: #5b6ef7; }
.icon-upload { color: white; }
.icon-delete { color: #ef4444; }
.icon-box { color: #6b7280; }

/* Responsive improvements */
@media (max-width: 768px) {
    .crm-panel {
        padding: var(--spacing-md);
        border-radius: var(--radius-lg);
    }
    
    .crm-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

