/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Login Screen Styles */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 400px;
    width: 100%;
    padding: 2rem;
}

.login-logo {
    margin-bottom: 2rem;
    text-align: center;
}

#login-logo {
    max-width: 200px;
    height: auto;
}

.login-form {
    width: 100%;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}


.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--card-background);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-btn {
    width: 100%;
    background: linear-gradient(45deg, #662E00, #D47800);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Main App Hidden State */
.main-app.hidden {
    display: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    color: var(--text-primary);
    background: white;
    min-height: 100vh;
    font-size: 13px;
}

aside#sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 200px;
    background: white;
    color: var(--text-primary);
    padding: 1rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    border-right: 1px solid var(--border-color);
}

#logo-container {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

#logo {
    max-width: 100%;
    height: auto;
    max-height: 80px;
}

#nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#nav-menu button {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: left;
}

#nav-menu button:hover {
    background: #333333;
    color: white;
    border-color: #333333;
    transform: translateX(5px);
}

#nav-menu button.active {
    background: #333333;
    color: white;
    border-color: #333333;
}

main {
    margin-left: 220px;
    padding: 1.5rem;
    max-width: calc(100vw - 240px);
}

.section {
    display: none;
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.section.active {
    display: block;
}

h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(45deg, #662E00, #D47800);
    border-radius: 2px;
}

h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.client-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.client-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.client-details span {
    margin-right: 1rem;
}

.client-orders {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.client-orders h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.client-orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.client-order-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.client-order-item:hover {
    background: #ffffff;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.order-info {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 1rem;
    align-items: center;
}

.order-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.order-description {
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Override margin for client orders */
.client-order-item .order-description {
    margin-bottom: 0;
}

.order-amount {
    font-weight: 600;
    color: var(--success-color);
    font-size: 0.9rem;
}

.order-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Dashboard layout */
.dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.section-header h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.stats-table-container, .orders-table-container {
    background: var(--card-background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.stats-table, .orders-table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table th, .stats-table td,
.orders-table th, .orders-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.stats-table th, .orders-table th {
    background: #333333;
    font-weight: 600;
    color: white;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-table tbody tr, .orders-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stats-table tbody tr:hover, .orders-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

.stats-table tbody tr:last-child td,
.orders-table tbody tr:last-child td {
    border-bottom: none;
}

.stats-table td:first-child {
    font-weight: 500;
}

.stats-table td:last-child {
    font-weight: 700;
    color: black;
    text-align: center;
}

.total-row {
    background: transparent;
    border-top: 3px solid #662E00;
    border-bottom: 3px solid #D47800;
    margin-top: 0.5rem;
}

.total-row td {
    font-weight: 700 !important;
    color: #662E00 !important;
    padding: 1.2rem 1rem;
}

.total-row td:first-child {
    font-size: 1.1rem;
}

.orders-filter {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--card-background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.orders-filter label {
    font-weight: 500;
    color: var(--text-secondary);
}

.orders-filter select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-background);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.orders-filter select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}


/* Responsive design for dashboard */
@media (max-width: 1200px) {
    .dashboard-content {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .chart-container {
        height: 250px;
        padding: 1rem;
    }

    .chart-section h3 {
        font-size: 1rem;
    }
}

.stat-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #662E00, #D47800);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card span {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(45deg, #662E00, #D47800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(45deg, #662E00, #D47800);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--card-background);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0.2rem;
}

.btn-secondary:hover {
    background: #333333;
    color: white;
    border-color: #333333;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(45deg, #662E00, #D47800);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0.2rem;
    box-shadow: var(--shadow);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Orders controls */
.orders-controls {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-controls label {
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-controls select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-background);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.finished-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.finished-section h3 {
    color: var(--success-color);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Finished orders styling - remove colors and make them distinct */
#delivered-orders-list .order-item {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
    opacity: 0.7;
}

#delivered-orders-list .order-collapsed {
    background: transparent !important;
}

#delivered-orders-list .status-badge {
    background: #999 !important;
    color: white !important;
}

#delivered-orders-list .info-value.price {
    color: #666 !important;
}

#delivered-orders-list .info-value.paid-full {
    color: #666 !important;
}

#delivered-orders-list .info-value.paid-partial {
    color: #666 !important;
}

#delivered-orders-list .responsible-badge {
    background: #ccc !important;
    color: #333 !important;
}

/* Lists */
#orders-list, #clients-list, #users-list {
    margin-top: 2rem;
}

