/* =============================================
   JOSUÉ MARKETING - Main Stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #FDFAF6;
    --bg-warm: #F7F0E8;
    --bg-dark: #1C1917;
    --card: #FFFFFF;
    --terra: #C2410C;
    --terra-light: #EA580C;
    --terra-soft: #FFF7ED;
    --green: #166534;
    --green-light: #16A34A;
    --green-soft: #F0FDF4;
    --blue: #1D4ED8;
    --blue-soft: #EFF6FF;
    --purple: #7C3AED;
    --purple-soft: #F3E8FF;
    --yellow: #F59E0B;
    --text: #1C1917;
    --text-2: #44403C;
    --text-muted: #78716C;
    --border: #E7E5E4;
    --border-dark: #D6D3D1;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.04), 0 20px 48px rgba(0,0,0,0.08);
    --font-display: 'DM Serif Display', serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 400; }

a { color: var(--terra); text-decoration: none; }
a:hover { color: var(--terra-light); }

img { max-width: 100%; height: auto; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius-sm);
    border: none; font-family: var(--font-body);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all 0.3s; text-decoration: none; line-height: 1.4;
}

.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-xs); }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: 12px; }
.btn-block { width: 100%; justify-content: center; }

.btn-terra { background: var(--terra); color: #fff; box-shadow: 0 2px 12px rgba(194,65,12,0.2); }
.btn-terra:hover { background: var(--terra-light); transform: translateY(-1px); color: #fff; }

.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-light); color: #fff; }

.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #20BD5A; color: #fff; }

.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border-dark); }
.btn-outline:hover { background: var(--bg-warm); }

.btn-danger { background: #DC2626; color: #fff; }
.btn-danger:hover { background: #B91C1C; color: #fff; }

.btn-ghost { background: transparent; color: var(--text-muted); padding: 8px 12px; }
.btn-ghost:hover { background: var(--bg-warm); color: var(--text); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: 14px; font-weight: 600;
    margin-bottom: 6px; color: var(--text);
}
.form-group .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.form-control {
    width: 100%; padding: 12px 16px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); font-family: var(--font-body);
    font-size: 14px; color: var(--text); background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none; border-color: var(--terra);
    box-shadow: 0 0 0 3px rgba(194,65,12,0.1);
}

textarea.form-control { min-height: 100px; resize: vertical; }
select.form-control { cursor: pointer; }

/* ===== CARDS ===== */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    transition: all 0.3s;
}
.card:hover { box-shadow: var(--shadow); }
.card-header { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.card-title { font-family: var(--font-body); font-size: 18px; font-weight: 700; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; border-radius: 50px;
    font-size: 12px; font-weight: 600;
}
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-confirmed { background: #DBEAFE; color: #1E40AF; }
.badge-completed { background: var(--green-soft); color: var(--green); }
.badge-cancelled { background: #FEE2E2; color: #991B1B; }
.badge-paid { background: var(--green-soft); color: var(--green); }
.badge-terra { background: var(--terra-soft); color: var(--terra); }

/* ===== ALERTS ===== */
.alert {
    padding: 14px 20px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--green-soft); color: var(--green); border: 1px solid #BBF7D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: var(--blue-soft); color: var(--blue); border: 1px solid #BFDBFE; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th {
    text-align: left; padding: 12px 16px;
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}
table td {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    font-size: 14px; color: var(--text-2);
}
table tr:hover td { background: var(--bg-warm); }

/* ===== NAVIGATION ===== */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(253,250,246,0.92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
.navbar .container {
    display: flex; justify-content: space-between; align-items: center;
}
.nav-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: var(--text);
}
.nav-brand-mark {
    width: 36px; height: 36px; background: var(--terra);
    border-radius: 9px; display: flex; align-items: center;
    justify-content: center; color: #fff;
    font-family: var(--font-display); font-size: 18px;
    transform: rotate(-2deg);
}
.nav-brand-text { font-family: var(--font-display); font-size: 18px; }
.nav-brand-text em { color: var(--terra); font-style: italic; }

.nav-links { display: flex; align-items: center; gap: 20px; list-style: none; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }

.nav-user {
    display: flex; align-items: center; gap: 10px;
}
.nav-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--terra-soft); display: flex;
    align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: var(--terra);
}

