:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #f8fafc;
    --bg-dark: #1e293b;
    --bg-darker: #0f172a;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    --shadow: 0 1px 3px 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);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 18px;
    color: var(--primary);
}

.logo i {
    font-size: 24px;
}

.version {
    font-size: 12px;
    color: var(--text-light);
    font-weight: normal;
}

.breadcrumbs {
    color: var(--text-light);
    font-size: 14px;
}

.breadcrumbs span:not(:last-child)::after {
    content: ' > ';
    margin: 0 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--bg);
}

.user-menu i {
    font-size: 24px;
    color: var(--primary);
}

.btn-logout {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

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

/* App Container */
.app-container {
    display: flex;
    margin-top: 64px;
    min-height: calc(100vh - 64px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--border);
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-nav {
    padding: 16px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 8px 24px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    text-decoration: none;
}

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

.nav-item.active {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 500;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 24px;
    min-height: calc(100vh - 64px);
}

.view {
    animation: fadeIn 0.3s;
}

.view.hidden {
    display: none;
}

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

/* Page Header */
.page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header p {
    color: var(--text-light);
    font-size: 14px;
    margin-top: 4px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    background: none;
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg);
    border-color: var(--primary);
    color: var(--primary);
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

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

.form-group label i {
    margin-right: 8px;
    color: var(--text-light);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-light);
}

.text-muted {
    color: var(--text-light);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.error-message {
    color: var(--danger);
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

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

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--white);
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

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

/* Table Toolbar */
.table-toolbar {
    background: var(--white);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow);
}

.search-box {
    flex: 1;
    position: relative;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
}

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

/* Table */
.table-container {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.data-table thead {
    background: var(--bg);
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
    border-bottom: 1px solid var(--border);
}

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

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

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

.empty-state {
    text-align: center;
    padding: 40px !important;
    color: var(--text-light);
}

/* Status Badge */
.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

/* General Badge */
.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

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

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

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

/* Actions */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
    margin: 0 2px;
}

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

.action-btn.danger:hover {
    color: var(--danger);
}

.action-btn.whatsapp-btn:hover {
    color: #25D366;
    background: rgba(37, 211, 102, 0.1);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding: 16px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

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

.modal.show {
    display: flex;
}

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

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

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg);
    color: var(--text);
}

.modal form {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Profile */
.profile-container {
    max-width: 600px;
}

.profile-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.profile-card h2 {
    font-size: 18px;
    margin-bottom: 24px;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

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

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

