/* Casa Magnolia Admin CSS - Elegant Botanical Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,400&display=swap');

:root {
    --primary: #2C4336;
    --primary-light: #3D5A4A;
    --primary-dark: #192A21;
    --accent: #C5A059;
    --accent-light: #E8D8B6;
    --bg-main: #FAF8F5;
    --bg-card: #FFFFFF;
    --text-main: #222523;
    --text-muted: #6B726E;
    --border-color: #E5E0D8;
    --sidebar-bg: #1B2B22;
    --sidebar-text: #D5DCD7;
    --sidebar-active: #C5A059;
    --danger: #A94442;
    --success: #2E7D32;
    --warning: #D97706;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: center;
}

.sidebar-brand-title {
    font-size: 1.5rem;
    color: #FFFFFF;
    letter-spacing: 0.5px;
}

.sidebar-brand-subtitle {
    font-size: 0.75rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.4);
    padding: 12px 16px 6px 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    margin-bottom: 4px;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #FFFFFF;
}

.nav-item.active {
    background: var(--primary-light);
    color: #FFFFFF;
    font-weight: 500;
    box-shadow: inset 3px 0 0 var(--sidebar-active);
}

.nav-icon {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #FFFFFF;
}

.user-role {
    font-size: 0.75rem;
    color: var(--accent);
}

/* Main Content Area */
.app-main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-header {
    background-color: var(--bg-card);
    height: 70px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 90;
}

.page-title-area {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 1.4rem;
}

.content-body {
    padding: 32px;
    flex: 1;
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 24px;
}

.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background-color: #E8F5E9;
    color: #1B5E20;
    border-left: 4px solid var(--success);
}

.alert-error {
    background-color: #FFEBEE;
    color: #B71C1C;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background-color: #FFF8E1;
    color: #F57F17;
    border-left: 4px solid var(--warning);
}

/* Cards & Grid */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;

}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: #F2EFE9;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.gold {
    background: #FAF3E3;
    color: var(--accent);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.data-table th {
    background: #F4F1EC;
    color: var(--primary-dark);
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tr:hover {
    background: #FAF8F5;
}

/* Badges & Buttons */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-activo, .badge-publicado {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-proximo, .badge-borrador {
    background: #E3F2FD;
    color: #1565C0;
}

.badge-expirado, .badge-finalizado {
    background: #FFEBEE;
    color: #C62828;
}

.badge-proximo-a-expirar, .badge-programado {
    background: #FFF3E0;
    color: #EF6C00;
}

.badge-type {
    background: #F3E5F5;
    color: #6A1B9A;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #E8E3DA;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #DCD5C8;
}

.btn-danger {
    background: var(--danger);
    color: #FFFFFF;
}

.btn-danger:hover {
    background: #843230;
}

.btn-accent {
    background: var(--accent);
    color: #FFFFFF;
}

.btn-accent:hover {
    background: #AA8643;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--primary-dark);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: #FFFFFF;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 67, 54, 0.12);
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

/* Gallery Grid */
.photo-mosaic {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.photo-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #EFECE6;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.photo-card:hover img {
    transform: scale(1.04);
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
}

.photo-card:hover .photo-overlay {
    opacity: 1;
}

/* Login Page Styling */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1B2B22 0%, #2C4336 100%);
    padding: 20px;
}

.login-card {
    background: #FFFFFF;
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    width: 90px;
    height: auto;
    margin-bottom: 16px;
    border-radius: 50%;
}

.login-title {
    font-size: 1.8rem;
    margin-bottom: 6px;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* QR Card */
.qr-container {
    text-align: center;
    padding: 20px;
    background: #FFFFFF;
    border-radius: var(--radius-md);
    border: 1px dashed var(--accent);
}

.qr-image {
    width: 200px;
    height: 200px;
    margin: 16px auto;
}

/* Responsive */
@media (max-width: 900px) {
    .app-sidebar {
        width: 70px;
    }
    .sidebar-brand-title, .sidebar-brand-subtitle, .nav-label, .nav-item span, .user-info {
        display: none;
    }
    .app-main {
        margin-left: 70px;
    }
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
}

/* ==========================================================================
   Article Editor Toolbar & Snippets
   ========================================================================== */
.editor-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    overflow: hidden;
}

.editor-toolbar {
    background: #F7F5F0;
    border-bottom: 1px solid var(--border-color);
    padding: 10px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.editor-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #FFFFFF;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.07);
}

.editor-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0 4px;
    user-select: none;
}

.editor-btn {
    appearance: none;
    border: 1px solid #D8D2C4;
    background: #FFFFFF;
    color: var(--primary-dark);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
    user-select: none;
    line-height: 1;
}

.editor-btn:hover {
    background: #EDE8DE;
    color: var(--primary);
    border-color: #BDB5A4;
    transform: translateY(-1px);
}

.editor-btn:active {
    transform: translateY(0);
    background: #DFD9CD;
}

.editor-btn i {
    font-size: 0.85rem;
    color: var(--primary);
}

/* Service Landing Shortcuts (High-conversion internal linking) */
.editor-btn-service {
    background: #2C4336;
    color: #FFFFFF !important;
    border-color: #1F3026;
    font-weight: 600;
}

.editor-btn-service i {
    color: #C5A059;
}

.editor-btn-service:hover {
    background: #192A21;
    color: #F6E6C5 !important;
    border-color: #C5A059;
    box-shadow: 0 2px 5px rgba(44, 67, 54, 0.25);
}

.editor-btn-columns {
    background: #FDF9EE;
    color: #7D5D17;
    border-color: #DFCE9F;
}

.editor-btn-columns i {
    color: #C5A059;
}

.editor-btn-columns:hover {
    background: #F5ECCF;
    color: #5C430B;
}

.editor-btn-toggle {
    margin-left: auto;
    background: #FAF8F5;
    color: var(--text-muted);
}

.editor-btn-toggle.active {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
}

.editor-btn-toggle.active i {
    color: #FFFFFF;
}

.editor-textarea {
    width: 100%;
    border: none;
    border-radius: 0;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #2D3748;
    background: #FFFFFF;
    resize: vertical;
    outline: none;
    display: block;
}

.editor-textarea:focus {
    box-shadow: inset 0 0 0 2px rgba(44, 67, 54, 0.15);
}

.editor-preview {
    padding: 24px 28px;
    background: #FAF8F5;
    border-top: 1px solid var(--border-color);
    min-height: 250px;
    display: none;
    line-height: 1.8;
}

.editor-preview.active {
    display: block;
}

.editor-preview h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin: 20px 0 12px;
}

.editor-preview h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    color: var(--primary);
    margin: 16px 0 10px;
}

.editor-preview h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    color: var(--primary-light);
    margin: 14px 0 8px;
}

.editor-preview p {
    margin-bottom: 14px;
    color: var(--text-main);
}

.editor-preview ul, .editor-preview ol {
    margin: 14px 0 18px 24px;
}

.editor-preview li {
    margin-bottom: 6px;
}

.editor-preview a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

.editor-preview a:hover {
    color: var(--accent);
}

.editor-help-tip {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 8px 14px;
    background: #FAF8F5;
    border-top: 1px dashed var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

