/* IT Asset Tagger - Modern Offline Asset Management */
:root {
    --primary: #4a90d9;
    --primary-dark: #357abd;
    --primary-light: #e8f4fc;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --transition: all 0.2s ease;
    
    --sidebar-width: 260px;
    --header-height: 64px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-100);
    min-height: 100vh;
}

/* App Layout */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-900);
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-700);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

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

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

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

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

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

/* Main Layout */
.app-main {
    display: flex;
    flex: 1;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    overflow-y: auto;
}

.nav-menu {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    color: var(--gray-600);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

.nav-item span {
    font-size: 18px;
}

/* Stats Panel */
.stats-panel {
    margin-top: auto;
    padding: 20px;
    border-top: 1px solid var(--gray-200);
}

.stats-panel h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    font-size: 13px;
    color: var(--gray-600);
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-800);
}

/* Content Area */
.content-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    overflow-y: auto;
}

/* Views */
.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.view-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-900);
}

/* Search & Filter */
.search-filter {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-input, .filter-select {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    min-width: 200px;
}

.search-input:focus, .filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.dashboard-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-100);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.recent-item:hover {
    background: var(--gray-200);
}

.recent-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.recent-info {
    flex: 1;
}

.recent-name {
    font-weight: 500;
    color: var(--gray-800);
}

.recent-meta {
    font-size: 12px;
    color: var(--gray-500);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.status-card {
    text-align: center;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--gray-100);
}

.status-count {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.status-label {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
}

/* Assets Table */
.assets-table-container {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

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

.assets-table th {
    background: var(--gray-100);
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--gray-200);
}

.assets-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
}

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

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

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-maintenance {
    background: #fff3cd;
    color: #856404;
}

.status-retired {
    background: #f8d7da;
    color: #721c24;
}

.status-lost {
    background: #f5c6cb;
    color: #721c24;
}

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    background: var(--gray-100);
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Form Styles */
.asset-form {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

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

.form-actions {
    display: flex;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

/* Tags View */
.tags-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
}

.tag-controls {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    height: fit-content;
}

.tag-controls .form-group {
    margin-bottom: 16px;
}

.tag-selection {
    display: flex;
    gap: 8px;
}

.tag-preview {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    min-height: 400px;
}

.tag-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.tag-item {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.tag-item:hover {
    border-color: var(--primary);
}

.tag-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.tag-canvas {
    margin-bottom: 12px;
}

.tag-info {
    font-size: 12px;
    color: var(--gray-600);
}

/* Categories */
.categories-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
}

.category-form {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    height: fit-content;
}

.category-form h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--gray-700);
}

.form-inline {
    display: flex;
    gap: 8px;
}

.form-inline input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
}

.form-inline input[type="color"] {
    width: 50px;
    height: 36px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    cursor: pointer;
}

.categories-list {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border-bottom: 1px solid var(--gray-100);
}

.category-item:last-child {
    border-bottom: none;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.category-color {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
}

.category-name {
    font-weight: 500;
}

.category-count {
    font-size: 12px;
    color: var(--gray-500);
}

.category-actions {
    display: flex;
    gap: 8px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius-md);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-content.large {
    max-width: 900px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    color: var(--gray-500);
    cursor: pointer;
    line-height: 1;
}

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

.modal-content h2 {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 18px;
    font-weight: 600;
}

.asset-details {
    padding: 24px;
}

.detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    width: 140px;
    font-weight: 500;
    color: var(--gray-600);
    font-size: 13px;
}

.detail-value {
    flex: 1;
    color: var(--gray-800);
}

.modal-actions {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Reports */
.reports-container {
    padding: 24px;
}

.report-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.report-content {
    overflow-x: auto;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--gray-800);
    color: var(--white);
    padding: 14px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.warning {
    background: var(--warning);
    color: var(--gray-900);
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Print Styles */
@media print {
    .app-header, .sidebar, .nav-menu, .header-actions,
    .btn:not(.btn-primary), .modal-actions, .toast-container {
        display: none !important;
    }
    
    .content-area {
        margin-left: 0;
    }
    
    .tag-preview {
        box-shadow: none;
        border: none;
    }
    
    .tag-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .content-area {
        margin-left: 0;
    }
    
    .tags-container,
    .categories-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-filter {
        width: 100%;
    }
    
    .search-input, .filter-select {
        flex: 1;
        min-width: auto;
    }
    
    .assets-table-container {
        overflow-x: auto;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}