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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #f5f7fa;
}

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

.app-header {
    background: white;
    padding: 12px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

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

.company-info {
    color: #666;
    font-size: 13px;
}

.logout-btn {
    padding: 6px 12px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: #dc2626;
}

.main-content {
    padding: 16px;
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
}

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

.dashboard-header h2 {
    margin: 0;
    color: #333;
    font-size: 22px;
    font-weight: 600;
}

.refresh-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.refresh-btn:hover {
    background: #5568d3;
}

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-card.unread {
    border-left: 3px solid #ef4444;
}

.stat-card.read {
    border-left: 3px solid #10b981;
}

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

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    line-height: 1.2;
}

.stat-label {
    font-size: 12px;
    color: #666;
}

.type-stats-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

.type-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #666;
    background: #f3f4f6;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    line-height: 1.3;
}

.filters {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: #333;
    font-size: 13px;
}

.filter-group select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    min-width: 180px;
}

.notifications-section {
    background: white;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.notifications-section h3 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

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

.notifications-info {
    font-size: 13px;
    color: #666;
}

.notifications-table-container {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
}

.notifications-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
}

.notifications-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.notifications-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.notifications-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.notifications-table tbody tr:hover {
    background: #f9fafb;
}

.notifications-table tbody tr.unread {
    background: #eff6ff;
}

.notifications-table tbody tr.read {
    background: white;
}

.type-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.type-icon {
    font-size: 18px;
}

.type-name {
    font-size: 12px;
    color: #666;
}

.company-cell {
    min-width: 120px;
}

.title-cell {
    font-weight: 500;
    color: #333;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-cell {
    color: #666;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-cell {
    color: #666;
    font-size: 12px;
}

.date-cell {
    color: #999;
    font-size: 12px;
    white-space: nowrap;
}

.status-cell {
    text-align: center;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.status-badge.read {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.unread {
    background: #fee2e2;
    color: #991b1b;
}

.empty-state, .loading, .error {
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 13px;
}

.error {
    color: #ef4444;
}

.notifications-table .empty-state,
.notifications-table .loading,
.notifications-table .error {
    padding: 20px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.pagination span {
    font-size: 13px;
    color: #666;
}

.pagination button:hover:not(:disabled) {
    background: #f3f4f6;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.type-stats, .company-stats, .user-stats {
    background: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.type-stats h3, .company-stats h3, .user-stats h3 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 15px;
    font-weight: 600;
}

.type-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.type-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 6px;
}

.type-icon {
    font-size: 20px;
    flex-shrink: 0;
}

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

.type-stat-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    font-size: 13px;
}

.type-stat-count {
    font-size: 11px;
    color: #666;
}

.company-stats-list, .user-stats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}

.company-stat-item, .user-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f9fafb;
    border-radius: 4px;
}

.company-info, .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.company-icon, .user-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.company-name, .user-name {
    font-weight: 500;
    color: #333;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-count, .user-count {
    font-weight: 600;
    color: #667eea;
    font-size: 12px;
    flex-shrink: 0;
}

.company-badge {
    background: #e0e7ff;
    color: #4338ca;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
}

