/* modern.css - Portagest Modern UI System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #d72638;
    --primary-dark: #a41d28;
    --primary-light: #fbebed;
    --sidebar-bg: #111827;
    --sidebar-hover: #1f2937;
    --sidebar-active: #374151;
    --sidebar-text: #9ca3af;
    --sidebar-text-hover: #ffffff;
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
}

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

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.sidebar-header img {
    height: 32px;
    filter: brightness(0) invert(1);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 0 0.75rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none !important;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
}

.nav-item.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--sidebar-hover);
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    width: calc(100% - var(--sidebar-width));
}

/* Header / Top Bar (Optional if integrated in layout) */
.top-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* Common Components */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons Overrides */
.btn {
    border-radius: 10px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary, .btn-nuevo {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: white !important;
}

.btn-primary:hover, .btn-nuevo:hover {
    background-color: var(--primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(215, 38, 56, 0.2);
}

/* Table Modernization */
.table-responsive {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: #f1f5f9;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1rem;
    text-align: left;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #f8fafc;
}

/* Forms Modernization */
input[type="text"], input[type="email"], input[type="password"], select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fcfcfc;
    transition: all 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(215, 38, 56, 0.1);
    background: white;
}

/* Specific Dashboard adjustments */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.kpi {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: left;
}

.kpi .lbl {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.kpi .val {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
}

/* Reset existing .wrap if present */
.wrap {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* FullCalendar Modernization */
#calendario {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
}

.fc .fc-toolbar-title {
    color: var(--text-main);
    font-weight: 800;
    font-size: 1.25rem;
}

.fc .fc-button-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.fc .fc-button-primary:hover {
    background-color: var(--primary-dark);
}

.fc .fc-timegrid-slot {
    height: 40px !important;
}

.fc .fc-timegrid-axis-frame {
    height: 40px !important;
}

.fc .fc-timegrid-event {
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: none !important;
}

.fc .fc-event-main {
    padding: 4px 8px !important;
}

.pc-ev {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pc-ev-time {
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0.9;
}

.pc-ev-title {
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1.2;
}
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    .sidebar-header h1, .nav-item span {
        display: none;
    }
    .main-content {
        margin-left: 80px;
        width: calc(100% - 80px);
    }
}

@media (max-width: 640px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
}
