/* =========================================================
   MR Socials — Agency Hub
   Brand-inspired design system
   Palette: dark charcoal base + vibrant indigo/violet accent,
   matching mrsocials.in's bold, modern agency feel.
   Fonts: Poppins (headings) + Inter (body) via Google Fonts.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Brand colors */
    --bg-dark: #0f1115;
    --bg-dark-2: #161922;
    --bg-panel: #1b1f2a;
    --bg-panel-hover: #20242f;
    --border-subtle: #2a2f3d;

    --accent: #6c5ce7;
    --accent-2: #a06cff;
    --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a06cff 100%);

    --text-primary: #f4f5f7;
    --text-secondary: #9aa0ac;
    --text-muted: #6b7280;

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --white: #ffffff;
    --light-bg: #f7f7fb;
    --light-panel: #ffffff;
    --light-border: #e7e8f0;
    --light-text: #1b1e27;
    --light-text-secondary: #656b78;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 4px 24px rgba(0,0,0,0.28);
    --shadow-card-light: 0 4px 20px rgba(20,20,40,0.06);

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--light-bg);
    color: var(--light-text);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; margin: 0 0 .5rem; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: var(--font-body); cursor: pointer; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .65rem 1.3rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: .92rem;
    border: 1px solid transparent;
    transition: all .18s ease;
}
.btn-primary { background: var(--accent-gradient); color: #fff; box-shadow: 0 6px 16px rgba(108,92,231,.35); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--light-border); color: var(--light-text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.btn-sm { padding: .4rem .85rem; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Auth pages ---------- */
.auth-body {
    background: radial-gradient(circle at 20% 20%, #201b3a 0%, var(--bg-dark) 55%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.auth-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-card);
    color: var(--text-primary);
}
.auth-logo { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.75rem; justify-content: center; }
.auth-logo .mark {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading); font-weight: 800; color: #fff; font-size: 1.1rem;
}
.auth-logo .word { font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; }
.auth-logo .word span { color: var(--accent-2); }
.auth-title { text-align: center; color: var(--text-primary); font-size: 1.3rem; margin-bottom: .25rem; }
.auth-sub { text-align: center; color: var(--text-secondary); font-size: .88rem; margin-bottom: 1.75rem; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-secondary); }
.field input, .field select, .field textarea {
    width: 100%;
    background: var(--bg-dark-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: .7rem .85rem;
    border-radius: var(--radius-sm);
    font-size: .92rem;
    font-family: var(--font-body);
    transition: border-color .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--accent);
}
.field-hint { font-size: .76rem; color: var(--text-muted); margin-top: .3rem; }

