:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --ink: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --sidebar: #071426;
    --sidebar-2: #0e1d35;
    --purple: #5b21d9;
    --purple-2: #7c3aed;
    --blue: #2563eb;
    --green: #16a34a;
    --orange: #f97316;
    --red: #ef4444;
    --shadow: 0 18px 50px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
textarea { resize: vertical; }

.login-body { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top, #312e81, #071426 45%, #030712); padding: 24px; }
.login-card { width: min(440px, 100%); background: rgba(255,255,255,.96); border: 1px solid rgba(255,255,255,.28); border-radius: 28px; padding: 34px; box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.login-logo { width: 70px; height: 70px; border-radius: 24px; display: grid; place-items: center; color: white; font-size: 28px; font-weight: 800; background: linear-gradient(135deg, var(--purple), var(--purple-2)); margin-bottom: 18px; }
.login-card h1 { margin: 0; font-size: 32px; }
.login-card p { color: var(--muted); margin: 8px 0 22px; }
.login-demo { margin-top: 18px; padding: 14px; border-radius: 16px; background: #f3f4f6; color: #4b5563; font-size: 13px; line-height: 1.6; }
.form-stack, .admin-form { display: grid; gap: 12px; }
label { font-size: 13px; color: #374151; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; background: #fff; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--purple-2); box-shadow: 0 0 0 4px rgba(124, 58, 237, .12); }

.btn { border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; padding: 11px 16px; font-weight: 800; font-size: 14px; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { color: white; background: linear-gradient(135deg, var(--purple), var(--purple-2)); box-shadow: 0 12px 24px rgba(91, 33, 217, .25); }
.btn.light { background: #fff; color: #111827; border: 1px solid var(--line); }
.btn.ghost { background: #f4f1ff; color: var(--purple); }
.btn.danger { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.btn.full { width: 100%; }
.icon-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; font-size: 24px; }
.alert { padding: 13px 16px; border-radius: 14px; margin: 12px 0; }
.alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.app-shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--sidebar), #020617); color: white; padding: 22px 18px; display: flex; flex-direction: column; gap: 24px; }
.brand { text-align: center; padding-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-mark { font-size: 36px; font-weight: 800; letter-spacing: -2px; }
.brand-name { text-transform: uppercase; font-size: 10px; letter-spacing: .18em; color: #cbd5e1; }
.client-card { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 18px; background: rgba(255,255,255,.04); }
.client-logo { width: 42px; height: 42px; border-radius: 50%; background: white; color: #46602b; display: grid; place-items: center; font-weight: 900; }
.client-card span { display: block; color: #cbd5e1; font-size: 12px; }
.client-card strong { font-size: 15px; }
.side-nav { display: grid; gap: 8px; }
.side-nav a { color: white; padding: 13px 14px; border-radius: 14px; font-weight: 700; font-size: 14px; }
.side-nav a.active, .side-nav a:hover { background: linear-gradient(135deg, var(--purple), var(--purple-2)); }
.help-box { margin-top: auto; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; padding: 16px; background: rgba(255,255,255,.06); font-size: 13px; }
.help-box span { display: block; color: #cbd5e1; margin-top: 4px; }

.main-content { min-width: 0; }
.topbar { height: 92px; background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; gap: 18px; }
.topbar h1 { margin: 0; font-size: 26px; }
.topbar p { margin: 5px 0 0; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-pill { display: inline-flex; align-items: center; padding: 10px 14px; border-radius: 999px; background: #f3f4f6; font-weight: 800; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 0; height: calc(100vh - 92px); }
.calendar-panel { min-width: 0; padding: 24px; overflow: auto; }
.detail-panel { background: white; border-left: 1px solid var(--line); padding: 22px; overflow: auto; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.month-controls { display: flex; align-items: center; gap: 12px; }
.month-controls h2 { margin: 0; font-size: 26px; }
.filters-row { display: flex; gap: 10px; align-items: center; }
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: #111827; font-weight: 800; margin-bottom: 8px; }
.weekdays span { padding: 10px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; gap: 1px; }
.day-cell { min-height: 165px; background: white; padding: 12px; position: relative; }
.day-cell.muted { background: #fbfbfd; }
.day-cell.today { box-shadow: inset 0 0 0 2px rgba(124, 58, 237, .55); }
.day-number { font-size: 18px; font-weight: 900; margin-bottom: 8px; }
.mini-post { display: block; border: 1px solid transparent; border-radius: 12px; padding: 5px; margin-bottom: 8px; background: #fafafa; }
.mini-post.selected { border-color: var(--purple-2); background: #f5f3ff; }
.mini-thumb { height: 70px; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #d8b4fe, #f5d0fe); display: grid; place-items: center; color: white; font-weight: 900; }
.mini-thumb img, .post-media img, .post-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-placeholder { background: #111827; width: 100%; height: 100%; display: grid; place-items: center; color: white; }
.placeholder-art { font-size: 18px; letter-spacing: .1em; }
.mini-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; gap: 6px; }
.status { display: inline-flex; padding: 4px 7px; border-radius: 7px; font-size: 11px; font-weight: 900; white-space: nowrap; }
.status-draft { background: #e5e7eb; color: #374151; }
.status-pending { background: #fef3c7; color: #92400e; }
.status-changes { background: #ffedd5; color: #c2410c; }
.status-approved { background: #ede9fe; color: #5b21b6; }
.status-scheduled { background: #dbeafe; color: #1d4ed8; }
.status-published { background: #dcfce7; color: #15803d; }
.platforms-small { display: flex; gap: 3px; flex-wrap: wrap; }
.platforms-small b { font-size: 10px; background: #eef2ff; color: #3730a3; border-radius: 6px; padding: 3px 4px; }
.legend { display: flex; justify-content: center; gap: 22px; padding: 18px; color: #374151; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; }
.dot.gray { background: #9ca3af; } .dot.blue { background: #2563eb; } .dot.green { background: #16a34a; } .dot.purple { background: #7c3aed; }

.detail-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.detail-head small { color: var(--muted); font-weight: 800; }
.detail-head h3 { margin: 6px 0 0; font-size: 20px; }
.tabs { display: flex; gap: 24px; margin: 16px 0; border-bottom: 1px solid var(--line); }
.tabs span { padding: 0 0 12px; font-weight: 800; color: var(--muted); }
.tabs .active { color: var(--purple); border-bottom: 3px solid var(--purple); }
.social-preview { display: grid; place-items: center; }
.phone-card { width: min(330px, 100%); border: 8px solid #111827; border-radius: 32px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.phone-top { text-align: center; padding: 13px; border-bottom: 1px solid var(--line); font-family: Georgia, serif; font-size: 20px; }
.post-user { display: flex; align-items: center; gap: 10px; padding: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #4c1d95; color: white; display: grid; place-items: center; font-weight: 900; font-size: 12px; }
.post-media { height: 300px; background: #f3f4f6; display: grid; place-items: center; }
.preview-placeholder { height: 100%; width: 100%; display: grid; place-items: center; color: #6b7280; background: linear-gradient(135deg, #f5f5f4, #d6d3d1); }
.post-icons { padding: 10px 12px; font-size: 22px; }
.post-icons span { float: right; }
.phone-card p { padding: 0 12px 8px; margin: 0; font-size: 13px; line-height: 1.45; }
.hashtags { color: #2563eb; }
.info-card, .comments-card, .history-card { margin-top: 18px; border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: #fff; }
.info-card h4, .comments-card h4 { margin: 0 0 12px; }
.platform-badge { display: inline-flex; margin: 4px 4px 0 0; padding: 5px 8px; background: #f3f4f6; border-radius: 8px; font-weight: 800; font-size: 12px; }
.comments-head { display: flex; justify-content: space-between; align-items: center; }
.comments-head span { background: var(--purple); color: white; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.comment { border-top: 1px solid var(--line); padding: 12px 0; }
.comment small { float: right; color: var(--muted); }
.comment p { margin: 8px 0 0; color: #374151; }
.comment-form { display: grid; gap: 10px; }
.approval-actions { display: grid; gap: 10px; margin-top: 18px; }
.changes-form { display: grid; gap: 10px; }
.history-card summary { cursor: pointer; font-weight: 900; }
.history-item { border-top: 1px solid var(--line); padding: 10px 0; }
.history-item small { display: block; color: var(--muted); margin-top: 3px; }
.empty-detail { min-height: 70vh; display: grid; place-items: center; text-align: center; color: var(--muted); }

.simple-page { min-height: 100vh; padding: 34px; background: var(--bg); }
.form-panel { margin: 0 auto; width: min(760px, 100%); background: white; border-radius: 24px; padding: 26px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.form-panel.wide { width: min(1100px, 100%); }
.form-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.form-header h1 { margin: 0; }
.form-header p { margin: 6px 0 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.checkbox-row { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 0; }
.checkbox-row label { background: #f9fafb; border: 1px solid var(--line); padding: 10px 12px; border-radius: 12px; }
.checkbox-row input { width: auto; }
.muted-text { color: var(--muted); font-size: 13px; }
.table-card { overflow: auto; border: 1px solid var(--line); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { text-align: left; padding: 14px; border-bottom: 1px solid var(--line); }
th { background: #f9fafb; font-size: 13px; color: #4b5563; }

@media (max-width: 1100px) {
    .app-shell { grid-template-columns: 88px 1fr; }
    .brand-name, .client-card div, .side-nav a { font-size: 0; }
    .side-nav a { text-align: center; }
    .help-box { display: none; }
    .workspace { grid-template-columns: 1fr; height: auto; }
    .detail-panel { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: static; flex-direction: row; overflow-x: auto; align-items: center; }
    .brand, .client-card { display: none; }
    .topbar { height: auto; padding: 18px; flex-direction: column; align-items: flex-start; }
    .top-actions { flex-wrap: wrap; }
    .calendar-grid { grid-template-columns: 1fr; }
    .weekdays { display: none; }
    .day-cell { min-height: auto; }
    .grid-2 { grid-template-columns: 1fr; }
    .calendar-toolbar { flex-direction: column; align-items: flex-start; gap: 12px; }
}
