﻿/* HydraAgenda - Main Stylesheet
 * Sistema de Agendamento SaaS - HydraSoftware
 * Design System com tema dark/light e glassmorphism
 */

:root {
    /* Dark Theme (Default) */
    --bg-primary: #0A0E1A;
    --bg-secondary: #1A1F2E;
    --bg-tertiary: #2A2F3E;
    --text-primary: #F0F0F0;
    --text-secondary: #B0B0B0;
    --text-muted: #808080;
    --accent-primary: #00F2FF;
    --accent-secondary: #8A2BE2;
    --accent-color: #6366F1;
    --accent-hover: #4F46E5;
    --accent-active: #3730A3;
    --accent-gradient: linear-gradient(135deg, #00F2FF 0%, #8A2BE2 100%);
    --border-color: rgba(240, 240, 240, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(26, 31, 46, 0.8);
    --glass-border: rgba(240, 240, 240, 0.1);
    
    /* Status Colors */
    --success: #00C851;
    --warning: #FF8800;
    --error: #FF4444;
    --info: #33B5E5;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

[data-theme="light"] {
    /* Light Theme */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #E9ECEF;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6C757D;
    --accent-primary: #00F2FF;
    --accent-secondary: #8A2BE2;
    --accent-color: #6366F1;
    --accent-hover: #4F46E5;
    --accent-active: #3730A3;
    --accent-gradient: linear-gradient(135deg, #00F2FF 0%, #8A2BE2 100%);
    --border-color: rgba(33, 37, 41, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(248, 249, 250, 0.8);
    --glass-border: rgba(33, 37, 41, 0.1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-secondary);
}

/* Glassmorphism Components */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--shadow-color);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px var(--shadow-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-gradient) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(0, 242, 255, 0.3);
    font-weight: 600 !important;
    border: 1px solid transparent !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 242, 255, 0.4);
    color: white !important;
}

.btn-secondary {
    background: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    font-weight: 500 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--accent-primary) !important;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #CC0000;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary) !important;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.1);
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 0;
    z-index: 1000;
    transition: transform var(--transition-normal);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.main-content {
    margin-left: 280px;
    min-height: 100vh;
    padding: 2rem;
    transition: margin-left var(--transition-normal);
}

.main-content.expanded {
    margin-left: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.header h1 {
    margin-bottom: 0;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Navigation */
.nav-menu {
    list-style: none;
    padding: 0 1rem;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    background: var(--accent-gradient);
    color: white;
    transform: translateX(4px);
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    stroke: currentColor;
}

/* Theme Toggle */

/* Garantir que o botÃ£o de tema funcione corretamente */
.theme-toggle i[data-feather] {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Garantir visibilidade do Ã­cone do botÃ£o de tema */
.theme-toggle i[data-feather="sun"],
.theme-toggle i[data-feather="moon"] {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: inherit !important;
}

/* Garantir que o botÃ£o de tema seja visÃ­vel */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1000;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: white;
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* ForÃ§ar visibilidade do Ã­cone em todas as situaÃ§Ãµes */
.theme-toggle i,
.theme-toggle i[data-feather],
.theme-toggle svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: inherit !important;
    fill: none !important;
    stroke: currentColor !important;
}

/* Estilos especÃ­ficos para pÃ¡ginas problemÃ¡ticas */
#theme-toggle,
#theme-toggle i,
#theme-toggle i[data-feather],
#theme-toggle svg {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 40px !important;
    height: 40px !important;
}

#theme-toggle i,
#theme-toggle i[data-feather],
#theme-toggle svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2 !important;
    color: inherit !important;
    fill: none !important;
    stroke: currentColor !important;
}

/* Search Input Styles - Simplified without icon */
.search-input {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-input input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-input input::placeholder {
    color: var(--text-muted);
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 4px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

::-webkit-scrollbar-thumb:active {
    background: var(--accent-active);
}

::-webkit-scrollbar-corner {
    background: var(--bg-secondary);
}

/* Exclude FullCalendar from global scrollbar styles */
.fc *::-webkit-scrollbar {
    width: auto;
    height: auto;
}

.fc *::-webkit-scrollbar-track {
    background: auto;
    border-radius: auto;
}

.fc *::-webkit-scrollbar-thumb {
    background: auto;
    border-radius: auto;
    transition: auto;
}

.fc *::-webkit-scrollbar-thumb:hover {
    background: auto;
}

.fc *::-webkit-scrollbar-thumb:active {
    background: auto;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-secondary);
}

/* Exclude FullCalendar from Firefox scrollbar styles */
.fc * {
    scrollbar-width: auto;
    scrollbar-color: auto;
}

/* Modal Scrollbar */
.modal-content {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-secondary);
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Table Scrollbar */
.data-table-container,
#clients-table-container {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-secondary);
}

.data-table-container::-webkit-scrollbar,
#clients-table-container::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.data-table-container::-webkit-scrollbar-track,
#clients-table-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.data-table-container::-webkit-scrollbar-thumb,
#clients-table-container::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.data-table-container::-webkit-scrollbar-thumb:hover,
#clients-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Calendar and Other Elements Scrollbar */
.calendar-container::-webkit-scrollbar,
.sidebar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.calendar-container::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.calendar-container::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.calendar-container::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* Responsive search input */
@media (max-width: 768px) {
    .search-input input {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
    
    /* Smaller scrollbar on mobile */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
}

/* Header Actions - Layout para todas as pÃ¡ginas */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.header > div:first-child {
    flex: 1;
    min-width: 200px;
}

/* Responsividade para header-actions */
@media (max-width: 1024px) {
    .header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .theme-toggle {
        align-self: center;
        margin-top: 0.5rem;
        order: 3;
    }
}

/* Estilos especÃ­ficos para filtros de data (Dashboard) */
.date-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-right: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.filter-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(0, 242, 255, 0.2);
}

/* Responsividade para filtros de data */
@media (max-width: 1024px) {
    .date-filters {
        margin-right: 0;
        justify-content: center;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .date-filters {
        flex-direction: column;
        gap: 0.5rem;
        margin-right: 0;
        margin-bottom: 0;
        justify-content: stretch;
    }
    
    .filter-group {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    
    .filter-group label {
        min-width: 80px;
    }
}

/* Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px var(--shadow-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Grid System */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(0, 200, 81, 0.2);
    color: var(--success);
    border: 1px solid rgba(0, 200, 81, 0.3);
}

.badge-warning {
    background: rgba(255, 136, 0, 0.2);
    color: var(--warning);
    border: 1px solid rgba(255, 136, 0, 0.3);
}

.badge-error {
    background: rgba(255, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.badge-info {
    background: rgba(51, 181, 229, 0.2);
    color: var(--info);
    border: 1px solid rgba(51, 181, 229, 0.3);
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Chart.js Theme Support */
.chart-container {
    position: relative;
    height: 300px;
}

.chart-container canvas {
    max-height: 100% !important;
}

/* Chart.js Dark Theme Overrides */
[data-theme="dark"] .chart-container {
    color: var(--text-primary);
}

[data-theme="dark"] .chartjs-tooltip {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .chartjs-tooltip-key {
    background: var(--accent-primary) !important;
}

/* FullCalendar Theme Support */
.fc {
    font-family: inherit;
    border-radius: 8px;
    overflow: hidden;
}

.fc-theme-standard .fc-scrollgrid {
    border: 1px solid var(--border-color);
}

.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--border-color);
}

/* Dark Theme Calendar */
[data-theme="dark"] .fc {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .fc-theme-standard .fc-scrollgrid {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .fc-theme-standard td, 
[data-theme="dark"] .fc-theme-standard th {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .fc-col-header-cell {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .fc-daygrid-day {
    background: var(--bg-secondary);
}

[data-theme="dark"] .fc-daygrid-day:hover {
    background: var(--bg-primary);
}

[data-theme="dark"] .fc-day-today {
    background: rgba(0, 242, 255, 0.1) !important;
}

[data-theme="dark"] .fc-day-today .fc-daygrid-day-number {
    color: var(--accent-primary) !important;
    font-weight: bold;
}

[data-theme="dark"] .fc-button {
    background: var(--bg-primary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .fc-button:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #FFFFFF;
}

[data-theme="dark"] .fc-button-active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #FFFFFF;
}

[data-theme="dark"] .fc-toolbar-title {
    color: var(--text-primary);
}

[data-theme="dark"] .fc-timegrid-slot {
    background: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .fc-timegrid-slot-label {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .fc-timegrid-axis {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .fc-timegrid-now-indicator-line {
    border-color: var(--accent-primary);
}

[data-theme="dark"] .fc-timegrid-now-indicator-arrow {
    border-top-color: var(--accent-primary);
}

/* Light Theme Calendar */
[data-theme="light"] .fc {
    background: #FFFFFF;
    color: #212529;
}

[data-theme="light"] .fc-theme-standard .fc-scrollgrid {
    background: #FFFFFF;
    border-color: #E9ECEF;
}

[data-theme="light"] .fc-theme-standard td, 
[data-theme="light"] .fc-theme-standard th {
    background: #FFFFFF;
    border-color: #E9ECEF;
    color: #212529;
}

[data-theme="light"] .fc-col-header-cell {
    background: #F8F9FA;
    color: #212529;
}

[data-theme="light"] .fc-daygrid-day {
    background: #FFFFFF;
}

[data-theme="light"] .fc-daygrid-day:hover {
    background: #F8F9FA;
}

[data-theme="light"] .fc-day-today {
    background: rgba(0, 242, 255, 0.1) !important;
}

[data-theme="light"] .fc-day-today .fc-daygrid-day-number {
    color: #00F2FF !important;
    font-weight: bold;
}

[data-theme="light"] .fc-button {
    background: #F8F9FA;
    border-color: #E9ECEF;
    color: #212529;
}

[data-theme="light"] .fc-button:hover {
    background: #00F2FF;
    border-color: #00F2FF;
    color: #FFFFFF;
}

[data-theme="light"] .fc-button-active {
    background: #00F2FF;
    border-color: #00F2FF;
    color: #FFFFFF;
}

[data-theme="light"] .fc-toolbar-title {
    color: #212529;
}

[data-theme="light"] .fc-timegrid-slot {
    background: #F8F9FA;
    border-color: #E9ECEF;
}

[data-theme="light"] .fc-timegrid-slot-label {
    background: #FFFFFF;
    color: #6C757D;
    border-color: #E9ECEF;
}

[data-theme="light"] .fc-timegrid-axis {
    background: #FFFFFF;
    color: #6C757D;
    border-color: #E9ECEF;
}

[data-theme="light"] .fc-timegrid-now-indicator-line {
    border-color: #00F2FF;
}

[data-theme="light"] .fc-timegrid-now-indicator-arrow {
    border-top-color: #00F2FF;
}

/* Calendar Events */
.fc-event {
    border-radius: 4px;
    border: none;
    padding: 2px 4px;
    font-size: 12px;
    font-weight: 500;
}

.fc-event-title {
    font-weight: 500;
}

.fc-event-time {
    font-weight: 400;
    opacity: 0.9;
}

/* Event Status Colors */
.fc-event[data-status="scheduled"] {
    background: #00F2FF;
    color: #FFFFFF;
}

.fc-event[data-status="confirmed"] {
    background: #00C851;
    color: #FFFFFF;
}

.fc-event[data-status="completed"] {
    background: #8A2BE2;
    color: #FFFFFF;
}

.fc-event[data-status="cancelled"] {
    background: #FF4444;
    color: #FFFFFF;
}

.fc-event[data-status="no_show"] {
    background: #FF8800;
    color: #FFFFFF;
}

/* Calendar Popover */
.fc-popover {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fc-popover-header {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 12px;
    font-weight: 500;
}

.fc-popover-body {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px 12px;
}

/* Calendar Modal */
.fc-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
}

/* Responsive Calendar */
@media (max-width: 768px) {
    .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
    }
    
    .fc-button {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .fc-toolbar-title {
        font-size: 18px;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.875rem;
}


/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}



/* Grid System */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Service Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.service-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--accent-primary);
}

.service-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-status.active {
    background: rgba(0, 200, 81, 0.1);
    color: #00C851;
    border: 1px solid rgba(0, 200, 81, 0.3);
}

.service-status.inactive {
    background: rgba(255, 68, 68, 0.1);
    color: #FF4444;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-right: 4rem; /* Space for status badge */
}

.service-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    flex: 1;
}

.service-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.service-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.service-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.service-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.service-detail i {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}

.service-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.service-actions .btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .service-details {
        grid-template-columns: 1fr;
    }
    
    .service-actions {
        flex-direction: column;
    }
}

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-xl { border-radius: 16px; }

.shadow { box-shadow: 0 4px 16px var(--shadow-color); }
.shadow-lg { box-shadow: 0 8px 24px var(--shadow-color); }

/* Feather Icons Styling */
[data-feather] {
    width: 1em;
    height: 1em;
    stroke-width: 2;
}

/* Melhorar visibilidade dos Ã­cones no modo dark */
[data-theme="dark"] [data-feather] {
    filter: drop-shadow(0 0 2px rgba(240, 240, 240, 0.3));
}

/* Classe para Ã­cones primÃ¡rios */
.text-primary {
    color: var(--accent-primary) !important;
}

[data-theme="dark"] .text-primary {
    color: #00F2FF !important;
    filter: drop-shadow(0 0 4px rgba(0, 242, 255, 0.4));
}

[data-theme="light"] .text-primary {
    color: #0066CC !important;
}

/* Melhorar visibilidade dos inputs de data no modo dark */
[data-theme="dark"] input[type="date"] {
    color: #F0F0F0 !important;
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
    opacity: 0.9;
    cursor: pointer;
}

[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1.5);
}

/* Firefox */
[data-theme="dark"] input[type="date"]::-moz-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.9;
}

/* Melhorar visibilidade dos inputs de data no modo light */
[data-theme="light"] input[type="date"] {
    color: #212529 !important;
    background-color: #FFFFFF !important;
    border-color: #DEE2E6 !important;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.8;
    cursor: pointer;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Garantir visibilidade dos botÃµes em ambos os temas */
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #00F2FF 0%, #0099CC 100%) !important;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, #0066CC 0%, #004499 100%) !important;
    color: #FFFFFF !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .btn-secondary {
    background: #2A2F3A !important;
    color: #F0F0F0 !important;
    border-color: #404550 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .btn-secondary {
    background: #F8F9FA !important;
    color: #212529 !important;
    border-color: #DEE2E6 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Melhorar visibilidade dos inputs datetime-local no modo dark */
[data-theme="dark"] input[type="datetime-local"] {
    color: #F0F0F0 !important;
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
    opacity: 0.9;
    cursor: pointer;
}

[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1.5);
}

/* Firefox para datetime-local */
[data-theme="dark"] input[type="datetime-local"]::-moz-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.9;
}

/* Melhorar visibilidade dos inputs datetime-local no modo light */
[data-theme="light"] input[type="datetime-local"] {
    color: #212529 !important;
    background-color: #FFFFFF !important;
    border-color: #DEE2E6 !important;
}

[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    opacity: 0.8;
    cursor: pointer;
}

[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Melhorar visibilidade de outros inputs de data/hora no modo dark */
[data-theme="dark"] input[type="time"] {
    color: #F0F0F0 !important;
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
    opacity: 0.9;
    cursor: pointer;
}

[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1.5);
}

[data-theme="dark"] input[type="month"] {
    color: #F0F0F0 !important;
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
    opacity: 0.9;
    cursor: pointer;
}

[data-theme="dark"] input[type="month"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1.5);
}

[data-theme="dark"] input[type="week"] {
    color: #F0F0F0 !important;
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] input[type="week"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
    opacity: 0.9;
    cursor: pointer;
}

[data-theme="dark"] input[type="week"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    filter: invert(1) brightness(1.5);
}

/* Garantir que os inputs de data/hora tenham prioridade sobre form-control */
[data-theme="dark"] .form-control[type="datetime-local"],
[data-theme="dark"] .form-control[type="date"],
[data-theme="dark"] .form-control[type="time"],
[data-theme="dark"] .form-control[type="month"],
[data-theme="dark"] .form-control[type="week"] {
    color: #F0F0F0 !important;
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="light"] .form-control[type="datetime-local"],
[data-theme="light"] .form-control[type="date"],
[data-theme="light"] .form-control[type="time"],
[data-theme="light"] .form-control[type="month"],
[data-theme="light"] .form-control[type="week"] {
    color: #212529 !important;
    background-color: #FFFFFF !important;
    border-color: #DEE2E6 !important;
}

/* Ãcones de calendÃ¡rio especÃ­ficos para inputs com classe form-control */
[data-theme="dark"] .form-control[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .form-control[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .form-control[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .form-control[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] .form-control[type="week"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2) !important;
    opacity: 0.9 !important;
    cursor: pointer !important;
}

[data-theme="dark"] .form-control[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] .form-control[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] .form-control[type="time"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] .form-control[type="month"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] .form-control[type="week"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1 !important;
    filter: invert(1) brightness(1.5) !important;
}

[data-theme="light"] .form-control[type="datetime-local"]::-webkit-calendar-picker-indicator,
[data-theme="light"] .form-control[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] .form-control[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="light"] .form-control[type="month"]::-webkit-calendar-picker-indicator,
[data-theme="light"] .form-control[type="week"]::-webkit-calendar-picker-indicator {
    opacity: 0.8 !important;
    cursor: pointer !important;
}

[data-theme="light"] .form-control[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] .form-control[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] .form-control[type="time"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] .form-control[type="month"]::-webkit-calendar-picker-indicator:hover,
[data-theme="light"] .form-control[type="week"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1 !important;
}

/* ============================================
   APPOINTMENTS PAGE STYLES
   ============================================ */

/* Appointment Filters */
.appointment-filters {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Removed old checkbox styles - now using custom-checkbox */

/* Bulk Actions Bar */
.bulk-actions-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease;
}

.bulk-info {
    font-weight: 500;
    color: var(--text-primary);
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.bulk-actions select {
    min-width: 180px;
}

/* Appointments Table */
.appointments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.appointments-table th,
.appointments-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.appointments-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.appointments-table tr:hover {
    background: var(--bg-secondary);
}

.appointments-table tr.selected {
    background: rgba(99, 102, 241, 0.1);
}

.appointments-table tr.selected td {
    border-color: var(--accent-color);
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-scheduled {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.status-confirmed {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.status-completed {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.status-no_show {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
}

/* Client Info */
.client-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.client-name {
    font-weight: 500;
    color: var(--text-primary);
}

.client-phone {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Services List */
.services-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.service-tag {
    background: var(--accent-color);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

/* Service tag with better contrast */
.service-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.service-tag:hover::before {
    opacity: 1;
}

/* Ensure text is always readable */
.service-tag {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dark theme specific adjustments */
[data-theme="dark"] .service-tag {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Light theme specific adjustments */
[data-theme="light"] .service-tag {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Actions */
.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

/* Appointment Details Modal */
.appointment-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.detail-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-section h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-item label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.detail-item span {
    color: var(--text-primary);
}

.service-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.service-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.service-price {
    margin-left: auto;
    font-weight: 600;
    color: var(--accent-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .appointment-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .bulk-actions-bar {
        flex-direction: column;
        gap: 1rem;
    }

    .bulk-actions {
        justify-content: center;
    }

    .appointments-table {
        font-size: 0.85rem;
    }

    .appointments-table th,
    .appointments-table td {
        padding: 0.5rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   END APPOINTMENTS PAGE STYLES
   ============================================ */

/* ============================================
   SWEETALERT2 CUSTOM STYLES
   ============================================ */

/* Custom SweetAlert2 styles for appointments */
.swal-custom-popup {
    background: var(--bg-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
    backdrop-filter: blur(10px) !important;
}

.swal-custom-title {
    color: var(--text-primary) !important;
    font-weight: 600 !important;
    font-size: 1.5rem !important;
}

.swal-custom-content {
    color: var(--text-secondary) !important;
}

.swal-custom-confirm {
    background: var(--accent-color) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
    transition: all var(--transition-fast) !important;
}

.swal-custom-confirm:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
}

.swal-custom-cancel {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    transition: all var(--transition-fast) !important;
}

.swal-custom-cancel:hover {
    background: var(--bg-tertiary) !important;
    border-color: var(--accent-color) !important;
    color: var(--text-primary) !important;
    transform: translateY(-1px) !important;
}

/* SweetAlert2 icon customization */
.swal2-icon.swal2-question {
    border-color: var(--accent-color) !important;
    color: var(--accent-color) !important;
}

.swal2-icon.swal2-success {
    border-color: var(--success) !important;
    color: var(--success) !important;
}

.swal2-icon.swal2-error {
    border-color: var(--error) !important;
    color: var(--error) !important;
}

/* SweetAlert2 loading animation */
.swal2-loader {
    border-color: var(--accent-color) transparent var(--accent-color) transparent !important;
}

/* ============================================
   END SWEETALERT2 CUSTOM STYLES
   ============================================ */

/* ============================================
   CUSTOM CHECKBOX STYLES
   ============================================ */

/* Custom checkbox for "Mostrar concluÃ­dos" */
.custom-checkbox {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.custom-checkbox:hover {
    color: var(--text-primary);
}

.custom-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox .checkmark {
    position: relative;
    height: 18px;
    width: 18px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 0.5rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-checkbox:hover .checkmark {
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.custom-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark:after {
    display: block;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark + .checkbox-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* Animation for checkbox check */
.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    animation: checkboxCheck 0.2s ease-in-out;
}

@keyframes checkboxCheck {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Focus states for accessibility */
.custom-checkbox input[type="checkbox"]:focus + .checkmark {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* ============================================
   END CUSTOM CHECKBOX STYLES
   ============================================ */


/* Forms and Templates Styles */
.template-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 16px var(--shadow-color);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
}

.template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.template-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.template-type {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-type.form {
    background: rgba(52, 144, 220, 0.1);
    color: #3490dc;
    border: 1px solid rgba(52, 144, 220, 0.2);
}

.template-type.prescription {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.template-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.template-status {
    margin-bottom: 1rem;
}

.template-status .status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-status .status.active {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.template-status .status.inactive {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.template-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.template-actions .btn {
    flex: 1;
    min-width: 0;
}

/* Template Modal - Extra Large Size */
#template-modal .modal-content {
    max-width: 1400px !important;
    width: 98% !important;
    max-height: 95vh !important;
}

#template-modal .modal-body {
    max-height: calc(95vh - 150px) !important;
    overflow-y: auto !important;
    padding: 2rem !important;
}

#template-editor {
    min-height: 300px !important;
    height: 300px !important;
}

.editor-container {
    margin-bottom: 1rem;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.editor-toolbar .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Tabs System */
.tabs-container {
    margin-bottom: 2rem;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 0.5rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
    background: var(--bg-secondary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Issued Forms Styles */
.issued-forms-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.issued-forms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.issued-forms-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.issued-forms-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.issued-forms-filters .form-control {
    min-width: 150px;
}

.issued-forms-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.issued-forms-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-primary);
}

.issued-forms-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.issued-forms-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.issued-forms-table tr:hover {
    background: var(--bg-secondary);
}

.issued-forms-table tr:last-child td {
    border-bottom: none;
}

/* Status and Type Badges for Issued Forms */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.draft {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}

.status-badge.signed {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.status-badge.completed {
    background: rgba(52, 144, 220, 0.1);
    color: #3490dc;
    border: 1px solid rgba(52, 144, 220, 0.2);
}

.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.form {
    background: rgba(52, 144, 220, 0.1);
    color: #3490dc;
    border: 1px solid rgba(52, 144, 220, 0.2);
}

.type-badge.prescription {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.2);
}

/* Actions in table */
.issued-forms-table .btn {
    margin-right: 0.5rem;
}

.issued-forms-table .btn:last-child {
    margin-right: 0;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Desktop - Hide mobile elements */
.mobile-menu-toggle {
    display: none;
}

.sidebar-close {
    display: none;
}

/* Mobile Styles (320px - 768px) */
@media (max-width: 768px) {
    /* Base Layout */
    body {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .main-content {
        padding: 1rem;
        margin-left: 0;
    }
    
    /* Header */
    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .header p {
        font-size: 0.875rem;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Date Filters */
    .date-filters {
        flex-direction: column;
        gap: 0.75rem;
        margin-right: 0;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group label {
        font-size: 0.875rem;
        margin-bottom: 0.25rem;
    }
    
    /* Grid System */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Cards */
    .card,
    .glass-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .card h3 {
        font-size: 1.125rem;
    }
    
    .card p {
        font-size: 0.875rem;
    }
    
    /* Stats Cards */
    .stats-card {
        padding: 1rem;
        text-align: center;
    }
    
    .stats-card .stat-number {
        font-size: 1.75rem;
    }
    
    .stats-card .stat-label {
        font-size: 0.875rem;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
    
    .form-control {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-height: 44px; /* Touch target */
    }
    
    .btn-sm {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-height: 36px;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.8rem;
        min-width: 600px;
    }
    
    th, td {
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }
    
    /* Modals */
    .modal-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .modal-footer {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Sidebar */
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .sidebar-nav {
        padding: 1rem;
    }
    
    .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Mobile Menu Toggle */
    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: var(--primary-color);
        color: white;
        border: none;
        border-radius: 50%;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    /* Sidebar Close Button */
    .sidebar-close {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: none;
        border: none;
        color: var(--text-color);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        transition: background-color 0.2s ease;
    }
    
    .sidebar-close:hover {
        background: rgba(0, 0, 0, 0.1);
    }
    
    /* Calendar */
    .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .fc-toolbar-title {
        font-size: 1.25rem;
    }
    
    .fc-button {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Search */
    .search-input input {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Tabs */
    .tabs-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        justify-content: center;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }
    
    /* Forms Page Specific */
    .issued-forms-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .issued-forms-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .issued-forms-filters .form-control {
        min-width: auto;
    }
    
    .issued-forms-table {
        font-size: 0.8rem;
    }
    
    .issued-forms-table th,
    .issued-forms-table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Service Cards */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-card {
        padding: 1rem;
    }
    
    .service-card h3 {
        font-size: 1.125rem;
    }
    
    .service-card p {
        font-size: 0.875rem;
    }
    
    /* Client Cards */
    .clients-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .client-card {
        padding: 1rem;
    }
    
    /* Appointment Filters */
    .appointment-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    /* Login Page */
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 1.5rem;
        margin: 0;
    }
    
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .login-header p {
        font-size: 0.875rem;
    }
    
    .login-tabs {
        margin-bottom: 1.5rem;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

/* Small Mobile (320px - 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
    }
    
    .header {
        padding: 0.75rem;
    }
    
    .card,
    .glass-card {
        padding: 0.75rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
    
    .btn {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.875rem;
        font-size: 0.9rem;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 0.375rem 0.125rem;
    }
}

/* Landscape Mobile (480px - 768px) */
@media (max-width: 768px) and (orientation: landscape) {
    .modal-content {
        max-height: calc(100vh - 1rem);
    }
    
    .modal-body {
        max-height: calc(100vh - 150px);
    }
    
    .header {
        flex-direction: row;
        align-items: center;
    }
    
    .header-actions {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .date-filters {
        flex-direction: row;
        gap: 0.5rem;
    }
}