.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .86rem; margin-bottom: 1rem; }
.alert-error { background: rgba(239,68,68,.12); color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.alert-success { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.alert-info { background: rgba(59,130,246,.12); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }

/* ---------- App shell (light theme dashboard) ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--bg-dark);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    transition: transform .25s ease;
    z-index: 100;
}
.sidebar .brand {
    display: flex; align-items: center; gap: .65rem;
    padding: 1.4rem 1.3rem;
    border-bottom: 1px solid var(--border-subtle);
}
.sidebar .brand .mark {
    width: 36px; height: 36px; border-radius: 9px;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-heading); font-weight: 800; color: #fff;
}
.sidebar .brand .word { font-family: var(--font-heading); font-weight: 700; font-size: 1.05rem; }
.sidebar .brand .word span { color: var(--accent-2); }

.sidebar nav { flex: 1; padding: 1rem .8rem; overflow-y: auto; }
.sidebar .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 1.1rem .6rem .4rem; }
.sidebar .nav-link {
    display: flex; align-items: center; gap: .7rem;
    padding: .65rem .8rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: .89rem; font-weight: 500;
    margin-bottom: .15rem;
}
.sidebar .nav-link .ic { width: 18px; text-align: center; opacity: .85; }
.sidebar .nav-link:hover { background: var(--bg-panel-hover); color: var(--text-primary); }
.sidebar .nav-link.active { background: var(--accent-gradient); color: #fff; }
.sidebar .nav-link.active .ic { opacity: 1; }

.sidebar .user-box {
    padding: 1rem 1.3rem;
    border-top: 1px solid var(--border-subtle);
    display: flex; align-items: center; gap: .7rem;
}
.sidebar .user-box .avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--accent-gradient);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: .9rem; flex-shrink:0;
}
.sidebar .user-box .info { min-width: 0; flex: 1; }
.sidebar .user-box .info .name { font-size: .86rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-box .info .role { font-size: .74rem; color: var(--text-muted); }
.sidebar .user-box a.logout { color: var(--text-muted); flex-shrink: 0; }
.sidebar .user-box a.logout:hover { color: var(--danger); }

.main-content { margin-left: 250px; flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    background: var(--light-panel);
    border-bottom: 1px solid var(--light-border);
    padding: 1rem 1.75rem;
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.topbar h1 { font-size: 1.15rem; color: var(--light-text); }
.topbar .topbar-right { display: flex; align-items: center; gap: 1rem; }
.hamburger { display: none; background: none; border: none; font-size: 1.4rem; color: var(--light-text); }

.page-body { padding: 1.75rem; flex: 1; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block; padding: .28rem .65rem; border-radius: 999px;
    font-size: .74rem; font-weight: 600;
}
.badge-admin { background: rgba(108,92,231,.14); color: #6c5ce7; }
.badge-manager { background: rgba(59,130,246,.14); color: #3b82f6; }
.badge-executive { background: rgba(34,197,94,.14); color: #16a34a; }
.badge-designer { background: rgba(245,158,11,.14); color: #d97706; }
.badge-editor { background: rgba(239,68,68,.14); color: #dc2626; }
.badge-default { background: #eee; color: #555; }
.badge-active { background: rgba(34,197,94,.14); color: #16a34a; }
.badge-inactive { background: rgba(239,68,68,.14); color: #dc2626; }

/* ---------- Cards / stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.1rem; margin-bottom: 1.75rem; }
.stat-card {
    background: var(--light-panel); border: 1px solid var(--light-border);
    border-radius: var(--radius-md); padding: 1.3rem 1.4rem;
    box-shadow: var(--shadow-card-light);
}
.stat-card .stat-label { font-size: .8rem; color: var(--light-text-secondary); font-weight: 600; margin-bottom: .4rem; }
.stat-card .stat-value { font-family: var(--font-heading); font-size: 1.9rem; font-weight: 700; }
.stat-card .stat-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-gradient); color: #fff; margin-bottom: .8rem; font-size: 1.05rem;
}

.card {
    background: var(--light-panel); border: 1px solid var(--light-border);
    border-radius: var(--radius-md); padding: 1.5rem;
    box-shadow: var(--shadow-card-light); margin-bottom: 1.5rem;
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.card-header h2 { font-size: 1.05rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: .89rem; }
table.data-table th {
    text-align: left; padding: .8rem 1rem; background: #fafafe;
    color: var(--light-text-secondary); font-weight: 600; font-size: .78rem;
    text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--light-border);
}
table.data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--light-border); vertical-align: middle; }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: #fbfbff; }
.row-actions { display: flex; gap: .5rem; }
.avatar-sm {
    width: 32px; height: 32px; border-radius: 50%; background: var(--accent-gradient);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .8rem; flex-shrink: 0;
}
.name-cell { display: flex; align-items: center; gap: .6rem; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(15,17,21,.55);
    display: none; align-items: center; justify-content: center; z-index: 200; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--light-panel); border-radius: var(--radius-lg); width: 100%; max-width: 480px;
    padding: 1.75rem; box-shadow: var(--shadow-card);
}
.modal-box h3 { margin-bottom: 1.2rem; }
.modal-close { float: right; background: none; border: none; font-size: 1.2rem; color: var(--light-text-secondary); }

/* ---------- Utility ---------- */
.text-muted { color: var(--light-text-secondary); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--light-text-secondary); }
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.mb-0 { margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hamburger { display: block; }
}
@media (max-width: 560px) {
    .page-body { padding: 1.1rem; }
    .topbar { padding: .9rem 1.1rem; }
    .auth-card { padding: 1.8rem 1.4rem; }
}
