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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    line-height: 1.6;
}

body.modal-open {
    overflow: hidden;
}

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

.header {
    background: #2c3e50;
    color: white;
    padding: 0.75rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header h1 {
    font-size: 1.3rem;
    margin: 0;
}

.hamburger {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: all 0.3s;
    border-radius: 2px;
}

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

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

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

.header nav {
    display: flex;
    align-items: center;
}

.header nav a {
    color: white;
    text-decoration: none;
    margin-left: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.3s;
    font-size: 0.9rem;
}

.header nav a:hover {
    background: rgba(255,255,255,0.1);
}

.header nav a small {
    font-size: 0.75rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .header nav {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        background: #2c3e50;
        flex-direction: column;
        width: 100% !important;
        box-shadow: -2px 4px 8px rgba(0,0,0,0.2);
        border-radius: 0 0 0 8px;
        padding: 10px 0;
        margin-top: 0.75rem;
    }
    
    .header nav.active {
        display: flex;
    }
    
    .header nav a {
        margin: 0;
        padding: 12px 20px;
        border-radius: 0;
        width: 100%;
        text-align: left;
    }
    
    .header nav a:hover {
        background: rgba(255,255,255,0.15);
    }
    
    .header h1 {
        font-size: 1.1rem;
    }
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.stat-card.warning .value {
    color: #e74c3c;
}

.stat-card.success .value {
    color: #27ae60;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color, #3498db);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-color, #3498db);
    filter: brightness(0.9);
}

.btn-success {
    background: var(--success-color, #27ae60);
    color: white;
}

.btn-success:hover {
    background: var(--success-color, #27ae60);
    filter: brightness(0.9);
}

.btn-danger {
    background: var(--danger-color, #e74c3c);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-color, #e74c3c);
    filter: brightness(0.9);
}

.btn-warning {
    background: var(--warning-color, #f39c12);
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table th {
    background: #ecf0f1;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #ecf0f1;
}

table tr:hover {
    background: #f8f9fa;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-quote { background: #ecf0f1; color: #7f8c8d; }
.status-approved { background: #d4edda; color: #155724; }
.status-in-production { background: #fff3cd; color: #856404; }
.status-completed { background: #d1ecf1; color: #0c5460; }
.status-delivered { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-paid { background: #d4edda; color: #155724; }
.status-overdue { background: #f8d7da; color: #721c24; }

.login-container {
    max-width: 400px;
    margin: 100px auto;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.alert {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
}

@media (max-width: 768px) {
    .modal-content {
        margin: 20px;
        padding: 20px;
        max-width: calc(100% - 40px);
    }
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #000;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

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

.badge-primary {
    background: #3498db;
    color: white;
}

.badge-secondary {
    background: #95a5a6;
    color: white;
}

.badge-success {
    background: #27ae60;
    color: white;
}

.badge-danger {
    background: #e74c3c;
    color: white;
}

/* Drag and Drop Styles */
.draggable-card {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: move;
}

.drag-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    cursor: grab;
    opacity: 0.4;
    transition: opacity 0.2s;
    z-index: 10;
    color: #95a5a6;
}

.drag-handle:hover {
    opacity: 0.8;
}

.draggable-card:hover .drag-handle {
    opacity: 0.6;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Dragging states */
.dragging {
    opacity: 0.4;
    transform: scale(0.95);
}

.dragging-touch {
    opacity: 0.9;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transform: scale(1.05);
}

.drag-over {
    border: 2px dashed #3498db;
    background: rgba(52, 152, 219, 0.05);
}

.placeholder {
    border: 2px dashed #95a5a6;
    background: rgba(149, 165, 166, 0.1);
    opacity: 0.3;
}

/* Ensure stat cards maintain grid layout */
.dashboard-grid .stat-card {
    position: relative;
}

/* Responsive drag handle positioning */
@media (max-width: 768px) {
    .drag-handle {
        top: 5px;
        right: 5px;
        width: 20px;
        height: 20px;
    }
    
    .draggable-card {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Ensure cards don't break layout when dragging */
.draggable-card-wrapper {
    position: relative;
}
