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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8f6f3;
    color: #2c1810;
    line-height: 1.6;
}

.header {
    background: white;
    padding: 20px 0;
    border-bottom: 1px solid #f0e6d2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #2c1810;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #d4b896 0%, #a0856b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flame-icon {
    width: 20px;
    height: 25px;
    background: linear-gradient(180deg, #ff4444 0%, #ff6b35 25%, #f7931e 60%, #ffd23f 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #5d4e37;
}

.user-name {
    font-weight: 500;
}

.logout-link {
    color: #d4a574;
    text-decoration: none;
    font-weight: 500;
}

.logout-link:hover {
    color: #a0856b;
}

.main {
    padding: 40px 0;
}

.admin-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
}

.sidebar {
    background: white;
    border-radius: 16px;
    padding: 24px;
    height: fit-content;
    border: 1px solid #f0e6d2;
    position: sticky;
    top: 40px;
}

.content-area {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #f0e6d2;
    min-height: 600px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c1810;
}

.nav-item {
    display: block;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #5d4e37;
    transition: all 0.3s ease;
    cursor: pointer;
}

.nav-item:hover, .nav-item.active {
    background: #f8f6f3;
    color: #d4a574;
}

.devotion-list {
    max-height: 400px;
    overflow-y: auto;
}

.devotion-item {
    padding: 12px;
    border: 1px solid #f0e6d2;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.devotion-item:hover {
    border-color: #d4a574;
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.devotion-title {
    font-weight: 600;
    color: #2c1810;
    margin-bottom: 4px;
}

.devotion-meta {
    font-size: 12px;
    color: #9b8b7a;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-published {
    background: #4ade80;
}

.status-draft {
    background: #fbbf24;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #f0e6d2;
    margin-bottom: 20px;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #5d4e37;
}

.tab.active {
    border-bottom-color: #d4a574;
    color: #d4a574;
    font-weight: 600;
}

.tab:hover {
    color: #d4a574;
    text-decoration: none;
}

.hidden {
    display: none;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c1810;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #f0e6d2;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

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

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

.scripture-input {
    min-height: 80px;
}

.reflection-input {
    min-height: 200px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn {
    background: #d4a574;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
}

.btn:hover {
    background: #a0856b;
    transform: translateY(-2px);
    text-decoration: none;
    color: white;
}

.btn-secondary {
    background: #9b8b7a;
}

.btn-secondary:hover {
    background: #5d4e37;
}

.btn-danger {
    background: #dc2626;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin-right: 5px;
}

.preview-box {
    background: #fdfcfa;
    border: 1px solid #f0e6d2;
    border-left: 4px solid #d4a574;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.preview-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c1810;
    margin-bottom: 15px;
}

.preview-section {
    margin-bottom: 15px;
}

.preview-label {
    font-weight: 600;
    color: #5d4e37;
    margin-bottom: 5px;
}

.preview-content {
    color: #2c1810;
    line-height: 1.6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border: 1px solid #f0e6d2;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #d4a574;
    margin-bottom: 5px;
}

.stat-label {
    color: #5d4e37;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.quick-actions {
    margin-top: 30px;
}

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

.action-card {
    background: white;
    border: 1px solid #f0e6d2;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: #5d4e37;
    transition: all 0.3s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    border-color: #d4a574;
    color: #d4a574;
    text-decoration: none;
}

.action-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.action-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.action-desc {
    font-size: 12px;
    color: #9b8b7a;
}

.devotions-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.devotions-table th {
    background: #f8f6f3;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c1810;
    border-bottom: 1px solid #f0e6d2;
}

.devotions-table th:first-child {
    border-radius: 8px 0 0 0;
}

.devotions-table th:last-child {
    border-radius: 0 8px 0 0;
}

.devotions-table td {
    padding: 15px;
    border-bottom: 1px solid #f0e6d2;
    vertical-align: middle;
}

.devotions-table tr:hover {
    background: #fdfcfa;
}

.table-actions {
    white-space: nowrap;
}

.errors {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.errors ul {
    margin: 0;
    padding-left: 20px;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f8f6f3;
}

.login-form {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #f0e6d2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-form h1 {
    text-align: center;
    color: #2c1810;
    margin-bottom: 30px;
    font-size: 28px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .btn {
    width: 100%;
    margin-right: 0;
}

/* Calendar Styles */
.calendar {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #f0e6d2;
    margin-top: 20px;
    max-width: 100%;
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 5px;
}

.calendar-nav {
    background: none;
    border: none;
    color: #d4a574;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav:hover {
    background: #f8f6f3;
}

.calendar-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c1810;
    flex: 1;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    width: 100%;
}

.calendar-day-header {
    padding: 6px 2px;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: #9b8b7a;
    text-transform: uppercase;
    line-height: 1;
}

.calendar-day {
    width: 100%;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    font-weight: 500;
    position: relative;
    border: 1px solid transparent;
    box-sizing: border-box;
}

.calendar-day:hover {
    background: #f8f6f3;
    border-color: #d4a574;
}

.calendar-day.other-month {
    color: #d0c5b5;
}

.calendar-day.weekend {
    background: #fafafa;
}

.calendar-day.has-devotion {
    background: #52c41a;
    color: white;
}

.calendar-day.has-devotion:hover {
    background: #389e0d;
}

.calendar-day.today {
    background: #d4a574;
    color: white;
}

.calendar-day.today:hover {
    background: #a0856b;
}

.calendar-legend {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0e6d2;
    font-size: 10px;
    flex-wrap: wrap;
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.calendar-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-today {
    background: #d4a574;
}

.legend-has-devotion {
    background: #52c41a;
}

.legend-empty {
    background: #d9d9d9;
}

@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        position: static;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .devotions-table {
        font-size: 14px;
    }
    
    .devotions-table th,
    .devotions-table td {
        padding: 10px;
    }
    
    .calendar {
        padding: 10px;
        margin-top: 15px;
    }
    
    .calendar-day {
        height: 24px;
        font-size: 10px;
    }
    
    .calendar-legend {
        gap: 8px;
        font-size: 9px;
    }
    
    .calendar-legend-item {
        gap: 3px;
    }
}