* {
    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: #f0f2f5;
}

/* Login Screen */
.login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
    padding: 20px;
}

.login-box {
    background: #fff;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: #1976d2;
    margin-bottom: 1rem;
}

.login-logo h1 {
    color: #0d47a1;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.login-logo p {
    color: #666;
}

.login-box .form-group {
    margin-bottom: 1.5rem;
}

.login-box .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #0d47a1;
    font-weight: 500;
}

.login-box .form-group label i {
    margin-right: 0.5rem;
    color: #1976d2;
}

.login-box .form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.login-box .form-group input:focus {
    outline: none;
    border-color: #1976d2;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #1976d2;
    color: #fff;
}

.btn-primary:hover {
    background: #0d47a1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

.login-message {
    text-align: center;
    margin-top: 1rem;
    padding: 0.8rem;
    border-radius: 5px;
    display: none;
}

.login-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: #1976d2;
    text-decoration: none;
    transition: color 0.3s;
}

.back-link:hover {
    color: #0d47a1;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: #0d47a1;
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 2.5rem;
    color: #ffab40;
    margin-bottom: 0.5rem;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.sidebar-header p {
    font-size: 0.9rem;
    color: #ccc;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.5rem;
    color: #ccc;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffab40;
    border-left-color: #ffab40;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    padding: 0.8rem;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c82333;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    color: #0d47a1;
    font-size: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #ffab40;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card i {
    font-size: 2.5rem;
    color: #1976d2;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2rem;
    color: #0d47a1;
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: #666;
}

/* Quick Actions */
.quick-actions {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.quick-actions h2 {
    color: #0d47a1;
    margin-bottom: 1.5rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-buttons .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Admin Cards */
.admin-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.admin-card h2 {
    color: #0d47a1;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f2f5;
}

.admin-card .form-group {
    margin-bottom: 1.5rem;
}

.admin-card .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #0d47a1;
    font-weight: 500;
}

.admin-card .form-group input,
.admin-card .form-group textarea,
.admin-card .form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.admin-card .form-group input:focus,
.admin-card .form-group textarea:focus,
.admin-card .form-group select:focus {
    outline: none;
    border-color: #1976d2;
}

.admin-card form button {
    margin-top: 0.5rem;
}

.admin-card form button[type="button"] {
    /* Spacing for cancel buttons */
    margin-left: 0.5rem;
}

/* Item List */
.item-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #1976d2;
}

.list-item span {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #333;
}

.list-item span i {
    color: #1976d2;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-edit,
.btn-delete {
    padding: 0.5rem 0.8rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-edit {
    background: #ffc107;
    color: #333;
}

.btn-edit:hover {
    background: #e0a800;
}

.btn-delete {
    background: #dc3545;
    color: #fff;
}

.btn-delete:hover {
    background: #c82333;
}

/* Modal Styles for Cropper */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 700px;
    border-radius: 10px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.modal-header h2 {
    margin: 0;
    padding: 0;
    border: none;
}

.close-button {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
}

.modal-body {
    padding: 20px 0;
}

.img-container {
    width: 100%;
    height: 400px;
    background-color: #f7f7f7;
}

.modal-footer {
    padding-top: 10px;
    border-top: 1px solid #ddd;
    text-align: right;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-header h2,
    .sidebar-header p,
    .nav-item span {
        display: none;
    }

    .sidebar-header i {
        font-size: 1.5rem;
    }

    .nav-item {
        justify-content: center;
        padding: 0.8rem;
    }

    .main-content {
        margin-left: 60px;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        padding: 2rem;
    }
}

.image-preview-container {
    margin-top: 1rem;
}

.image-preview-container img {
    max-width: 150px;
    max-height: 150px;
    border: 2px solid #ddd;
    border-radius: 5px;
}