/* igMate App Styles */
:root {
  --primary: #E1306C;
  --primary-dark: #c92e5f;
  --bg: #f5f5f5;
  --card: #fff;
  --text: #1a1a2e;
  --text-light: #666;
  --border: #e8ecef;
  --success: #27ae60;
  --error: #e74c3c;
  --warning: #f39c12;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--card); border-right: 1px solid var(--border); padding: 20px 0; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; }
.sidebar .logo { font-size: 20px; font-weight: 800; padding: 0 20px 20px; color: var(--primary); border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.sidebar nav { display: flex; flex-direction: column; flex: 1; padding: 0 8px; }
.sidebar nav a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; margin: 2px 0; transition: all .15s; }
.sidebar nav a:hover { background: rgba(225,48,108,0.08); color: var(--primary); }
.sidebar nav a.active { background: rgba(225,48,108,0.12); color: var(--primary); font-weight: 600; }

.main { margin-left: 220px; flex: 1; }
.content { padding: 24px; max-width: 1000px; }

/* Cards */
.card { background: var(--card); border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 16px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 16px; font-weight: 700; }
.card-body { padding: 20px; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 24px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); text-align: center; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 13px; color: var(--text-light); margin-top: 4px; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input[type="text"], .field input[type="url"], .field input[type="email"], .field input[type="password"], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; transition: border .15s; background: #fff;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.help { display: block; font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; transition: all .15s; }
.btn:hover { background: #f8f8f8; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { width: 100%; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--border); font-weight: 600; font-size: 12px; text-transform: uppercase; color: var(--text-light); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }

/* Page Header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 800; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); }
.login-box { background: #fff; padding: 40px; border-radius: 16px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); }
.login-box h1 { font-size: 28px; font-weight: 800; color: var(--primary); text-align: center; margin-bottom: 4px; }
.login-box .subtitle { text-align: center; color: var(--text-light); font-size: 14px; margin-bottom: 24px; }

/* Inbox */
.inbox-layout { display: grid; grid-template-columns: 300px 1fr; gap: 0; background: var(--card); border-radius: var(--radius); overflow: hidden; min-height: 60vh; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.inbox-list { border-right: 1px solid var(--border); overflow-y: auto; max-height: 70vh; }
.inbox-item { display: block; padding: 14px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); transition: background .1s; }
.inbox-item:hover { background: rgba(225,48,108,0.04); }
.inbox-item.active { background: rgba(225,48,108,0.08); border-left: 3px solid var(--primary); }
.inbox-item-name { font-weight: 600; font-size: 14px; }
.inbox-item-origin { font-size: 11px; color: var(--primary); font-weight: 500; }
.inbox-item-preview { font-size: 13px; color: var(--text-light); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item-time { font-size: 11px; color: #aaa; margin-top: -2px; float: right; }
.inbox-chat { display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; max-height: 60vh; }
.message { margin-bottom: 12px; max-width: 75%; }
.message-in { }
.message-out { margin-left: auto; }
.message-bubble { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.message-in .message-bubble { background: #f0f0f0; border-bottom-left-radius: 4px; }
.message-out .message-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.message-time { font-size: 11px; color: #aaa; margin-top: 2px; }
.chat-input { display: flex; border-top: 1px solid var(--border); padding: 12px; gap: 8px; }
.chat-input input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 20px; font-size: 14px; }
.chat-input button { background: var(--primary); color: #fff; border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; font-weight: 600; }

/* Campaigns */
.campaign-card { margin-bottom: 12px; }

/* Misc */
code { background: #f0f0f0; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
