:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --sidebar-bg: #1e293b;
    --sidebar-text: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

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

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    width: 100%;
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

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

.nav-item.active {
    background: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-bar input {
    padding: 0.6rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    width: 300px;
    font-size: 0.9rem;
}

.user-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

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

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

/* Table */
.table-container {
    background: var(--bg-white);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: #f1f5f9;
    padding: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

tr:hover td {
    background: #f8fafc;
}

.status-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

/* Form Styles */
.asset-form {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    max-width: 800px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

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

input,
select,
textarea {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 0.95rem;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
}

/* Utilities */
.hidden {
    display: none;
}

#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--sidebar-bg);
    color: white;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-md);
    margin-top: 0.5rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsive Design */
@media screen and (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 1rem;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        margin-bottom: 0;
    }

    .sidebar nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        margin-top: 1rem;
    }

    .nav-item {
        width: calc(50% - 0.25rem);
        margin-bottom: 0;
        justify-content: center;
    }

    .main-content {
        padding: 1rem;
    }

    .top-bar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .search-bar input {
        width: 100%;
    }

    .user-profile {
        display: flex;
        justify-content: flex-end;
    }

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

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

    .form-group.full-width {
        grid-column: 1;
    }

    /* Make table horizontally scrollable */
    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 800px;
    }
}

/* Print Styles for Reports */
@media print {

    .sidebar,
    .top-bar,
    #btn-print-reports,
    #toast-container {
        display: none !important;
    }

    body,
    .app-container,
    .main-content {
        background: white !important;
        background-color: white !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        color: black !important;
    }

    .stat-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }

    @page {
        margin: 1.5cm;
    }
}