:root {
    --primary: #0D9488;
    --primary-dark: #0F766E;
    --primary-light: #14B8A6;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --accent: #E87722;
    --info: #3B82F6;
    
    --bg-root: #F8FAFC;
    --bg-default: #FFFFFF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F1F5F9;
    --bg-tertiary: #E2E8F0;
    
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --text-muted: #94A3B8;
    
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --border-color: #E2E8F0;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    
    --sidebar-width: 260px;
}

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

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-root);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
}

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

.sidebar {
    width: var(--sidebar-width);
    background: #1e293b;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
}

.sidebar .logo-text {
    color: white;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: #0f172a;
}

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

.logo-image {
    max-width: 180px;
    height: auto;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.2s ease;
}

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

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

.nav-item.active .nav-icon {
    stroke: white;
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-item.logout {
    color: #f87171;
}

.nav-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    cursor: pointer;
    justify-content: flex-start;
}

.nav-dropdown-toggle .dropdown-arrow {
    width: 16px;
    height: 16px;
    margin-left: auto;
    transition: transform 0.2s ease;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    padding-left: 20px;
    margin-top: 4px;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown.active .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

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

.nav-dropdown-item.active {
    background: rgba(13, 148, 136, 0.3);
    color: white;
}

.nav-icon-sm {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: var(--bg-default);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 500;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    cursor: pointer;
}

.user-info:hover {
    background: var(--bg-secondary);
}

.user-info:hover .user-name {
    color: var(--primary);
}

.user-info:hover .user-avatar {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
}

.user-name {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.15s;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    transition: all 0.15s ease;
}

.content-area {
    flex: 1;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

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

.metric-card {
    background: var(--bg-default);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon svg {
    width: 22px;
    height: 22px;
}

.metric-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.metric-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.metric-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.metric-icon.primary {
    background: rgba(232, 119, 34, 0.15);
    color: var(--primary);
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.metric-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.card {
    background: var(--bg-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 24px;
}

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

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
}

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

.table tr:hover td {
    background: var(--bg-root);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

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

.btn-danger:hover {
    background: #DC2626;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

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

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--bg-default);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(232, 119, 34, 0.15);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.badge-software {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

.badge-hardware {
    background: rgba(99, 102, 241, 0.15);
    color: #6366F1;
}

.badge-it_services {
    background: rgba(236, 72, 153, 0.15);
    color: #EC4899;
}

.badge-cloud {
    background: rgba(6, 182, 212, 0.15);
    color: #06B6D4;
}

.badge-support {
    background: rgba(168, 85, 247, 0.15);
    color: #A855F7;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.status-badge.status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-badge.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.status-badge.status-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Dashboard grid responsive */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

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

/* Empty state styles */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--text-tertiary);
}

.empty-state-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Data table styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-secondary);
}

.data-table tr:hover td {
    background: var(--bg-root);
}

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

/* Stat card for reports */
.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Report tabs */
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-secondary);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

@media (max-width: 1400px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.open {
        display: block;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: 8px;
        cursor: pointer;
        margin-right: 12px;
    }
    
    .mobile-menu-toggle svg {
        width: 20px;
        height: 20px;
        color: var(--text-primary);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .top-header {
        padding: 16px;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .global-search {
        display: none;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .sidebar-close {
        display: flex;
        position: absolute;
        top: 16px;
        right: 16px;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        background: rgba(255,255,255,0.1);
        border: none;
        border-radius: 6px;
        cursor: pointer;
        color: white;
    }
    
    .sidebar-close:hover {
        background: rgba(255,255,255,0.2);
    }
}

@media (min-width: 769px) {
    .mobile-menu-toggle,
    .sidebar-overlay,
    .sidebar-close {
        display: none !important;
    }
}

/* Global Search */
.global-search {
    position: relative;
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
}

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

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 80px 10px 42px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.search-shortcut {
    position: absolute;
    right: 12px;
    padding: 3px 8px;
    font-size: 11px;
    font-family: inherit;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

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

.search-result-item:hover,
.search-result-item.selected {
    background: rgba(13, 148, 136, 0.05);
}

.result-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon svg {
    width: 18px;
    height: 18px;
}

.result-icon.client {
    background: rgba(13, 148, 136, 0.1);
    color: var(--primary);
}

.result-icon.project {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.result-icon.contract {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.result-icon.contact {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-type {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    font-weight: 600;
}

.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    color: var(--text-tertiary);
}

.search-empty svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .global-search {
        display: none;
    }
    
    /* Tables - Responsive */
    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table th,
    .data-table td {
        white-space: nowrap;
        padding: 12px 10px;
        font-size: 13px;
    }
    
    /* Cards - Responsive */
    .card {
        margin-bottom: 16px;
    }
    
    .card-header {
        padding: 16px;
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    /* Forms - Responsive */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group {
        width: 100% !important;
        margin-bottom: 16px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Buttons - Responsive */
    .btn-group {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn {
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Page Header - Responsive */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    
    .page-header .btn-group {
        justify-content: flex-start;
    }
    
    /* Filter Bar - Responsive */
    .filter-bar {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-bar .filter-group {
        width: 100%;
    }
    
    .filter-bar select,
    .filter-bar input {
        width: 100%;
    }
    
    /* Detail View - Responsive */
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-row {
        flex-direction: column;
        gap: 4px;
    }
    
    .detail-label {
        min-width: auto;
    }
    
    /* Tabs - Responsive */
    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-list {
        min-width: max-content;
    }
    
    /* Stats/Metrics - Responsive */
    .stats-row {
        flex-direction: column;
        gap: 16px;
    }
    
    .stat-item {
        text-align: left;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-light);
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
    
    /* Modal - Responsive */
    .modal-content {
        margin: 16px;
        max-height: calc(100vh - 32px);
        width: calc(100% - 32px);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    /* Timeline - Responsive */
    .timeline {
        padding-left: 20px;
    }
    
    .timeline-item::before {
        left: -20px;
    }
    
    /* Settings Layout - Responsive */
    .settings-layout {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: 16px;
        margin-bottom: 16px;
    }
    
    .settings-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .settings-nav-item {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }
    
    /* Action Buttons on Tables - Responsive */
    .action-buttons {
        flex-wrap: nowrap;
    }
    
    .action-buttons .btn {
        padding: 6px 8px;
    }
    
    .action-buttons .btn span {
        display: none;
    }
    
    /* User header info - Responsive */
    .user-name {
        display: none;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .content-area {
        padding: 12px;
    }
    
    .top-header {
        padding: 12px;
    }
    
    .metrics-grid {
        gap: 12px;
    }
    
    .metric-card {
        padding: 16px;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .card {
        border-radius: var(--radius-md);
    }
    
    .btn {
        padding: 10px 14px;
    }
    
    .otp-inputs {
        gap: 6px;
    }
    
    .otp-input {
        width: 42px;
        height: 50px;
        font-size: 20px;
    }
    
    .auth-card {
        padding: 24px;
    }
    
    .auth-title {
        font-size: 20px;
    }
}