/* ===== SIDEBAR LAYOUT (Admin/Client panels) ===== */
.app-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }

.sidebar {
    background: var(--bg-dark); color: #A8A29E;
    padding: 24px 0; position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 0 20px; margin-bottom: 32px;
    text-decoration: none; color: #fff;
}
.sidebar-brand-mark {
    width: 36px; height: 36px; background: var(--terra);
    border-radius: 9px; display: flex; align-items: center;
    justify-content: center; color: #fff;
    font-family: var(--font-display); font-size: 18px;
    transform: rotate(-2deg);
}
.sidebar-brand-text { font-family: var(--font-display); font-size: 17px; color: #fff; }
.sidebar-brand-text em { color: var(--terra-light); font-style: italic; }

.sidebar-section { margin-bottom: 24px; }
.sidebar-section-title {
    padding: 0 20px; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: #57534E; margin-bottom: 8px;
}

.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px; font-size: 14px; font-weight: 500;
    color: #A8A29E; text-decoration: none; transition: all 0.2s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover { background: rgba(255,255,255,0.04); color: #E7E5E4; }
.sidebar-link.active {
    color: #fff; background: rgba(194,65,12,0.1);
    border-left-color: var(--terra);
}
.sidebar-link .icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-link .badge-count {
    margin-left: auto; background: var(--terra);
    color: #fff; width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700;
}

.sidebar-bottom {
    padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06);
    margin-top: auto;
}

.main-panel { padding: 32px 40px; overflow-y: auto; }
.main-panel-header { margin-bottom: 32px; }
.main-panel-header h1 { font-size: 28px; margin-bottom: 4px; }
.main-panel-header p { font-size: 14px; color: var(--text-muted); }

/* ===== STATS CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.stat-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 20px;
}
.stat-card .stat-icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; margin-bottom: 12px;
}
.stat-card .stat-value {
    font-family: var(--font-display); font-size: 28px;
    margin-bottom: 2px;
}
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); }

/* ===== CATEGORY CARDS (Landing page) ===== */
.category-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }

.category-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
    cursor: pointer; transition: all 0.3s;
    position: relative; overflow: hidden;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.category-card-icon {
    width: 60px; height: 60px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; margin-bottom: 16px;
}
.category-card h3 {
    font-family: var(--font-body); font-size: 20px;
    font-weight: 700; margin-bottom: 8px;
}
.category-card p {
    font-size: 14px; color: var(--text-muted);
    margin-bottom: 16px; line-height: 1.6;
}
.category-card .topic-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.topic-tag {
    background: var(--bg-warm); border: 1px solid var(--border);
    padding: 5px 12px; border-radius: 50px;
    font-size: 12px; font-weight: 600; color: var(--text-2);
    cursor: pointer; transition: all 0.2s;
}
.topic-tag:hover { background: var(--terra-soft); border-color: var(--terra); color: var(--terra); }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: none; align-items: center; justify-content: center;
    z-index: 1000; padding: 24px;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--card); border-radius: var(--radius);
    padding: 32px; max-width: 500px; width: 100%;
    box-shadow: var(--shadow-lg); max-height: 90vh; overflow-y: auto;
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.modal-header h2 { font-size: 22px; }
.modal-close {
    width: 32px; height: 32px; border-radius: 50%;
    border: none; background: var(--bg-warm); cursor: pointer;
    font-size: 18px; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.modal-close:hover { background: var(--border); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .app-layout { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .main-panel { padding: 20px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .category-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
    .hero-ctas { flex-direction: column; }
}

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-terra { color: var(--terra); }
.text-green { color: var(--green); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
