:root {
    --sage: #B0C4B1;
    --rose: #EDACB1;
    --deep: #4A5759;
    --cream: #FFF9EF;
    --warm: #EADDC6;
    --charcoal: #2D3E3F;
    --white: #FFFFFF;
    --shadow-sm: 0 6px 14px rgba(0,0,0,0.03);
    --shadow-md: 0 12px 28px rgba(0,0,0,0.08);
    --transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #FEFAF5;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--charcoal);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--deep);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--deep);
    transition: var(--transition);
}

a:hover {
    color: var(--rose);
}

.footer-bottom a {
    color: var(--rose);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Buttons */
.btn-primary {
    background: var(--sage);
    border: none;
    padding: 12px 28px;
    border-radius: 60px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--deep);
    color: white;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--sage);
    padding: 12px 28px;
    border-radius: 60px;
    color: var(--deep);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--sage);
    color: white;
}

.btn-small {
    background: var(--rose);
    border: none;
    padding: 6px 16px;
    border-radius: 40px;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-small:hover {
    background: var(--deep);
    color: white;
}

.btn-danger {
    background: #e74c3c;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #c0392b;
}

.slick-next {
    right: -50px !important;
}

.slick-prev {
    left: -50px !important;
}

/* Cards */
.stat-card {
    background: white;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid var(--warm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Novel Card */
.novel-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--warm);
    transition: var(--transition);
    cursor: pointer;
}

.novel-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-thumb {
    aspect-ratio: 3/4;
    width: 100%;
    overflow: hidden;
    background: #EDE8DE;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.novel-card:hover .card-thumb img {
    transform: scale(1.03);
}

.card-info {
    padding: 14px;
}

.card-info h3, .card-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.card-info h3 a, .card-info h4 a {
    text-decoration: none;
    color: var(--charcoal);
}

/* Badges */
.badge {
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: 40px;
    display: inline-block;
    margin-top: 6px;
}

.badge.ongoing {
    background: var(--sage);
    color: white;
}

.badge.completed {
    background: var(--deep);
    color: white;
}

.badge.r19, .badge.paid {
    background: var(--rose);
    color: white;
}

.badge.free {
    background: var(--sage);
    color: white;
}

/* Grids */
.novels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 28px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 24px;
    border: 1px solid var(--warm);
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px 20px;
    background: #FEFAF5;
    font-weight: 700;
    color: var(--deep);
    border-bottom: 1px solid var(--warm);
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid #F0E8DF;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 32px 0 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2, .section-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--deep);
    border-left: 4px solid var(--rose);
    padding-left: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination a, .pagination span {
    padding: 8px 14px;
    border-radius: 40px;
    text-decoration: none;
    color: var(--deep);
    background: white;
    border: 1px solid var(--warm);
}

.pagination .active span {
    background: var(--sage);
    color: white;
    border-color: var(--sage);
}

.simple-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--warm);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pagination-buttons a,
.pagination-buttons .disabled {
    padding: 8px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-buttons a {
    background: var(--sage);
    color: white;
}

.pagination-buttons a:hover {
    background: var(--deep);
}

.pagination-buttons .disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.page-info {
    color: var(--deep);
    font-weight: 500;
}

@media (max-width: 768px) {
    .simple-pagination {
        flex-direction: column;
        text-align: center;
    }
}

.section-heading {
    padding: 20px 0px;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--deep);
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    max-width: 500px;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid #e2dcd0;
    background: white;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--sage);
    outline: none;
    box-shadow: 0 0 0 3px rgba(176,196,177,0.2);
}

/* Alert Messages */
.alert {
    padding: 16px 20px;
    border-radius: 16px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.loading-spinner.show {
    display: flex;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border: 0.25em solid var(--sage);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.toast-success {
    border-left: 4px solid var(--sage);
}

.toast-danger {
    border-left: 4px solid #e74c3c;
}

.toast-info {
    border-left: 4px solid var(--rose);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .novels-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .section-header h2, .section-header h3 {
        font-size: 1.2rem;
    }
    
    .data-table th, .data-table td {
        padding: 12px;
        font-size: 0.8rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}