@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');

:root {
    --primary-navy: #062B45;
    --primary-light: #0a3d61;
    --gold-accent: #D8B26A;
    --gold-hover: #c49d56;
    --soft-cream: #F5E7C8;
    --white: #FFFFFF;
    --neutral-gray: #6B7280;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px 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);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

button, input, select, textarea {
    font-family: inherit;
    outline: none;
}

/* Layout */
.app-container {
    display: flex;
    min-h-screen: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    transition: var(--transition);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-navy);
    color: var(--white);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 35px;
    height: 35px;
    background: var(--gold-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-navy);
    font-weight: bold;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 1rem;
}

.nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--neutral-gray);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius-md);
    margin-bottom: 4px;
    font-weight: 500;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.08);
    color: var(--white);
}

.nav-link.active {
    background: var(--gold-accent);
    color: var(--primary-navy);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* Topbar */
.topbar {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-navy);
    cursor: pointer;
    margin-right: 1rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

.page-title {
    font-size: 1.875rem;
    color: var(--primary-navy);
}

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

.stat-card {
    background: var(--white);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 50%, rgba(216, 178, 106, 0.05) 100%);
    border-radius: 0 0 0 100%;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.stat-card.admin .stat-icon { background: #e0f2fe; color: #0284c7; }
.stat-card.vendor .stat-icon { background: #fef3c7; color: #d97706; }
.stat-card.client .stat-icon { background: #dcfce7; color: #16a34a; }

.stat-info { flex: 1; }

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-navy);
    line-height: 1.2;
}

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

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-approval { background: #e0f2fe; color: #0369a1; }
.badge-fabrication { background: #fef3c7; color: #92400e; }
.badge-completed { background: #d1fae5; color: #065f46; }
.badge-cancelled { background: #fee2e2; color: #991b1b; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-overdue { background: #fef2f2; color: #991b1b; border: 1px solid #fee2e2; }

/* Tables */
.table-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

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

tr:hover td {
    background: #f8fafc;
}

.table-footer {
    padding: 1.25rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fcfdfe;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .table-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

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

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.input-group .form-control {
    padding-left: 2.75rem;
}

.input-group .form-control:focus + i {
    color: var(--gold-accent);
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--gold-accent);
    box-shadow: 0 0 0 4px rgba(216, 178, 106, 0.1);
}

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

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .form-grid, .form-grid-3 {
        grid-template-columns: 1fr !important;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

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

.btn-gold {
    background: var(--gold-accent);
    color: var(--primary-navy);
}

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

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

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .menu-toggle {
        display: block;
    }
    .mobile-logo {
        display: block !important;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .topbar {
        padding: 0 1rem;
    }
    .search-wrapper {
        display: none;
    }
    .page-title {
        font-size: 1.5rem !important;
    }
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--white);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
}

.page-link:hover {
    border-color: var(--gold-accent);
    color: var(--gold-accent);
    background: rgba(216, 178, 106, 0.05);
}

.page-item.active .page-link {
    background: var(--primary-navy);
    color: var(--white);
    border-color: var(--primary-navy);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 95;
}

.sidebar-overlay.active {
    display: block;
}

/* Footer */
.main-footer {
    padding: 2.5rem 0 1rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.813rem;
}

.main-footer p {
    margin: 0;
}

.footer-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-weight: 500;
}

.status-indicator .dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
}

@media (max-width: 768px) {
    .main-footer {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 2rem 1rem;
    }
}
