/* ==============================================================================
   LocFiber Admin - Design System e Estilos Globais
   Aesthetics: Modern Luxury, Clean Glassmorphism, Dark/Light Themes
   ============================================================================== */

:root {
    --bg-base: #090d16;
    --bg-surface: #111827;
    --bg-surface-elevated: #1e293b;
    --bg-surface-translucent: rgba(17, 24, 39, 0.75);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(56, 189, 248, 0.3);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #0284c7;
    --accent-gradient: linear-gradient(135deg, #0284c7, #2563eb);
    --accent-glow: rgba(2, 132, 199, 0.35);
    
    --whatsapp-green: #25d366;
    --whatsapp-gradient: linear-gradient(135deg, #10b981, #059669);
    
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    
    --sidebar-width: 260px;
    --header-height: 70px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f8fafc;
    --bg-surface-translucent: rgba(255, 255, 255, 0.85);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(2, 132, 199, 0.4);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, .brand-font {
    font-family: 'Outfit', sans-serif;
}

/* ==============================================================================
   Sidebar Layout
   ============================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.logo-badge {
    width: 38px;
    height: 38px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.sidebar-title h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(to right, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-title span {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
}

.nav-link.active {
    color: #fff;
    background: var(--accent-gradient);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.nav-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.nav-badge.pulsing {
    background: #ec4899;
    color: #fff;
    animation: pulse 1.5s infinite;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==============================================================================
   Main Content Layout
   ============================================================================== */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - var(--sidebar-width));
}

.top-header {
    height: var(--header-height);
    background: var(--bg-surface-translucent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-title h1 {
    font-size: 1.35rem;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Birthday header action button */
.btn-birthday-banner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: linear-gradient(135deg, #f43f5e, #ec4899);
    color: #fff;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(236, 72, 153, 0.4);
    transition: all 0.2s ease;
}

.btn-birthday-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(236, 72, 153, 0.5);
}

.content-body {
    padding: 2rem;
    flex: 1;
}

/* ==============================================================================
   Dashboard Cards & KPIs
   ============================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
}

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

.stat-icon.blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.stat-icon.green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.stat-icon.purple { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.stat-icon.pink { background: rgba(244, 63, 94, 0.15); color: #f43f5e; }

.stat-info h3 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==============================================================================
   Tables & Data Containers
   ============================================================================== */
.table-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.table-toolbar {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    min-width: 280px;
}

.search-input {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 1rem 0.6rem 2.4rem;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: all 0.2s ease;
}

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

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

.data-table th {
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* ==============================================================================
   Badges, Pills & Action Buttons
   ============================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-green { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.badge-pink { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.badge-gray { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

.action-btn-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-icon.whatsapp {
    color: var(--whatsapp-green);
    background: rgba(37, 211, 102, 0.1);
    border-color: rgba(37, 211, 102, 0.2);
}

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

.btn-icon.delete:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

/* ==============================================================================
   Modals
   ============================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
    transform: translateY(20px);
    transition: transform 0.25s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.75rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.25rem 1.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background: var(--bg-surface-elevated);
}

/* ==============================================================================
   Animations & Toast
   ============================================================================== */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateY(0);
}

/* ==============================================================================
   Badges de Versão da Aplicação
   ============================================================================== */
.version-badge {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    display: inline-block;
}

.app-version-pill {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.app-version-pill::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.badge-version {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    display: inline-block;
}

