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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Navigation */
nav {
    position: fixed;
    left: 0;
    top: 80px;
    bottom: 0;
    width: 250px;
    background: #2c3e50;
    padding-top: 2rem;
    overflow-y: auto;
}

nav ul {
    list-style: none;
}

nav ul li {
    margin-bottom: 0.5rem;
}

nav ul li a {
    display: block;
    padding: 1rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

nav ul li a:hover,
nav ul li a.active {
    background: #34495e;
    border-left-color: #3498db;
}

nav ul li a i {
    margin-right: 0.5rem;
    width: 20px;
}

/* Main Content */
main {
    margin-left: 250px;
    margin-top: 80px;
    padding: 2rem;
    flex: 1;
}

main h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 600;
}

main h3 {
    color: #34495e;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

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

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

/* Dashboard Styles */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kpi-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.kpi-content h3 {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.kpi-value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.kpi-value.alert-critical {
    color: #e74c3c;
}

/* Quick Actions */
.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Recent Activity */
.recent-activity {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.activity-list {
    margin-top: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.3s ease;
}

.activity-item:hover {
    background-color: #f8f9fa;
}

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

.activity-item i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ecf0f1;
    color: #3498db;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-details {
    flex: 1;
}

.activity-time {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Alerts */
.alerts-summary {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.alert-list {
    margin-top: 1rem;
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-item.alert-critical {
    background: #fdf2f2;
    border-left: 4px solid #e74c3c;
}

.alert-item.alert-warning {
    background: #fef9e7;
    border-left: 4px solid #f39c12;
}

.alert-item.alert-info {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
}

.alert-item i {
    margin-top: 0.25rem;
}

.alert-item.alert-critical i {
    color: #e74c3c;
}

.alert-item.alert-warning i {
    color: #f39c12;
}

.alert-item.alert-info i {
    color: #3498db;
}

.alert-details {
    flex: 1;
}

.alert-description {
    display: block;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0.25rem 0;
}

.alert-time {
    display: block;
    color: #95a5a6;
    font-size: 0.8rem;
}

/* Forms */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

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

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.search-filters {
    padding: 1.5rem;
    border-bottom: 1px solid #ecf0f1;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.search-group {
    flex: 1;
    min-width: 200px;
}

.search-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.search-group input,
.search-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 1rem;
}

.search-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

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

table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
}

table td {
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
}

table tr:hover {
    background-color: #f8f9fa;
}

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

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions a {
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}

.table-actions a.view {
    color: #3498db;
    background: #e3f2fd;
}

.table-actions a.edit {
    color: #f39c12;
    background: #fef9e7;
}

.table-actions a.delete {
    color: #e74c3c;
    background: #fdf2f2;
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

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

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    border: 1px solid #ecf0f1;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

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

.pagination button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

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

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: #7f8c8d;
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
}

.auth-footer a {
    color: #3498db;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    nav {
        position: static;
        width: 100%;
        height: auto;
    }

    nav ul {
        display: flex;
        flex-wrap: wrap;
        padding-top: 1rem;
    }

    nav ul li {
        flex: 1;
        min-width: 150px;
    }

    main {
        margin-left: 0;
        margin-top: 1rem;
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .kpi-cards {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .search-row {
        flex-direction: column;
    }

    .table-container {
        overflow-x: auto;
    }

    .form-actions {
        flex-direction: column;
    }
}

/* Print Styles */
@media print {
    nav,
    .user-menu,
    .form-actions,
    .table-actions,
    .pagination {
        display: none;
    }

    main {
        margin-left: 0;
        margin-top: 1rem;
        padding: 0;
    }

    .auth-container {
        background: white;
    }
}