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

:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #f97316;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.logo-img {
    max-width: 200px;
    height: auto;
    border-radius: 6px;
}

.logo-subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: 400;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-details {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-company {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Navigation */
.nav {
    background: rgba(0,0,0,0.15);
    padding: 0 2rem;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 0;
}

.nav-item {
    padding: 1rem 1.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-item.active {
    color: white;
    border-bottom-color: var(--secondary);
    background: rgba(255,255,255,0.1);
}

/* Main Content */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.page-header-content h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.page-header-content p {
    color: var(--gray-500);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-content {
    
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-action {
    font-size: 0.85rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.card-action:hover {
    text-decoration: underline;
}

.card-body {
    padding: 1.5rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Search & Filters */
.toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

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

.data-table th {
    text-align: left;
    padding: 1rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
}

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

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

/* Status Badges */
.status {
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}

.status-delivered, .status-success { background: #d1fae5; color: #059669; }
.status-transit, .status-info { background: #dbeafe; color: #2563eb; }
.status-processing, .status-warning { background: #fef3c7; color: #d97706; }
.status-pending { background: #f3f4f6; color: #6b7280; }
.status-danger { background: #fee2e2; color: #dc2626; }

/* Stock Bars */
.stock-bar {
    width: 100px;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.stock-fill {
    height: 100%;
    border-radius: 3px;
}

.stock-fill.high { background: var(--success); }
.stock-fill.medium { background: var(--warning); }
.stock-fill.low { background: var(--danger); }

.stock-qty {
    font-weight: 600;
    font-size: 0.85rem;
}

.stock-qty.high { color: var(--success); }
.stock-qty.medium { color: var(--warning); }
.stock-qty.low { color: var(--danger); }

/* Grid Layouts */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.content-grid.single {
    grid-template-columns: 1fr;
}

.full-width {
    grid-column: span 2;
}

/* Timeline */
.timeline {
    padding: 1.5rem;
}

.timeline-item {
    display: flex;
    gap: 1rem;
    padding-bottom: 1.5rem;
    position: relative;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 35px;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.timeline-dot.blue { background: #dbeafe; color: var(--primary); }
.timeline-dot.green { background: #d1fae5; color: var(--success); }
.timeline-dot.orange { background: #ffedd5; color: var(--secondary); }

.timeline-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.timeline-content p {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Document Cards */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.doc-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 12px;
    transition: background 0.2s;
    cursor: pointer;
}

.doc-card:hover {
    background: var(--gray-100);
}

.doc-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.doc-info {
    flex: 1;
}

.doc-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--gray-900);
}

.doc-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.doc-action {
    color: var(--primary);
    font-size: 1.25rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
    font-size: 0.85rem;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    .full-width {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .header-top {
        padding: 1rem;
    }

    .main {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .nav-item {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }

    .nav-item span {
        display: none;
    }

    .user-details {
        display: none;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .stat-card {
    animation: fadeIn 0.4s ease-out;
}

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

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

.modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    margin: auto;
    position: relative;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--gray-500);
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
}

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

/* Form Select */
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* Textarea */
textarea.form-input {
    resize: vertical;
    min-height: 80px;
}
