/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
}

* {
    box_sizing: border-box;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    text-decoration: underline;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px 0;
    margin-bottom: 20px;
}

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

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0056b3;
}

.nav-links a {
    margin-left: 20px;
    color: #555;
    font-weight: 500;
}

.nav-links a:hover {
    color: #007bff;
}

/* Cards & Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #eee;
}

.card-body {
    padding: 15px;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: #333;
}

.card-text {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

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

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    width: 90%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

input:focus {
    border-color: #007bff;
    outline: none;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-align: center;
    transition: background 0.2s;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 20px;
}

.table th,
.table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Auth Page */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-title {
    text-align: center;
    margin-bottom: 20px;
    color: #007bff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

/* Admin Sidebar */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: #0056b3; /* Darker blue */
    color: #fff;
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.2rem;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li a {
    display: block;
    padding: 15px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-left: 4px solid transparent;
}

.sidebar li a:hover, .sidebar li a.active {
    background: rgba(0,0,0,0.1);
    color: #fff;
    border-left-color: #fff;
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Utilities */
.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.d-none { display: none; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

/* Responsive */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .grid {
        grid-template-columns: 1fr;
    }
}
