* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 40px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.header-content > div:first-child {
    text-align: left;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    backdrop-filter: blur(10px);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.header h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.nav-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 3px solid #e9ecef;
    padding: 0 20px;
    gap: 10px;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 20px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.tab-btn.active {
    color: #667eea;
    background: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.tab-content {
    display: none;
    padding: 40px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* Sub-tabs styling */
.sub-nav-tabs {
    display: flex;
    background: #ffffff;
    border-bottom: 2px solid #e9ecef;
    padding: 0 20px;
    gap: 5px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.sub-tab-btn {
    background: transparent;
    border: none;
    padding: 14px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 6px 6px 0 0;
}

.sub-tab-btn:hover {
    color: #764ba2;
    background: rgba(118, 75, 162, 0.05);
}

.sub-tab-btn.active {
    color: #764ba2;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

.sub-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.sub-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.sub-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
    display: block;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.content-header h2 {
    color: #1a1a1a;
    font-size: 2rem;
    font-weight: 700;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 10px 18px;
    font-size: 0.95rem;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ee5a6f 0%, #d63447 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.btn-edit {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
    padding: 10px 18px;
    font-size: 0.95rem;
    margin-right: 8px;
}

.btn-edit:hover {
    background: linear-gradient(135deg, #37b24d 0%, #2f9e44 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.item-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.item-card:hover::before {
    transform: scaleX(1);
}

.item-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.item-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 18px;
    transition: transform 0.3s ease;
}

.item-card:hover img {
    transform: scale(1.02);
}

.no-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 10px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px dashed #cbd5e0;
}

.no-image-placeholder span {
    color: #a0aec0;
    font-size: 0.9rem;
    font-weight: 500;
}

.item-card h3 {
    color: #1a1a1a;
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
}

.item-card p {
    color: #718096;
    margin-bottom: 10px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.item-card strong {
    color: #2d3748;
    font-weight: 600;
}

.item-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.items-list {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.table-item {
    display: grid;
    grid-template-columns: 60px 1fr 100px 150px 120px 120px 120px 150px;
    gap: 15px;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.table-item:hover {
    background: #f8f9fa;
}

.table-item strong {
    color: #333;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-item span {
    color: #6c757d;
    font-size: 0.95rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 30px auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    padding: 25px 30px;
    font-size: 1.6rem;
    font-weight: 700;
}

.modal-content form {
    padding: 30px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.close {
    color: white;
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
    line-height: 1;
    opacity: 0.9;
}

.close:hover {
    transform: scale(1.1);
    opacity: 1;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.98rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: #f7fafc;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input[type="file"] {
    padding: 12px;
    background: white;
    border: 2px dashed #cbd5e0;
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: #667eea;
    background: #f7fafc;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.badge-active {
    background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.25);
}

.badge-inactive {
    background: linear-gradient(135deg, #ff8787 0%, #ff6b6b 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

/* Loading Spinner */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-data {
    text-align: center;
    padding: 50px 20px;
    color: #6c757d;
    font-size: 1.1rem;
}

.page-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #edf2f7;
}

.category-icon {
    width: 100%;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 10px;
    margin-bottom: 15px;
}

.category-icon svg {
    max-width: 60px;
    max-height: 60px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        padding: 15px 20px;
        font-size: 0.9rem;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
    }
    
    .table-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
}

/* Card description styling */
.card-description-container {
    margin: 10px 0;
}

.card-description-short,
.card-description-full {
    line-height: 1.6;
    color: #666;
    font-size: 14px;
}

.read-more-btn {
    background: transparent;
    border: none;
    color: #667eea;
    cursor: pointer;
    padding: 5px 0;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    margin-top: 5px;
    transition: color 0.3s;
}

.read-more-btn:hover {
    color: #764ba2;
}

/* Quill editor styling */
.ql-toolbar {
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.ql-container {
    border-radius: 0 0 8px 8px;
    font-size: 15px;
}