.order-item, .client-item, .user-item {
    background: rgba(245, 245, 245, 1);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.client-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
}

.client-item > div:first-child {
    flex: 1;
    padding-right: 1rem;
}

.client-item > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.order-item {
    padding: 1.3rem;
}

.order-item:hover, .client-item:hover, .user-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.order-item {
    flex-direction: column;
    align-items: flex-start;
}

.order-header {
    width: 100%;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.order-title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.order-title-with-edit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.order-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.etsy-indicator {
    font-family: serif;
    font-size: 1.1rem;
    font-weight: bold;
    color: #ff6b35;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 1px 2px rgba(255, 107, 53, 0.3);
}

.edit-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-icon-btn:hover {
    background: var(--border-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

.edit-icon-btn svg {
    stroke-width: 2.5px;
}

.next-responsible {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #0ea5e9;
}

.next-responsible strong {
    color: #0ea5e9;
}

.order-details {
    width: 100%;
}

.order-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.info-value.price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--success-color);
}

.info-value.paid-full {
    color: var(--success-color);
    font-weight: 600;
}

.info-value.paid-partial {
    color: var(--warning-color);
    font-weight: 600;
}

.next-step-section {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.next-step-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.category-compact {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
}

.action-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 2;
    justify-content: flex-end;
}

.task-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.responsible-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    color: white;
}

