:root {
    --primary: #4f46e5;       /* Indigo */
    --primary-hover: #4338ca;
    --bg-dark: #1e293b;       /* Dark Slate */
    --bg-light: #f1f5f9;      /* Light Gray */
    --white: #ffffff;
    --text-main: #334155;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, sans-serif; }

body { background: var(--bg-light); color: var(--text-main); height: 100vh; overflow: hidden; }

/* Layout */
.app-container { display: flex; height: 100%; }

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-dark);
    color: var(--white);
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.logo { font-size: 20px; font-weight: bold; margin-bottom: 40px; display: flex; align-items: center; gap: 10px; }
.menu a {
    display: flex; align-items: center; gap: 12px;
    color: var(--text-muted);
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: 0.2s;
}
.menu a:hover, .menu a.active { background: rgba(255,255,255,0.1); color: var(--white); }
.user-profile { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.avatar { width: 32px; height: 32px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; }

/* Main Content */
.main-content { flex: 1; padding: 30px; overflow-y: auto; display: flex; flex-direction: column; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    flex: 1; /* Занять оставшееся место */
}
.day-name { background: var(--white); padding: 15px; text-align: center; font-weight: 600; color: var(--text-muted); }
.calendar-day {
    background: var(--white);
    min-height: 100px;
    padding: 10px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}
.calendar-day:hover { background: #f8fafc; }
.calendar-day.today { background: #eff6ff; }
.date-num { font-weight: bold; font-size: 14px; margin-bottom: 5px; display: block; }
.post-dot {
    display: block;
    background: var(--primary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center; justify-content: center;
    backdrop-filter: blur(2px);
    z-index: 1000;
}
.modal-overlay.active { display: flex; }
.modal-window {
    background: var(--white);
    width: 900px;
    max-width: 90%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
}
.modal-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.close-btn { background: none; border: none; font-size: 20px; cursor: pointer; }
.modal-body { display: flex; padding: 20px; gap: 30px; background: #f8fafc; }

/* Form */
.post-form { flex: 1; display: flex; flex-direction: column; gap: 15px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--text-main); }
input, select, textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); }
.file-upload {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background: white;
    color: var(--text-muted);
    transition: 0.2s;
}
.file-upload:hover { border-color: var(--primary); color: var(--primary); }

/* Buttons */
.btn { padding: 10px 20px; border-radius: 8px; border: none; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-block { width: 100%; justify-content: center; margin-top: 10px; }

/* Phone Preview */
.preview-section { flex: 0 0 320px; display: flex; flex-direction: column; align-items: center; }
.phone-mockup {
    width: 280px;
    height: 500px;
    background: white;
    border: 8px solid #333;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.phone-header { background: #f0f2f5; padding: 10px; font-size: 12px; font-weight: bold; text-align: center; border-bottom: 1px solid #ddd; }
.post-card { padding: 10px; }
.post-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.post-avatar { width: 30px; height: 30px; background: #ddd; border-radius: 50%; }
.post-name { font-size: 12px; font-weight: bold; }
.post-date { font-size: 10px; color: #888; }
.post-content-text { font-size: 13px; margin-bottom: 10px; white-space: pre-wrap; word-wrap: break-word; }
.post-content-img img { width: 100%; border-radius: 8px; }
.preview-hint { margin-top: 10px; font-size: 12px; color: var(--text-muted); }