:root {
  --green: #1a3a2a;
  --green-mid: #2d5a40;
  --green-light: #a8c5b0;
  --accent: #4caf7d;
  --danger: #e53935;
  --bg: #f5f7f5;
  --card: #ffffff;
  --border: #dde8dd;
  --text: #1a1a1a;
  --muted: #6b7c73;
  --radius: 6px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
.nav { background: var(--green); padding: 0 24px; display: flex; align-items: center; gap: 8px; height: 52px; position: relative; z-index: 100; }
.nav-brand { color: #fff; font-weight: 600; font-size: 16px; flex-shrink: 0; margin-right: 8px; }
.nav-links { display: flex; gap: 2px; flex: 1; align-items: center; }
.nav-links > a { color: var(--green-light); padding: 6px 12px; border-radius: var(--radius); font-size: 14px; transition: background 0.15s, color 0.15s; }
.nav-links > a:hover, .nav-links > a.active { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-btn { display: flex; align-items: center; gap: 5px; color: var(--green-light); padding: 6px 12px; border-radius: var(--radius); font-size: 14px; cursor: pointer; background: none; border: none; transition: background 0.15s, color 0.15s; white-space: nowrap; line-height: 1; }
.nav-dropdown-btn:hover, .nav-dropdown.active .nav-dropdown-btn { background: rgba(255,255,255,0.12); color: #fff; }
.nav-dropdown-btn .caret { font-size: 9px; opacity: 0.7; line-height: 1; }
.nav-dropdown-menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,0.12); min-width: 160px; overflow: hidden; }
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a { display: block; padding: 9px 16px; font-size: 14px; color: var(--text); transition: background 0.12s; }
.nav-dropdown-menu a:hover { background: var(--bg); text-decoration: none; }
.nav-dropdown-menu a.active { color: var(--accent); font-weight: 500; }

.nav-user { display: flex; align-items: center; gap: 12px; color: var(--green-light); font-size: 13px; }
.nav-user a { color: var(--green-light); font-size: 13px; }
.nav-user a:hover { color: #fff; }

/* Main */
.main { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.page-header h2 { font-size: 22px; font-weight: 600; flex: 1; }
.page-actions { display: flex; gap: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid var(--border); background: var(--card); color: var(--text); transition: all 0.15s; text-decoration: none; }
.btn:hover { background: #f0f0f0; text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-primary:hover { background: var(--green-mid); }
.btn-secondary { background: var(--card); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c62828; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn-slack { background: #4a154b; color: #fff; border-color: #4a154b; padding: 12px 20px; font-size: 16px; width: 100%; justify-content: center; gap: 12px; }
.btn-slack:hover { background: #611f6b; text-decoration: none; }

/* Forms */
.compose-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input, .form-textarea, .form-select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; font-family: inherit; color: var(--text); background: #fff; transition: border-color 0.15s; }
.form-input:focus, .form-textarea:focus, .form-select:focus { outline: none; border-color: var(--accent); }
.form-textarea { resize: vertical; }
.form-actions { display: flex; gap: 12px; }

/* Platform checks */
.platform-checks { display: flex; gap: 16px; flex-wrap: wrap; }
.check-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.check-label input { cursor: pointer; }
.char-limit { color: var(--muted); font-size: 12px; }
.char-counts { margin-top: 6px; display: flex; gap: 12px; flex-wrap: wrap; }
.char-count-item { font-size: 13px; color: var(--muted); }
.char-count-item.over { color: var(--danger); font-weight: 600; }

/* Schedule */
.schedule-opts { display: flex; flex-direction: column; gap: 8px; }
.radio-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }

/* Upload zone */
.upload-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px; text-align: center; cursor: pointer; transition: border-color 0.15s; }
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); }
.upload-zone p { color: var(--muted); font-size: 14px; }
.upload-zone .link { color: var(--accent); cursor: pointer; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fdecea; color: #b71c1c; border: 1px solid #ffcdd2; }
.alert-success { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }

/* Table */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; background: var(--card); }
.table th { background: #f8faf8; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #f8faf8; }
.truncate { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; color: var(--muted); padding: 32px !important; }

/* Badges & Status */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.badge-facebook { background: #e8f0fe; color: #1a73e8; }
.badge-instagram { background: #fce4ec; color: #c2185b; }
.badge-linkedin { background: #e3f2fd; color: #0277bd; }
.status { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; text-transform: capitalize; }
.status-pending { background: #fff8e1; color: #f57f17; }
.status-scheduled { background: #e3f2fd; color: #1565c0; }
.status-sending { background: #e8f5e9; color: #2e7d32; }
.status-sent { background: #e8f5e9; color: #1b5e20; }
.status-published { background: #e8f5e9; color: #1b5e20; }
.status-rejected { background: #fce4ec; color: #880e4f; }
.status-failed { background: #fbe9e7; color: #bf360c; }
.status-active { background: #e8f5e9; color: #1b5e20; }
.status-unsubscribed { background: #fce4ec; color: #880e4f; }
.status-draft { background: #f5f5f5; color: #616161; }

/* Filter bar */
.filter-bar { display: flex; gap: 8px; margin-bottom: 16px; }

/* Pagination */
.pagination { display: flex; gap: 4px; margin-top: 16px; justify-content: center; }
.pagination a { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; color: var(--text); }
.pagination a.active { background: var(--green); color: #fff; border-color: var(--green); }
.pagination a:hover:not(.active) { background: #f0f0f0; text-decoration: none; }

/* Dashboard */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-number { font-size: 28px; font-weight: 700; color: var(--green); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dash-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.dash-list li { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.dash-list li:last-child { border-bottom: none; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.4); }
.modal-content { position: relative; background: var(--card); border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; }
.modal-lg { max-width: 700px; }
.modal-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-header h3 { flex: 1; font-size: 17px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 40px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo h1 { font-size: 22px; font-weight: 700; color: var(--green); }
.login-logo p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* Public pages */
.public-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.public-card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 40px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.public-header { text-align: center; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.public-header h1 { font-size: 20px; font-weight: 700; color: var(--green); }
.public-header p { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* Utilities */
.text-muted { color: var(--muted); font-size: 14px; }
