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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #faf6f9;
    color: #4a3a44;
    min-height: 100vh;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 25px;
    border-bottom: 2px solid #f0e0ed;
    margin-bottom: 30px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 2rem;
}

header h1 {
    color: #5c3d52;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #d4a0c7;
    color: white;
}

.btn-primary:hover {
    background: #c48db6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 160, 199, 0.3);
}

.btn-secondary {
    background: #e8d5e4;
    color: #5c3d52;
}

.btn-secondary:hover {
    background: #ddc8d9;
}

.btn-danger {
    background: #e8b4b8;
    color: white;
}

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #fce4f7 0%, #f0d6ea 100%);
}

.login-box {
    background: white;
    padding: 45px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(92, 61, 82, 0.1);
    width: 100%;
    max-width: 380px;
}

.login-icon {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 15px;
}

.login-box h1 {
    text-align: center;
    color: #5c3d52;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    color: #9a7b8e;
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.error-message {
    color: #d47a82;
    text-align: center;
    margin-top: 15px;
    font-weight: 500;
    display: none;
    font-size: 0.9rem;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #5c3d52;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #f0e0ed;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fcf8fb;
    color: #4a3a44;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #d4a0c7;
    background: white;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #c4b0bd;
}

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

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.entries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.entry-card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(92, 61, 82, 0.06);
    border-left: 4px solid #d4a0c7;
    position: relative;
}

.entry-card h3 {
    color: #5c3d52;
    font-size: 1.15rem;
    margin-bottom: 6px;
    font-weight: 600;
}

.entry-card .entry-meta {
    color: #9a7b8e;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.entry-card .entry-preview {
    color: #6a5562;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.entry-card .entry-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(92, 61, 82, 0.3);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.25s;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 16px;
    max-width: 560px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.25s;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    color: #5c3d52;
    font-size: 1.4rem;
}

.close {
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    color: #9a7b8e;
    line-height: 1;
    transition: color 0.2s;
}

.close:hover {
    color: #5c3d52;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.write-container {
    max-width: 750px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(92, 61, 82, 0.06);
}

.status-message {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    display: none;
}

.status-message.success {
    display: block;
    background: #f0e8ee;
    color: #5c3d52;
}

.status-message.error {
    display: block;
    background: #f8e8ea;
    color: #b46a72;
}

.status-message.info {
    display: block;
    background: #e8ecf5;
    color: #5a6a82;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #9a7b8e;
    font-size: 1rem;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9a7b8e;
    grid-column: 1 / -1;
}

.empty-state .emoji {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.empty-state h3 {
    color: #5c3d52;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.empty-state p {
    font-size: 0.95rem;
}

.admin-entry-item {
    background: white;
    padding: 15px 20px;
    border-radius: 10px;
    border-left: 4px solid #d4a0c7;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(92, 61, 82, 0.06);
}

.admin-entry-item:hover {
    box-shadow: 0 2px 8px rgba(92, 61, 82, 0.1);
}

.admin-entry-info h4 {
    color: #5c3d52;
    font-size: 1rem;
    margin-bottom: 4px;
}

.admin-entry-info small {
    color: #9a7b8e;
    font-size: 0.8rem;
}

.admin-entry-actions {
    display: flex;
    gap: 8px;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px 0 20px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .entries-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .login-box {
        padding: 30px 25px;
        margin: 15px;
    }
    
    .write-container {
        padding: 20px;
    }
    
    .admin-entry-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .admin-entry-actions {
        justify-content: stretch;
    }
    
    .admin-entry-actions .btn {
        flex: 1;
    }
}