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

:root {
    --primary: #4A90E2;
    --primary-hover: #5C9EFF;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #ff4d4f;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border: #e8e8e8;
    --bg: #f5f7fa;
    --white: #fff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

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

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

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 400px;
    text-align: center;
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.login-box .subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

.login-box .company-name {
    font-size: 16px;
    color: var(--primary);
    margin-bottom: 30px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
    text-align: center;
}

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

.btn-block {
    width: 100%;
}

.login-error {
    color: var(--danger);
    font-size: 14px;
    margin-bottom: 15px;
    display: none;
}

/* Main Layout */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
    font-size: 18px;
    color: var(--primary);
}

.sidebar-header .company {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
}

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

.nav-item.active {
    background: #e6f3ff;
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item .icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    border-top: 1px solid var(--border);
}

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

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
}

.user-details {
    flex: 1;
}

.user-details .name {
    font-size: 14px;
    color: var(--text-primary);
}

.user-details .role {
    font-size: 12px;
    color: var(--text-muted);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
}

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

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 240px;
    padding: 24px;
}

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

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

.page-header .date-range {
    color: var(--text-muted);
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
}

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

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-card .label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

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

.stat-card .trend {
    font-size: 12px;
    margin-top: 8px;
}

.stat-card .trend.up {
    color: var(--success);
}

.stat-card .trend.down {
    color: var(--danger);
}

.stat-card.highlight {
    border-left: 4px solid var(--primary);
}

.stat-card.warning {
    border-left: 4px solid var(--warning);
}

.stat-card.success {
    border-left: 4px solid var(--success);
}

.stat-card.danger {
    border-left: 4px solid var(--danger);
}

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

.chart-container {
    height: 300px;
}

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

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

.data-table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.data-table td {
    font-size: 14px;
}

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

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

.badge-pending {
    background: #fff7e6;
    color: #fa8c16;
}

.badge-processing {
    background: #e6f3ff;
    color: #4A90E2;
}

.badge-completed {
    background: #f6ffed;
    color: #52c41a;
}

.badge-rejected {
    background: #fff1f0;
    color: #ff4d4f;
}

.badge-low {
    background: #f6ffed;
    color: #52c41a;
}

.badge-medium {
    background: #fff7e6;
    color: #fa8c16;
}

.badge-high {
    background: #fff1f0;
    color: #ff4d4f;
}

/* Action Buttons */
.action-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

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

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

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

/* Form Styles */
.form-section {
    margin-bottom: 24px;
}

.form-section h3 {
    font-size: 16px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

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

select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
}

/* Tab Navigation */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* List Items */
.list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.list-item:hover {
    background: var(--bg);
}

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

.list-item .icon-box {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 18px;
}

.list-item .icon-box.primary {
    background: #e6f3ff;
    color: var(--primary);
}

.list-item .icon-box.warning {
    background: #fff7e6;
    color: var(--warning);
}

.list-item .icon-box.danger {
    background: #fff1f0;
    color: var(--danger);
}

.list-item .icon-box.success {
    background: #f6ffed;
    color: var(--success);
}

.list-item .content {
    flex: 1;
}

.list-item .content h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.list-item .content p {
    font-size: 12px;
    color: var(--text-muted);
}

.list-item .time {
    font-size: 12px;
    color: var(--text-muted);
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* Settings Page */
.settings-section {
    margin-bottom: 32px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.settings-item .info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.settings-item .info p {
    font-size: 12px;
    color: var(--text-muted);
}

.toggle {
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.toggle.active {
    background: var(--primary);
}

.toggle::after {
    content: '';
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle.active::after {
    transform: translateX(20px);
}

/* Notification Item */
.notification-item {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.3s;
}

.notification-item:hover {
    background: var(--bg);
}

.notification-item.unread {
    background: #e6f3ff;
}

.notification-item .dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 12px;
    margin-top: 6px;
}

.notification-item .content {
    flex: 1;
}

.notification-item .content h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.notification-item .content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.notification-item .time {
    font-size: 12px;
    color: var(--text-muted);
}

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

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

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        margin-left: 200px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/* Role Tags */
.role-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-right: 8px;
}

.role-tag.owner {
    background: #fff7e6;
    color: #fa8c16;
}

.role-tag.steward {
    background: #e6f3ff;
    color: var(--primary);
}

.role-tag.user {
    background: #f6ffed;
    color: #52c41a;
}