/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #F8F9FB; /* Light gray background */
    color: #1A1A1A; /* Dark gray for primary text */
    -webkit-font-smoothing: antialiased;
}

/* Screen Management */
.screen {
    display: none;
    height: 100vh;
    width: 100vw;
}

.screen.active {
    display: flex;
}

/* Auth Screens */
#login-screen, #register-screen {
    justify-content: center;
    align-items: center;
    background-color: #EBF0F5;
}

.auth-card {
    background: #FFFFFF;
    padding: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.auth-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.auth-card p {
    color: #6B7280;
    margin-bottom: 32px;
    font-size: 14px;
}

.auth-card input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

.auth-card input:focus {
    outline: none;
    border-color: #2F6BFF;
}

.auth-links {
    margin-top: 16px;
}

.auth-links a {
    color: #2F6BFF;
    text-decoration: none;
    font-size: 14px;
}

/* Buttons */
.btn-primary {
    background-color: #1A1A1A;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #333333;
}

.btn-secondary {
    background-color: #FFFFFF;
    color: #1A1A1A;
    border: 1px solid #E2E8F0;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #F8F9FB;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: #FFFFFF;
    border-right: 1px solid #EAEAEA;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.brand {
    margin-bottom: 40px;
}

.logo-box {
    width: 40px;
    height: 40px;
    background-color: #1A1A1A;
    border-radius: 8px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.nav-title {
    font-size: 12px;
    text-transform: uppercase;
    color: #8D94A5;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    display: inline-block;
}

.nav-menu ul {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-menu a {
    text-decoration: none;
    color: #4A5568;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.nav-menu li.active a, .nav-menu a:hover {
    background-color: #F3F4F6;
    color: #1A1A1A;
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: #F9FAFB;
    border-radius: 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #2DCCA7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

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

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: #8D94A5;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 32px 48px;
}

.top-header {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    align-items: center;
}

.client-selector {
    flex-grow: 1;
}

.client-selector select {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #EAEAEA;
    background-color: #FFFFFF;
    font-size: 16px;
    font-weight: 500;
    color: #1A1A1A;
    font-family: 'Inter', sans-serif;
    outline: none;
}

/* Grid layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.widget-kpi {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.kpi-title {
    font-size: 14px;
    color: #6B7280;
    font-weight: 500;
    display: block;
    margin-bottom: 16px;
}

.kpi-value {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.kpi-value span:first-child {
    font-size: 40px;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1;
}

.badge {
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
}

.badge-success { background-color: #E6FDF4; color: #0C9766; }
.badge-warning { background-color: #FFF3E0; color: #E65100; }
.badge-danger { background-color: #FEE2E2; color: #DC2626; }
.badge-neutral { background-color: #F3F4F6; color: #4B5563; }

.widget-large {
    grid-column: span 2;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.widget-medium {
    grid-column: span 1;
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.widget-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.info-icon {
    font-size: 16px;
    color: #8D94A5;
}

/* List Items (Semáforo) */
.report-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #F3F4F6;
}

.report-item:last-child {
    border-bottom: none;
}

.report-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.report-title {
    font-size: 14px;
    font-weight: 600;
}

.report-date {
    font-size: 12px;
    color: #6B7280;
}

.report-actions {
    display: flex;
    gap: 8px;
}

.btn-upload {
    background: none;
    border: none;
    color: #2F6BFF;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}
.btn-finish {
    background: none;
    border: none;
    color: #2DCCA7;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 26, 0.4);
    backdrop-filter: blur(2px);
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #FFFFFF;
    padding: 32px;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: sticky;
    top: -10px;
    float: right;
    margin-right: -10px;
    margin-top: -10px;
    margin-bottom: 10px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    color: #FFFFFF;
    background-color: #EF4444;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.2s, background-color 0.2s;
}

.close-modal:hover {
    background-color: #DC2626;
    transform: scale(1.1);
}

.modal input, .modal select, .modal textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
}

/* Calendario Global */
.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.calendar-grid-header div {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    border-right: 1px solid #E2E8F0;
}

.calendar-grid-header div:last-child {
    border-right: none;
}

.calendar-grid-body {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid #E2E8F0;
    border-radius: 0 0 8px 8px;
    background: #FFFFFF;
}

.calendar-day {
    min-height: 120px;
    min-width: 0;
    padding: 8px;
    border-right: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    transition: background-color 0.2s;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day.empty {
    background: #F8FAFC;
    color: #94A3B8;
}

.calendar-day.today {
    background: #F0FDF4;
    box-shadow: inset 0 0 0 2px #22C55E;
}

.calendar-day-header {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #1E3A8A; /* Azul Oscuro */
    margin-bottom: 8px;
}

.calendar-event {
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    display: block;
    text-decoration: none;
}

.calendar-event:hover {
    filter: brightness(0.95);
}

.calendar-event.pending {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.calendar-event.done {
    background: #DCFCE7;
    color: #166534;
    border: 1px solid #86EFAC;
}

.more-events-btn {
    font-size: 11px;
    color: #3B82F6;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-weight: 600;
    width: 100%;
    text-align: left;
}

.more-events-btn:hover {
    text-decoration: underline;
}

.calendar-events-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