.responsible-badge.ms {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.responsible-badge.jb {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.responsible-badge.ip {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.responsible-badge.adr {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.task-complete-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    white-space: nowrap;
    background: #333333 !important;
    color: white !important;
    border: 2px solid #333333 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .next-step-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .action-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        width: 100%;
    }

    .task-complete-btn {
        width: 100%;
        text-align: center;
    }
}

.status-change-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.step-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.step-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.step-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.step-value.responsible {
    color: #0ea5e9;
    font-size: 1.3rem;
}

.step-value.action {
    color: var(--success-color);
}

.step-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.step-buttons button {
    background: #333333 !important;
    color: white !important;
    border: 2px solid #333333 !important;
}

.step-buttons button:hover {
    background: #555555 !important;
    border-color: #555555 !important;
}

.order-description, .order-notes {
    margin-bottom: 2.5rem;
}

.description-text, .notes-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-top: 0.5rem;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

/* Status history */
.order-status-history {
    margin-top: 1.5rem;
}

.status-history-header {
    margin-bottom: 1rem;
}

.status-history-list {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid var(--secondary-color);
}

.status-change-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.status-change-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.status-change-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.status-change-user {
    font-weight: 600;
    color: var(--primary-color);
}

.status-change-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.status-change-details {
    margin-top: 0.5rem;
}

.status-change-transition {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--background-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.order-collapsed {
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-collapsed:hover {
    background: rgba(245, 245, 245, 1);
}

.order-expanded {
    display: none;
}

.order-expanded.show {
    display: block;
}

.expand-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.expand-toggle:hover {
    background: var(--border-color);
    color: var(--primary-color);
}

.expand-toggle svg {
    stroke-width: 2.5px;
    transition: transform 0.3s ease;
}

.expand-toggle.expanded svg {
    transform: rotate(180deg);
}

.status-change-comment {
    margin: 0.5rem 0 0 0;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border-left: 3px solid var(--warning-color);
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-change-file {
    margin: 0.5rem 0 0 0;
    padding: 0.5rem;
    background: #f0f9ff;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    font-size: 0.9rem;
}

.status-change-file a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.status-change-file a:hover {
    text-decoration: underline;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
}

.status-new.ms { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; }
.status-payment_received.jb { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.status-invoice_created.ip { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.status-invoice_sent.ms { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; }
.status-sent_to_production.adr { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }
.status-accepted_by_production.adr { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }
.status-completed.ms { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; }
.status-accepted_by_ms.adr { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }
.status-packed.ip { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.status-courier_arranged.ip { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.status-shipped.ip { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.status-delivered.jb { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.status-finished.jb { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }

/* Fallback for non-ETSY orders */
.status-new { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.status-proforma_sent.jb { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.status-proforma_sent { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); color: black; }
.status-payment_received { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.status-invoice_created { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.status-invoice_sent { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; }
.status-sent_to_production { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }
.status-accepted_by_production { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }
.status-completed { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; }
.status-accepted_by_ms { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; }
.status-waiting_for_fullpayment.jb { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.status-waiting_for_fullpayment { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.status-paid { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }
.status-packed { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.status-courier_arranged { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.status-shipped { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.status-delivered { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.status-finished { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }

/* Forms */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
}

input, select, textarea {
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--card-background);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* Checkbox styling */
.checkbox-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.checkbox-item {
    display: flex;
    align-items: center;
}

.checkbox-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.checkbox-item label:hover {
    background-color: #e9ecef;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007bff;
    cursor: pointer;
}

/* EU Country Select styling */
#client-eu-country {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--card-background);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

#client-eu-country:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Compact form styling */
form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 600px;
}

input, select, textarea {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    background: var(--card-background);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* Category select styling */
.form-group select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--card-background);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

.form-group select:disabled {
    background: #f5f5f5;
    color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Full width textarea for order description */
.form-group textarea#order-description {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Order category info styling */
.order-category-info {
    margin-bottom: 1.5rem;
}

.category-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.category-item {
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

/* Order package info styling */
.order-package-info {
    margin-bottom: 2.5rem;
}

.package-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.package-item {
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border-left: 3px solid var(--success-color);
}

/* Invoice icon button styling */
.invoice-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invoice-icon-btn:hover {
    background: var(--border-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

.invoice-icon-btn svg {
    stroke-width: 2.5px;
}

/* Payment icon button styling */
.payment-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-icon-btn:hover {
    background: var(--border-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

.payment-icon-btn svg {
    stroke-width: 2.5px;
}

/* Package dimensions inline */
.package-dimensions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.package-dimensions input {
    flex: 1;
    min-width: 80px;
    max-width: 120px;
}

/* Orders summary table styles */
.orders-summary-section {
    margin-top: 2rem;
}

.orders-summary-table-container {
    background: var(--card-background);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 1rem;
}

.orders-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.orders-summary-table th, .orders-summary-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.orders-summary-table th {
    background: #333333;
    font-weight: 600;
    color: white;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.orders-summary-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.orders-summary-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.05);
}

.orders-summary-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive table for orders summary */
@media (max-width: 1200px) {
    .orders-summary-table {
        font-size: 0.75rem;
    }

    .orders-summary-table th, .orders-summary-table td {
        padding: 0.4rem 0.5rem;
    }
}

@media (max-width: 768px) {
    .orders-summary-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .orders-summary-table {
        min-width: 800px;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--card-background);
    margin: 3% auto;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 700px;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close {
    color: var(--text-secondary);
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close:hover,
.close:focus {
    color: var(--text-primary);
    background: var(--border-color);
    transform: rotate(90deg);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Message notifications */
.message-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.message-notification.show {
    transform: translateX(0);
}

.message-notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.message-notification.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Status modal improvements */
#status-modal-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#status-modal-content p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

#status-modal-content p strong {
    color: var(--text-primary);
    font-weight: 600;
}

#status-comment {
    width: 100%;
    min-height: 80px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}

#status-comment:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    main {
        padding: 1rem;
    }

    header {
        padding: 0.5rem 1rem;
    }

    #nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-card span {
        font-size: 2.5rem;
    }

    .section {
        padding: 1.5rem;
    }

    .order-item, .client-item, .user-item {
        padding: 1.5rem;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-content {
        margin: 1rem;
        padding: 1.5rem;
        width: calc(100% - 2rem);
    }

    .order-title-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .order-title {
        font-size: 1.25rem;
    }

    .message-notification {
        left: 10px;
        right: 10px;
        top: 10px;
    }

    .modal-buttons {
        flex-direction: column;
    }

    .modal-buttons button {
        width: 100%;
    }

    .order-collapsed {
        padding: 1rem;
    }

    .order-info-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .next-step-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .step-item {
        text-align: center;
    }
}